![]() |
cpplocate
1.0.0.a8d87a94e3ab
C++ Locator Library
|
Namespaces | |
utils | |
Classes | |
class | ModuleInfo |
Functions | |
CPPLOCATE_API const std::string & | getExecutablePath () |
CPPLOCATE_API const std::string & | getBundlePath () |
CPPLOCATE_API const std::string & | getModulePath () |
CPPLOCATE_API std::string | getLibraryPath (void *symbol) |
CPPLOCATE_API std::string | locatePath (const std::string &relPath, const std::string &systemDir="", void *symbol=nullptr) |
CPPLOCATE_API ModuleInfo | findModule (const std::string &name) |
std::ostream & | operator<< (std::ostream &stream, const ModuleInfo &info) |
CPPLOCATE_API const std::string& cpplocate::getExecutablePath | ( | ) |
Get path to the current executable.
It is assumed the executable path is static throughout the process.
CPPLOCATE_API const std::string& cpplocate::getBundlePath | ( | ) |
Get path to the current application bundle.
It is assumed the bundle path is static throughout the process.
CPPLOCATE_API const std::string& cpplocate::getModulePath | ( | ) |
Get path to the current module.
It is assumed the executable name is static throughout the process.
CPPLOCATE_API std::string cpplocate::getLibraryPath | ( | void * | symbol | ) |
Get path to dynamic library.
[in] | symbol | A symbol from the library, e.g., a function or variable pointer |
CPPLOCATE_API std::string cpplocate::locatePath | ( | const std::string & | relPath, |
const std::string & | systemDir = "" , |
||
void * | symbol = nullptr |
||
) |
Locate path to a file or directory.
[in] | relPath | Relative path to a file or directory (e.g., 'data/logo.png') |
[in] | systemDir | Subdirectory for system installs (e.g., 'share/myappname') |
[in] | symbol | A symbol from the library, e.g., a function or variable pointer |
The path is returned in unified format (forward slashes).
CPPLOCATE_API ModuleInfo cpplocate::findModule | ( | const std::string & | name | ) |
Tries to locate a module.
[in] | name | Module name (e.g., "mymodule") |
This functions looks for the filename "<name>.modinfo". It searches the following locations:
std::ostream& cpplocate::operator<< | ( | std::ostream & | stream, |
const ModuleInfo & | info | ||
) |
Stream output operator for a ModuleInfo.
[in] | stream | The stream to print to |
[in] | info | The module info |