Changeset View
Changeset View
Standalone View
Standalone View
source/lib/file/vfs/vfs.h
Show All 22 Lines | ||||||||||||||
/* | /* | |||||||||||||
* Virtual File System API - allows transparent access to files in | * Virtual File System API - allows transparent access to files in | |||||||||||||
* archives, modding via multiple mount points and hotloading. | * archives, modding via multiple mount points and hotloading. | |||||||||||||
*/ | */ | |||||||||||||
#ifndef INCLUDED_VFS | #ifndef INCLUDED_VFS | |||||||||||||
#define INCLUDED_VFS | #define INCLUDED_VFS | |||||||||||||
#include "lib/file/file_system.h" // CFileInfo | #include "lib/file/file_system.h" // CFileInfo | |||||||||||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | |||||||||||||
StanUnsubmitted Not Done Inline Actions
Stan: | ||||||||||||||
namespace ERR | namespace ERR | |||||||||||||
{ | { | |||||||||||||
const Status VFS_DIR_NOT_FOUND = -110100; | const Status VFS_DIR_NOT_FOUND = -110100; | |||||||||||||
const Status VFS_FILE_NOT_FOUND = -110101; | const Status VFS_FILE_NOT_FOUND = -110101; | |||||||||||||
const Status VFS_ALREADY_MOUNTED = -110102; | const Status VFS_ALREADY_MOUNTED = -110102; | |||||||||||||
} | } | |||||||||||||
// (recursive mounting and mounting archives are no longer optional since they don't hurt) | // (recursive mounting and mounting archives are no longer optional since they don't hurt) | |||||||||||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | struct IVFS | |||||||||||||
virtual Status LoadFile(const VfsPath& pathname, shared_ptr<u8>& fileContents, size_t& size) = 0; | virtual Status LoadFile(const VfsPath& pathname, shared_ptr<u8>& fileContents, size_t& size) = 0; | |||||||||||||
/** | /** | |||||||||||||
* @return a string representation of all files and directories. | * @return a string representation of all files and directories. | |||||||||||||
**/ | **/ | |||||||||||||
virtual std::wstring TextRepresentation() const = 0; | virtual std::wstring TextRepresentation() const = 0; | |||||||||||||
/** | /** | |||||||||||||
* Return a hash of the files in the following paths. | ||||||||||||||
*/ | ||||||||||||||
virtual std::string HashRepresentation(const std::vector<std::string>& paths) const = 0; | ||||||||||||||
/** | ||||||||||||||
* retrieve the real (POSIX) pathname underlying a VFS file. | * retrieve the real (POSIX) pathname underlying a VFS file. | |||||||||||||
* | * | |||||||||||||
* this is useful for passing paths to external libraries. | * this is useful for passing paths to external libraries. | |||||||||||||
**/ | **/ | |||||||||||||
virtual Status GetRealPath(const VfsPath& pathname, OsPath& realPathname) = 0; | virtual Status GetRealPath(const VfsPath& pathname, OsPath& realPathname) = 0; | |||||||||||||
/** | /** | |||||||||||||
* retrieve the real (POSIX) pathname underlying a VFS directory. | * retrieve the real (POSIX) pathname underlying a VFS directory. | |||||||||||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator