MochiEngine
Loading...
Searching...
No Matches
Mochi::FS::IFileLoader Class Referenceabstract

Interface to get files that are part of the game data. Note that the interface does not have any save or write function. This is not meant to create persistent file systems, but to create virtual file systems from which to read. More...

#include <IFileLoader.h>

Inheritance diagram for Mochi::FS::IFileLoader:
Mochi::FS::PackFile Mochi::FS::SystemFileLoader

Public Member Functions

virtual bool IsValid () const =0
 Tells us if the file loader can be used at the moment.
virtual std::vector< char > GetFile (const std::string &path)=0
 Give us a binary representation of a file in a filesystem.
virtual bool HasFile (const std::string &path) const =0
 Tells us if the filesystem has a file.
virtual std::vector< std::string > GetAvailableFiles () const =0
 Tells us which files are in the filesystem.

Detailed Description

Interface to get files that are part of the game data. Note that the interface does not have any save or write function. This is not meant to create persistent file systems, but to create virtual file systems from which to read.

Member Function Documentation

◆ GetAvailableFiles()

virtual std::vector< std::string > Mochi::FS::IFileLoader::GetAvailableFiles ( ) const
pure virtual

Tells us which files are in the filesystem.

Returns
A vector with the unique identifiers of all files

Implemented in Mochi::FS::PackFile, and Mochi::FS::SystemFileLoader.

◆ GetFile()

virtual std::vector< char > Mochi::FS::IFileLoader::GetFile ( const std::string & path)
pure virtual

Give us a binary representation of a file in a filesystem.

Exceptions
EngineErrorif is not valid or doesn't have file
Parameters
pathA path, or unique identifier to the file
Returns
A vector of chars, or binary representation of a file.

Implemented in Mochi::FS::PackFile, and Mochi::FS::SystemFileLoader.

◆ HasFile()

virtual bool Mochi::FS::IFileLoader::HasFile ( const std::string & path) const
pure virtual

Tells us if the filesystem has a file.

Parameters
pathA path, or unique identifier to the file
Returns
True if it has the file, false if not

Implemented in Mochi::FS::PackFile, and Mochi::FS::SystemFileLoader.

◆ IsValid()

virtual bool Mochi::FS::IFileLoader::IsValid ( ) const
pure virtual

Tells us if the file loader can be used at the moment.

Returns
True if can be used, false if not

Implemented in Mochi::FS::PackFile, and Mochi::FS::SystemFileLoader.


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