Skip to content

Commit 16b075a

Browse files
committed
ADD: add get document/app/temp directory macros.
1 parent f1d775d commit 16b075a

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

Macros/MacroUtils.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#define debugMethod()
1313
#endif
1414

15-
#define EMPTY_STRING @""
15+
#define EMPTY_STRING @""
1616

17-
#define STR(key) NSLocalizedString(key, nil)
17+
#define STR(key) NSLocalizedString(key, nil)
18+
19+
#define PATH_OF_APP_HOME NSHomeDirectory()
20+
#define PATH_OF_TEMP NSTemporaryDirectory()
21+
#define PATH_OF_DOCUMENT [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]

Macros/VersionCompare.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/*
88
* System Versioning Preprocessor Macros
9-
*/
9+
*/
1010
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
1111
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
1212
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
@@ -24,4 +24,4 @@ if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"3.1.1")) {
2424
...
2525
}
2626
27-
*/
27+
*/

NSStringWrappeer/NSStringWrapper/NSStringWrapper.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
/** Return the char value at the specified index. */
1414
- (unichar) charAt:(int)index;
1515

16-
/**
17-
* Compares two strings lexicographically.
18-
* the value 0 if the argument string is equal to this string;
19-
* a value less than 0 if this string is lexicographically less than the string argument;
16+
/**
17+
* Compares two strings lexicographically.
18+
* the value 0 if the argument string is equal to this string;
19+
* a value less than 0 if this string is lexicographically less than the string argument;
2020
* and a value greater than 0 if this string is lexicographically greater than the string argument.
2121
*/
2222
- (int) compareTo:(NSString*) anotherString;
@@ -59,7 +59,7 @@
5959

6060
- (NSString *) replaceAll:(NSString*)origin with:(NSString*)replacement;
6161

62-
- (NSArray *) split:(NSString*) separator;
62+
- (NSArray *) split:(NSString*) separator;
6363

6464
@end
6565

NSStringWrappeer/NSStringWrapper/NSStringWrapper.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ - (unichar) charAt:(int)index {
1717
return [self characterAtIndex:index];
1818
}
1919

20-
/**
21-
* Java-like method. Compares two strings lexicographically.
22-
* the value 0 if the argument string is equal to this string;
23-
* a value less than 0 if this string is lexicographically less than the string argument;
20+
/**
21+
* Java-like method. Compares two strings lexicographically.
22+
* the value 0 if the argument string is equal to this string;
23+
* a value less than 0 if this string is lexicographically less than the string argument;
2424
* and a value greater than 0 if this string is lexicographically greater than the string argument.
2525
*/
2626
- (int) compareTo:(NSString*) anotherString {
@@ -151,7 +151,7 @@ - (NSString *) replaceAll:(NSString*)origin with:(NSString*)replacement {
151151

152152
- (NSArray *) split:(NSString*) separator {
153153
return [self componentsSeparatedByString:separator];
154-
}
154+
}
155155

156156

157157
@end

0 commit comments

Comments
 (0)