173 std::unique_ptr<std::uint8_t[],
AlignedDeleter>& fileContents,
size_t& size) = 0;
Definition: file_system.h:41
std::vector< OsPath > DirectoryNames
Definition: file_system.h:76
std::vector< CFileInfo > CFileInfos
Definition: file_system.h:75
const Status VFS_FILE_NOT_FOUND
Definition: vfs.h:49
const Status VFS_DIR_NOT_FOUND
Definition: vfs.h:48
const Status VFS_ALREADY_MOUNTED
Definition: vfs.h:50
std::int64_t Status
Error handling system.
Definition: status.h:174
Definition: shared_ptr.h:49
virtual Status LoadFile(const VfsPath &pathname, std::unique_ptr< std::uint8_t[], AlignedDeleter > &fileContents, size_t &size)=0
Read an entire file into memory.
virtual Status GetVirtualPath(const OsPath &realPathname, VfsPath &pathname)=0
retrieve the VFS pathname that corresponds to a real file.
virtual Status LoadFile(const VfsPath &pathname, std::shared_ptr< std::uint8_t > &fileContents, size_t &size)=0
Read an entire file into memory.
virtual Status GetDirectoryRealPath(const VfsPath &pathname, OsPath &realPathname, bool createMissingDirectories=true)=0
Retrieve the real (POSIX) pathname underlying a VFS directory.
virtual Status GetRealPath(const VfsPath &pathname, OsPath &realPathname, bool createMissingDirectories=true)=0
Retrieve the real (POSIX) pathname underlying a VFS file.
virtual Status GetFileInfo(const VfsPath &pathname, CFileInfo *pfileInfo) const =0
Retrieve information about a file (similar to POSIX stat).
virtual Status Mount(const VfsPath &mountPoint, const OsPath &path, size_t flags=0, size_t priority=0)=0
mount a directory into the VFS.
virtual Status RepopulateDirectory(const VfsPath &path)=0
request the directory be re-populated when it is next accessed.
virtual Status GetDirectoryEntries(const VfsPath &path, CFileInfos *fileInfos, DirectoryNames *subdirectoryNames) const =0
Retrieve lists of all files and subdirectories in a directory.
virtual ~IVFS()
Definition: vfs.h:87
virtual void Clear()=0
empty the contents of the filesystem.
virtual Status CreateFile(const VfsPath &pathname, std::span< const std::uint8_t > fileContents)=0
Create a file with the given contents.
virtual Status RemoveFile(const VfsPath &pathname)=0
remove file from the virtual directory listing.
virtual std::wstring TextRepresentation() const =0
virtual Status GetOriginalPath(const VfsPath &filename, OsPath &loadedPathname)=0
Retrieve the POSIX pathname a VFS file was loaded from.
virtual Status GetFilePriority(const VfsPath &pathname, size_t *ppriority) const =0
Retrieve mount priority for a file.
VfsMountFlags
Definition: vfs.h:55
@ VFS_MOUNT_ARCHIVABLE
anything mounted from here should be included when building archives.
Definition: vfs.h:66
@ VFS_MOUNT_KEEP_DELETED
keep the files named "*.DELETED" visible in the VFS directories.
Definition: vfs.h:80
@ VFS_MOUNT_WATCH
all real directories mounted during this operation will be watched for changes.
Definition: vfs.h:61
@ VFS_MOUNT_MUST_EXIST
return ERR::VFS_DIR_NOT_FOUND if the given real path doesn't exist.
Definition: vfs.h:72
PIVFS CreateVfs()
create an instance of a Virtual File System.
Definition: vfs.cpp:315
constexpr size_t VFS_MIN_PRIORITY
Definition: vfs.h:43
constexpr size_t VFS_MAX_PRIORITY
Definition: vfs.h:44
std::shared_ptr< IVFS > PIVFS
Definition: vfs.h:240