Definition: file_system.h:43
std::vector< OsPath > DirectoryNames
Definition: file_system.h:78
std::vector< CFileInfo > CFileInfos
Definition: file_system.h:77
const Status VFS_FILE_NOT_FOUND
Definition: vfs.h:40
const Status VFS_DIR_NOT_FOUND
Definition: vfs.h:39
const Status VFS_ALREADY_MOUNTED
Definition: vfs.h:41
i64 Status
Error handling system.
Definition: status.h:173
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< u8 > &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:78
virtual void Clear()=0
empty the contents of the filesystem.
virtual Status CreateFile(const VfsPath &pathname, const std::shared_ptr< u8 > &fileContents, size_t size)=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:46
@ VFS_MOUNT_ARCHIVABLE
anything mounted from here should be included when building archives.
Definition: vfs.h:57
@ VFS_MOUNT_KEEP_DELETED
keep the files named "*.DELETED" visible in the VFS directories.
Definition: vfs.h:71
@ VFS_MOUNT_WATCH
all real directories mounted during this operation will be watched for changes.
Definition: vfs.h:52
@ VFS_MOUNT_MUST_EXIST
return ERR::VFS_DIR_NOT_FOUND if the given real path doesn't exist.
Definition: vfs.h:63
PIVFS CreateVfs()
create an instance of a Virtual File System.
Definition: vfs.cpp:280
constexpr size_t VFS_MIN_PRIORITY
Definition: vfs.h:34
constexpr size_t VFS_MAX_PRIORITY
Definition: vfs.h:35
std::shared_ptr< IVFS > PIVFS
Definition: vfs.h:220