Radium Engine
1.5.20
|
Resources paths, plugins paths and data paths management for Radium. More...
Functions | |
Resources path functions | |
All paths are made absolute using https://en.cppreference.com/w/cpp/filesystem/canonical | |
optional< std::string > | getRadiumResourcesPath () |
Get the path of Radium internal resources. | |
optional< std::string > | getRadiumPluginsPath () |
Get the path of Radium embedded plugins. | |
optional< std::string > | getBasePath () |
this one is always found, use optional for consistency ? | |
optional< std::string > | getResourcesPath (void *symbol=nullptr, const std::string &pattern="Resources") |
Search for general resource path. | |
Data path functions | |
These functions manage a stack of paths so that applications, libraries or plugins could manage paths to store their generated data in a state stack-based approach. | |
std::string | getDataPath () |
Get the current data path. | |
std::string | popDataPath () |
Pop the current data path. | |
void | pushDataPath (std::string datapath) |
Push a new data path. | |
Resources paths, plugins paths and data paths management for Radium.
This namespace contains functions, classes and utilities for resource management. Resources are :
This namespace also contains functions allowing to set and access paths to store data generated by Radium applications, plugins or libraries in a portable way. If not set, the default data path is the working directory of the application. For Gui::BaseApplication derived applications, and for plugins, the default data path can be set using command line parameter and is stored in the application settings.
RA_CORE_API optional< std::string > Ra::Core::Resources::getBasePath | ( | ) |
this one is always found, use optional for consistency ?
Get the path of the current executable.
Definition at line 53 of file Resources.cpp.
RA_CORE_API std::string Ra::Core::Resources::getDataPath | ( | ) |
Get the current data path.
If an application's data path was not pushed before the call of this function, the default value, corresponding to the current working directory is returned. Otherwise, the last path pushed using a call to pushDataPath() is returned.
Definition at line 70 of file Resources.cpp.
RA_CORE_API optional< std::string > Ra::Core::Resources::getRadiumPluginsPath | ( | ) |
Get the path of Radium embedded plugins.
Radium embedded plugins are located in the Plugins directory, searched from Radium lib location.
Definition at line 44 of file Resources.cpp.
RA_CORE_API optional< std::string > Ra::Core::Resources::getRadiumResourcesPath | ( | ) |
Get the path of Radium internal resources.
Radium resources are located in the Resources directory, searched from Radium lib location.
Definition at line 35 of file Resources.cpp.
RA_CORE_API optional< std::string > Ra::Core::Resources::getResourcesPath | ( | void * | symbol = nullptr, |
const std::string & | pattern = "Resources" ) |
Search for general resource path.
Search for an accessible Resources (or pattern if given) directory in the current executable (or symbol if != nullptr) path or its parents.
Definition at line 57 of file Resources.cpp.
RA_CORE_API std::string Ra::Core::Resources::popDataPath | ( | ) |
Pop the current data path.
The returned data path is removed from the data path stack and will not be available anymore for getDataPath().
Definition at line 75 of file Resources.cpp.
RA_CORE_API void Ra::Core::Resources::pushDataPath | ( | std::string | datapath | ) |
Push a new data path.
The pushed data path will be returned by getDataPath until it is popped.
datapath | the data path to set as current |
Definition at line 82 of file Resources.cpp.