Singleton object to resolve runtime path in a PID system.
More...
#include <rpath_resolver.h>
|
| static bool | configure (const std::string &exe_name) |
| | configure the PID runtime path management system. More...
|
| |
| static bool | configure_Module (bool toload, const std::string &module_path, bool prefer_debug) |
| | configure the PID runtime path management system when a new module is to be loaded. More...
|
| |
| static std::string | resolve (const std::string &resource, bool prefer_debug=false) |
| | resolve the path to the resource. More...
|
| |
| static std::string | resolve (const PidPath &pp, bool prefer_debug=false) |
| | resolve the path to the resource. More...
|
| |
| static std::string | execution_Path () |
| | get the path to the current executable. More...
|
| |
Singleton object to resolve runtime path in a PID system.
this class is not intended to be used externnaly except by qualified users. Use macro version of the API instead.
- See also
- rpath.h
◆ RpathResolver()
| pid::RpathResolver::RpathResolver |
( |
| ) |
|
|
private |
◆ ~RpathResolver()
| pid::RpathResolver::~RpathResolver |
( |
| ) |
|
|
private |
◆ configure()
| static bool pid::RpathResolver::configure |
( |
const std::string & |
exe_name | ) |
|
|
static |
configure the PID runtime path management system.
- Parameters
-
| exe_name | the name of the current executable. |
- Returns
- true on success false otherwise.
◆ configure_Module()
| static bool pid::RpathResolver::configure_Module |
( |
bool |
toload, |
|
|
const std::string & |
module_path, |
|
|
bool |
prefer_debug |
|
) |
| |
|
static |
configure the PID runtime path management system when a new module is to be loaded.
- Parameters
-
| [in] | toload | indicates if the module is laoded (true) or unloaded (false). |
| [in] | module_path | the path to the module to be loaded. |
| [in] | prefer_debug | if true a debug version of the file passed as parameter will be chosen if it exists, otherwise a non debug version is chosen. |
- Returns
- true on success, false otherwise.
◆ execution_Path()
| static std::string pid::RpathResolver::execution_Path |
( |
| ) |
|
|
static |
get the path to the current executable.
It produces a canonical path to the current executable file, or throw a std::logic_error exception.
- Returns
- the canonical path to the executable file, as a string.
◆ get_Path_To_Resource()
| static std::string pid::RpathResolver::get_Path_To_Resource |
( |
const std::string & |
final_filename, |
|
|
bool |
is_written |
|
) |
| |
|
staticprivate |
◆ instance()
◆ internal_Resolve_Dynamic()
| static std::string pid::RpathResolver::internal_Resolve_Dynamic |
( |
const PidPath & |
pp, |
|
|
bool |
prefer_debug |
|
) |
| |
|
staticprivate |
◆ internal_Resolve_Static()
| static std::string pid::RpathResolver::internal_Resolve_Static |
( |
const PidPath & |
pp, |
|
|
bool |
prefer_debug |
|
) |
| |
|
staticprivate |
◆ resolve() [1/2]
| static std::string pid::RpathResolver::resolve |
( |
const PidPath & |
pp, |
|
|
bool |
prefer_debug = false |
|
) |
| |
|
static |
resolve the path to the resource.
It produces a canonical path to the target resource, or throw a std::logic_error exception either if the path description is incorrect or if the file cannot be found.
- Parameters
-
| [in] | pp | the target resource expressed as a PidPath object. |
| [in] | prefer_debug | if true then if a debug version of the target executable or module library is found at same place then it will be used, otherwise the release version will be used if found. |
- Returns
- the canonical path to the resource as a string.
- See also
- pid_path.h
◆ resolve() [2/2]
| static std::string pid::RpathResolver::resolve |
( |
const std::string & |
resource, |
|
|
bool |
prefer_debug = false |
|
) |
| |
|
static |
resolve the path to the resource.
It produces a canonical path to the target resource, or throw a std::logic_error exception either if the path description is incorrect or if the file cannot be found.
- Parameters
-
| [in] | resource | the target resource. It is a string describing the resource whose format is accepted by a PidPath. |
| [in] | prefer_debug | if true a debug version of the file passed as parameter will be chosen if it exists, otherwise a non debug version is chosen. |
- Returns
- the canonical path to the resource as a string.
- See also
- pid_path.h
◆ resolve_exe_path()
| static bool pid::RpathResolver::resolve_exe_path |
( |
const std::string & |
name_of_exe | ) |
|
|
staticprivate |
◆ resolve_Symlinks()
| static bool pid::RpathResolver::resolve_Symlinks |
( |
| ) |
|
|
staticprivate |
◆ absolute_path_to_container_folder_
| std::string pid::RpathResolver::absolute_path_to_container_folder_ |
|
private |
◆ absolute_path_to_current_exe_
| std::string pid::RpathResolver::absolute_path_to_current_exe_ |
|
private |
◆ exe_name_
| std::string pid::RpathResolver::exe_name_ |
|
private |
◆ modules_in_use_
| std::map< std::string, std::string > pid::RpathResolver::modules_in_use_ |
|
private |
◆ resolver_instance_
The documentation for this class was generated from the following file: