Improve VFS API

Rename to match actual behaviour and add throw if invalid
This commit is contained in:
duckdoom4
2023-09-10 12:54:19 +02:00
parent 92abe54526
commit d5d6057d4c
9 changed files with 94 additions and 85 deletions

View File

@@ -31,23 +31,23 @@ public void Dispose()
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public IEnumerable<FileSystemPath> GetEntityPaths(FileSystemPath path, Func<FileSystemPath, bool>? filter = null)
public IEnumerable<FileSystemPath> GetEntitiesInDirectory(FileSystemPath directory, Func<FileSystemPath, bool>? filter = null)
{
return FileSystem.GetEntityPaths(ToAbsolutePath(path), filter)
return FileSystem.GetEntitiesInDirectory(ToAbsolutePath(directory), filter)
.Select(p => ToRelativePath(p));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public IEnumerable<FileSystemPath> GetDirectoryPaths(FileSystemPath path, Func<FileSystemPath, bool>? filter = null)
public IEnumerable<FileSystemPath> GetDirectoriesInDirectory(FileSystemPath directory, Func<FileSystemPath, bool>? filter = null)
{
return FileSystem.GetDirectoryPaths(ToAbsolutePath(path), filter)
return FileSystem.GetDirectoriesInDirectory(ToAbsolutePath(directory), filter)
.Select(p => ToRelativePath(p));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public IEnumerable<FileSystemPath> GetFilePaths(FileSystemPath path, Func<FileSystemPath, bool>? filter = null)
public IEnumerable<FileSystemPath> GetFilesInDirectory(FileSystemPath directory, Func<FileSystemPath, bool>? filter = null)
{
return FileSystem.GetFilePaths(ToAbsolutePath(path), filter)
return FileSystem.GetFilesInDirectory(ToAbsolutePath(directory), filter)
.Select(p => ToRelativePath(p));
}