WinterSync.Archive.ListFiles C# (CSharp) 메소드

ListFiles() 공개 메소드

public ListFiles ( ) : string[]
리턴 string[]
        public string[] ListFiles()
        {
            const string springIgnoreFileName = "springignore.txt";
            const char springIgnoreComment = '#';
            var rawFileList = RawListFiles();
            if (!rawFileList.Any(file => file == springIgnoreFileName)) return RawListFiles();
            var ignoreLines = ExtractTextFile(springIgnoreFileName).Replace("\r\n", "\n").Split('\n').ToArray();
            for (var i = 0; i < ignoreLines.Length; i++) {
                var pos = ignoreLines[i].IndexOf(springIgnoreComment);
                if (pos == -1) continue;
                ignoreLines[i] = ignoreLines[i].Substring(pos + 1);
            }
            ignoreLines = ignoreLines.Where(l => !String.IsNullOrEmpty(l)).ToArray();
            return RawListFiles().Where(file => !ignoreLines.Any(pattern => Regex.IsMatch(file, pattern))).ToArray();
        }

Same methods

Archive::ListFiles ( string archiveName ) : string[]

Usage Example

예제 #1
0
 static string FindModInfo(Archive archive, string extension)
 {
     return(archive.ListFiles().FirstOrDefault(fileName => fileName.ToLower() == "modinfo." + extension));
 }
All Usage Examples Of WinterSync.Archive::ListFiles