diff options
Diffstat (limited to 'src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm')
-rw-r--r-- | src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm new file mode 100644 index 0000000000..53f43e3c12 --- /dev/null +++ b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm @@ -0,0 +1,18 @@ +/* + * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file. + */ + +#import "nsstringexpandpath.h" + +@implementation NSString (ExpandPath) + +- (NSString *)expandPath { + if ([self isAbsolutePath]) { + return [self stringByStandardizingPath]; + } else { + NSString *cwd = [[NSFileManager defaultManager] currentDirectoryPath]; + return [[cwd stringByAppendingPathComponent:self] stringByStandardizingPath]; + } +} + +@end |