c_cpp Objective-C唯一のiOSファイルパスライブラリ,YKFileの说明书参考:http://qiita.com/GeneralD/items/b8bd37b1f698ee98fe58

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp Objective-C唯一のiOSファイルパスライブラリ,YKFileの说明书参考:http://qiita.com/GeneralD/items/b8bd37b1f698ee98fe58相关的知识,希望对你有一定的参考价值。

YKFile *file = [YKFile documentsDirectory];
[file changeDirectory:@"Assets/dir1/file1.text"];
YKFile *file = [YKFile documentsDirectory];
[file changeDirectory:@"Assets"];
[UIImage imageWithContentsOfFile:file.fullPath];
YKFile *file = [YKFile documentsDirectory];
[file cd: @"abc/def/*/*"];
YKFile *file = [YKFile documentsDirectory];
[file makeDirectory:@"Assets"];
YKFile *file = [YKFile documentsDirectory];
[file changeDirectory:@"Assets"];
[file makeDirectory];
pod "YKFile"
#pragma mark - 'cd' Method

- (void)changeDirectory:(NSString *)path {
    NSArray *components = path.pathComponents;
    for (int i = 0; i < [components count]; i++) {
        NSString *component = components[i];
        if (i == 0 && [component isEqualToString:@"~"]) { // cd ~
            _fullPath = NSHomeDirectory();
        } else if ([component isEqualToString:@".."]) { // cd ..
            _fullPath = self.parentFile.fullPath;
        } else if ([component isEqualToString:@"."]) { // cd .
        } else if ([component isEqualToString:@"*"]) { // cd to first found file or directory
            YKFileArray *list = [self listFiles];
            for (YKFile *file in list) {
                if ([file.name isEqual:@".DS_Store"]) continue;
                if ([file.name isEqual:@"Thumbs.db"]) continue;
                _fullPath = file.fullPath;
                break;
            }
        } else { // cd component
            _fullPath = [_fullPath stringByAppendingPathComponent:component];
        }
    }
}
#pragma mark - Aliases
- (void)cd:(NSString *)path;
- (void)cd;
- (BOOL)mkdir:(NSString *)dirName;
- (BOOL)mkdirs:(NSString *)dirName;
- (BOOL)mkdir;
- (BOOL)mkdirs;
- (BOOL)rm:(NSString *)name;
- (BOOL)rm;
- (BOOL)cp:(YKFile *)destination;
- (BOOL)mv:(YKFile *)destination;
+ (instancetype)homeDirectory;
+ (instancetype)mainBundleDirectory;
+ (instancetype)cachesDirectory;
+ (instancetype)documentsDirectory;
+ (instancetype)temporaryDirectory;
- (void)eachFile:(void (^)(YKFile *file, NSUInteger idx))pFunction;
- (void)sortFiles:(NSComparisonResult (^)(YKFile *file1, YKFile *file2))pFunction;
- (void)removeFilesFromList:(BOOL (^)(YKFile *file))pFunction;
- (YKFileArray *)cutFilesFromList:(BOOL (^)(YKFile *file))pFunction;

以上是关于c_cpp Objective-C唯一のiOSファイルパスライブラリ,YKFileの说明书参考:http://qiita.com/GeneralD/items/b8bd37b1f698ee98fe58的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf Serfの起动时に设定ファイルを読み込む。参考:http://www.serfdom.io/docs/agent/options.html

apache_conf Serfの起动时に设定ファイルを読み込む。参考:http://www.serfdom.io/docs/agent/options.html

vbscript 复数のExcel的ファイルを1ファイルにまとめる的VBScript

text svimのCSSファイル

json 铁锁-元素の,日本语キーボードの设定ファイル例

json postcss分选の设定ファイル