ImFusion SDK 4.3
FilesystemRepository Class Reference

#include <ImFusion/Core/Resource/FilesystemRepository.h>

Repository for loading resources from the local filesystem. More...

+ Inheritance diagram for FilesystemRepository:

Detailed Description

Repository for loading resources from the local filesystem.

Maintains a set of search paths, in which it looks for matching files.

Note
Be aware that the search paths may be different for every system. Thus, pay particular attention if you plan deploying your software to other computers than your local build system. Writing a custom Repository may be the more robust alternative in such cases.

Public Member Functions

 FilesystemRepository (const std::string_view &repositoryName, const std::vector< Filesystem::Directory > &searchPaths={})
 Create a new FilesystemRepository with the given name and set of search paths.
 
void addSearchPath (const Filesystem::Directory &path)
 Add the given string to the list of search directories.
 
std::string name () const override
 Returns the repository name to allow for namespacing in case multiple repositories are registered.
 
bool contains (const std::string_view &resourceName) const override
 Checks whether this repository contains a resource of the given name.
 
std::optional< ByteBufferquery (const std::string_view &resourceName) const override
 Returns the requested resource name.
 
- Public Member Functions inherited from Repository
virtual ~Repository ()
 Will automatically deregister this repository on deletion.
 

Member Function Documentation

◆ name()

std::string name ( ) const
overridevirtual

Returns the repository name to allow for namespacing in case multiple repositories are registered.

Implements Repository.

◆ contains()

bool contains ( const std::string_view & resourceName) const
overridevirtual

Checks whether this repository contains a resource of the given name.

Implements Repository.

◆ query()

std::optional< ByteBuffer > query ( const std::string_view & resourceName) const
overridevirtual

Returns the requested resource name.

Implements Repository.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close