RavEngine
Loading...
Searching...
No Matches
RavEngine::VirtualFilesystem Class Reference

Public Member Functions

template<typename vec = RavEngine::Vector<uint8_t>>
const vec FileContentsAt (const char *path, bool nullTerminate=true)
 
template<typename vec = RavEngine::Vector<uint8_t>>
void FileContentsAt (const char *path, vec &datavec, bool nullTerminate=true)
 
bool Exists (const char *path)
 
void IterateDirectory (const char *path, Function< void(const std::string &)> callback)
 
Filesystem::Path GetStreamingAssetFullRootPath () const
 
const std::span< const char > GetShaderData (const std::string_view name)
 

Protected Attributes

std::string rootname
 
Filesystem::Path streamingAssetsPath
 

Member Function Documentation

◆ Exists()

bool RavEngine::VirtualFilesystem::Exists ( const char *  path)
Returns
true if the VFS has the file at the path

◆ FileContentsAt() [1/2]

template<typename vec = RavEngine::Vector<uint8_t>>
const vec RavEngine::VirtualFilesystem::FileContentsAt ( const char *  path,
bool  nullTerminate = true 
)
inline

Get the file data as a string

Parameters
paththe resources path to the asset
nullTerminatewhether to add a null byte to the end of the data
Returns
the file data

◆ FileContentsAt() [2/2]

template<typename vec = RavEngine::Vector<uint8_t>>
void RavEngine::VirtualFilesystem::FileContentsAt ( const char *  path,
vec &  datavec,
bool  nullTerminate = true 
)
inline

Get the file data in a vector

Parameters
paththe resources path to the asset
nullTerminatewhether to add a null byte to the end of the data
datavecthe vector to write the data into

◆ IterateDirectory()

void RavEngine::VirtualFilesystem::IterateDirectory ( const char *  path,
Function< void(const std::string &)>  callback 
)

Get all the files in a directory

Parameters
paththe path to the folder
callbackfunction to call on each filename

The documentation for this class was generated from the following files: