Chira Engine
A customizable MIT-licensed game engine.
chira::FilesystemResourceProvider Class Reference
Inheritance diagram for chira::FilesystemResourceProvider:
Collaboration diagram for chira::FilesystemResourceProvider:

Public Member Functions

 FilesystemResourceProvider (std::string path_, bool isPathAbsolute=false, const std::string &name_=FILESYSTEM_PROVIDER_NAME)
 
bool hasResource (std::string_view name) const override
 
void compileResource (std::string_view name, Resource *resource) const override
 
std::string_view getPath () const
 
bool isAbsolute () const
 
std::string getFolder () const
 
std::string getLocalResourceAbsolutePath (const std::string &identifier) const
 
- Public Member Functions inherited from chira::IResourceProvider
 IResourceProvider (std::string name)
 
std::string_view getName () const
 

Static Public Member Functions

static void nixifyPath (std::string &path)
 Converts all backslashes in a string to forward slashes.
 
static std::string getResourceIdentifier (std::string_view absolutePath)
 Takes an absolute path of a resource file and converts it to a resource identifier. More...
 
static std::string getResourceFolderPath (std::string_view absolutePath)
 Takes an absolute path of a resource folder and converts it to a valid input path for a FilesystemResourceProvider. More...
 
static std::string getResourceAbsolutePath (const std::string &identifier)
 Takes a resource identifier and returns the full absolute path, if it exists.
 

Static Public Attributes

static constexpr short FILEPATH_MAX_LENGTH = 1024
 

Additional Inherited Members

- Protected Attributes inherited from chira::IResourceProvider
std::string providerName
 

Detailed Description

Definition at line 11 of file FilesystemResourceProvider.h.

Member Function Documentation

◆ getResourceFolderPath()

std::string FilesystemResourceProvider::getResourceFolderPath ( std::string_view  absolutePath)
static

Takes an absolute path of a resource folder and converts it to a valid input path for a FilesystemResourceProvider.

Does not check if the resource identifier actually points to a valid resource.

Definition at line 121 of file FilesystemResourceProvider.cpp.

◆ getResourceIdentifier()

std::string FilesystemResourceProvider::getResourceIdentifier ( std::string_view  absolutePath)
static

Takes an absolute path of a resource file and converts it to a resource identifier.

Does not check if the resource identifier actually points to a valid resource.

Definition at line 114 of file FilesystemResourceProvider.cpp.


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