public DirectoryEntryType GetEntryType(string path) { path = PathTools.Normalize(path); if (path == "/") { return(DirectoryEntryType.Directory); } if (FileDict.ContainsKey(path.TrimStart('/'))) { return(DirectoryEntryType.File); } return(DirectoryEntryType.NotFound); }
public DirectoryEntryType GetEntryType(string path) { path = PathTools.Normalize(path); if (path == "/") { return(DirectoryEntryType.Directory); } if (FileDict.ContainsKey(path)) { return(DirectoryEntryType.File); } throw new FileNotFoundException(path); }
protected override Result DoGetEntryType(out DirectoryEntryType entryType, U8Span path) { UnsafeHelpers.SkipParamInit(out entryType); if (path.ToString() == "/") { entryType = DirectoryEntryType.Directory; return(Result.Success); } if (FileDict.ContainsKey(path.ToString().TrimStart('/'))) { entryType = DirectoryEntryType.File; return(Result.Success); } return(ResultFs.PathNotFound.Log()); }
protected override Result GetEntryTypeImpl(out DirectoryEntryType entryType, U8Span path) { entryType = default; if (path.ToString() == "/") { entryType = DirectoryEntryType.Directory; return(Result.Success); } if (FileDict.ContainsKey(path.ToString().TrimStart('/'))) { entryType = DirectoryEntryType.File; return(Result.Success); } return(ResultFs.PathNotFound.Log()); }
protected override Result GetEntryTypeImpl(out DirectoryEntryType entryType, string path) { entryType = DirectoryEntryType.NotFound; path = PathTools.Normalize(path); if (path == "/") { entryType = DirectoryEntryType.Directory; return(Result.Success); } if (FileDict.ContainsKey(path.TrimStart('/'))) { entryType = DirectoryEntryType.File; return(Result.Success); } return(ResultFs.PathNotFound.Log()); }
public bool FileExists(string filename) { return(FileDict.ContainsKey(filename)); }
public bool FileExists(string filename) => FileDict.ContainsKey(filename);
public bool FileExists(string path) { path = PathTools.Normalize(path).TrimStart('/'); return(FileDict.ContainsKey(path)); }