public
Created

VFSManager

  • Download Gist
IFilesystem.hpp
C++
1 2 3 4 5 6 7
class IFilesystem
{
void listFiles(const char* path, IStringIterator* it) const = 0;
bool fileExists(const char* path) const = 0;
//return null if file can't be found
IInputStream* openFile(const char* path) const = 0;
};
IInputStream.hpp
C++
1 2 3 4 5 6 7 8
class IInputStream
{
int getSize() const = 0;
bool eof() const = 0;
//return number of bytes read
int read(MoaiDataBuffer* buff, int numBytesToRead) = 0;
void seek(int offsetType, int value) = 0;
};
VFSManager.hpp
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class VFSManager
{
//Add a filesystem to a stack of managed filesystem
void mountFilesystem(IFileSystem* fs, const char* name);
//Remove a filesystem
void unmountFilesystem(const char* name);
void getMountedFilesystems(IStringIterator* it) const;
//Similar to dir/ls
void listFiles(const char* path, IStringIterator* it) const;
bool fileExists(const char* path) const;
//return null if file can't be found
IInputStream* openFile(const char* path) const;
//Other stuffs
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.