public static List <string> GetImmediateChildren(this ArchiveFile archive, string path, bool targetDirectories) { List <string> children = new List <string>(); int targetLevel = PathExtensions.GetLevel(path) + 1; List <string> searchPaths = targetDirectories ? archive.GetArchiveDirectories() : archive.GetArchiveEntryPaths(); foreach (string searchPath in searchPaths) { if (searchPath.StartsWith(path) && PathExtensions.GetLevel(searchPath) == targetLevel) { children.Add(searchPath); } } return(children); }
public static List <string> GetLevelFiles(this ArchiveFile archive, int level) { return(GetArchiveFiles(archive).Where(x => PathExtensions.GetLevel(x) == level).ToList()); }