示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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());
        }
示例#5
0
        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());
        }
示例#6
0
 public bool FileExists(string filename)
 {
     return(FileDict.ContainsKey(filename));
 }
示例#7
0
文件: Romfs.cs 项目: tiliarou/LibHac
 public bool FileExists(string filename) => FileDict.ContainsKey(filename);
示例#8
0
        public bool FileExists(string path)
        {
            path = PathTools.Normalize(path).TrimStart('/');

            return(FileDict.ContainsKey(path));
        }