28class NativeFileSystem;
38 const std::string&
Path()
override;
39 uint64_t
Size()
override;
41 void Read(uint8_t* buffer,
int bytes)
override;
44 uint64_t
Tell()
override;
65 std::shared_ptr<IVirtualFile>
Open(
const std::string& path,
FileModes)
override;
66 void Close(std::shared_ptr<IVirtualFile>&)
override;
67 std::shared_ptr<IVirtualDirectory>
OpenDirectory(
const std::string& dir)
override;
69 bool IsFile(
const std::string& path)
override;
71 bool Exists(
const std::string& path)
override;
84 const std::string&
GetRoot()
override;
Meant to list all the files and sub files in the directory. This is sort of a replacement for directo...
Definition: vfs.h:88
The main functionality for this is to read files, so writing to files will not really be supported.
Definition: vfs.h:42
Definition: nativevfs.h:79
std::shared_ptr< IVirtualFile > GetFile(int index, FileModes modes) override
Opens file of index.
Definition: nativevfs.cpp:142
friend NativeFileSystem
Definition: nativevfs.h:90
uint64_t GetSize() override
Get number of files in directory
Definition: nativevfs.cpp:138
NativeFileSystem *const nfs
Definition: nativevfs.h:93
std::vector< std::string > paths
Definition: nativevfs.h:91
std::string root
Definition: nativevfs.h:92
NativeDirectory(NativeFileSystem *_nfs, const std::string &_root)
Definition: nativevfs.h:81
IVirtualFileSystem * GetFileSystem() override
Get the filesystem this refers to.
Definition: nativevfs.cpp:150
const std::string & GetRoot() override
The root directory, relative to the filesystem.
Definition: nativevfs.cpp:140
const std::string & GetFilename(int index) override
Get file name relative to this directory
Definition: nativevfs.cpp:148
Definition: nativevfs.h:31
std::ifstream file
Definition: nativevfs.h:52
IVirtualFileSystem * GetFileSystem() override
Definition: nativevfs.h:46
uint64_t Tell() override
Get current file position
Definition: nativevfs.cpp:136
bool Seek(long offset, Offset origin) override
Goto position of file, offset away from origin
Definition: nativevfs.cpp:119
NativeFile(NativeFileSystem *_nfs, const std::string &file)
Definition: nativevfs.h:34
friend NativeFileSystem
Definition: nativevfs.h:48
std::string path
Definition: nativevfs.h:51
void Read(uint8_t *buffer, int bytes) override
Reads num_bytes of bytes into buffer. Frees memory for the number
Definition: nativevfs.cpp:113
NativeFile(NativeFileSystem *_nfs)
Definition: nativevfs.h:33
NativeFileSystem *const nfs
Definition: nativevfs.h:55
uint64_t Size() override
Size of file in bytes
Definition: nativevfs.cpp:111
~NativeFile()
Definition: nativevfs.h:36
const std::string & Path() override
Get file path relative to the filesystem.
Definition: nativevfs.cpp:109
int size
Definition: nativevfs.h:53
Definition: nativevfs.h:58
friend NativeDirectory
Definition: nativevfs.h:76
NativeFileSystem(std::string root)
Definition: nativevfs.cpp:27
void Close(std::shared_ptr< IVirtualFile > &) override
Definition: nativevfs.cpp:62
bool Initialize() override
Definition: nativevfs.h:63
std::shared_ptr< IVirtualFile > Open(const std::string &path, FileModes) override
Opens file from the filesystem. Returns nullptr if file is invalid
Definition: nativevfs.cpp:29
std::string root
Definition: nativevfs.h:75
bool Exists(const std::string &path) override
Does the file exist
Definition: nativevfs.cpp:105
std::shared_ptr< IVirtualDirectory > OpenDirectory(const std::string &dir) override
Lists all the files in the directory. Does not list directories in the list because for our purposes,...
Definition: nativevfs.cpp:68
~NativeFileSystem()=default
bool IsDirectory(const std::string &path) override
Is the file a directory </summary
Definition: nativevfs.cpp:101
bool IsFile(const std::string &path) override
Is the file a file
Definition: nativevfs.cpp:97
const std::string & GetRoot()
Definition: nativevfs.h:72
Offset
Definition: vfs.h:31
FileModes
Definition: vfs.h:26
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21
glm::vec3 offset
Definition: starsystemview.cpp:72