This class is a collection of static methods to return specific directories for a standard carma tree.
More...
|
static std::string | getConfDir (const std::string &programName) |
| Get the configuration directory - assumes standard carma tree. More...
|
|
static std::string | getConfFile (const std::string &programName, const std::string &confFilename) |
| Get the absolute path of a configuration file. More...
|
|
static std::string | getExecutable (const std::string &programName) |
| Get absolute full path of executable, including program executable. More...
|
|
static std::string | getExecutableDir (const std::string &programName) |
| Get the directory where this program executable lives. More...
|
|
static std::string | getRootDir (const std::string &programName) |
| Get the root build or install directory - assumes standard carma tree. More...
|
|
This class is a collection of static methods to return specific directories for a standard carma tree.
The standard carma tree is assumed to be of the form
carmaRoot
|
---------------------------
/ | | \
bin lib carma conf
|
-------------
/ | \
Xpgk Ypkg Zpkg
| | |
Test Test Test
These routines start by getting the full path of the executable using the "which" shell command for the program name (usually passed in as arg[0] to the program) . We assume that the these are carma programs and are run from one of two locations:
-
carmaRoot/bin
-
carmaRoot/carma/...
which is usually a Test sub-directory
If the program has been run from a "bin" directory, then its parent is selected as carmaRoot, otherwise the tree is ascended until "carma" is found and then its parent is selected as carmaRoot. If neither of these directories is found then an exception is thrown. All filenames are canonicalized, removing symbolic links and redundant slashes.
Definition at line 59 of file RuntimeDirs.h.