#include <path.h>
Public Member Functions | |
string | getDataPath () |
Return a list of paths to the BALL data directories. | |
void | setDataPath (const string &path) |
Modify the data path. | |
void | addDataPath (const string &path) |
Add a single path to the list of paths. | |
string | getDefaultDataPath () |
Returns the default data path compiled into the library. | |
string | find (const string &name) |
Returns the full path to a file residing in one of the data directories. | |
string | findStrict (const string &name) |
Returns the full path to a file residing in one of the data directories. | |
void | reset () |
Reset the path variable to its default state (as it was a the start of the application). | |
Constructors and Destructors | |
Path () | |
Default constructor. | |
Protected Member Functions | |
void | buildPathArray_ () |
Static Protected Attributes | |
string | path_ |
bool | path_array_valid_ |
bool | environment_checked_ |
std::vector< std::string > | path_array_ |
bool | initialized_ |
This class is intended to provide a unique interface to directories where the data files needed by BALL reside.
|
Add a single path to the list of paths.
|
|
Returns the full path to a file residing in one of the data directories. If a file that matches the name is not found, an empty string is returned. Directories are searched in the order of occurence in the data path. If name contains relative path information but no file matching this path could be found, another search is performed as a second step taking in account only the basename of the file.
|
|
Returns the full path to a file residing in one of the data directories.
|
|
Return a list of paths to the BALL data directories. This directory is set to a default value at compile time of the library. It may be overridden at runtime by setting the environment variable "BALL_DATA" to the desired value. This value is then prepended to the list of directories. Directories are separated by linefeeds and returned as a single string. To locate files in these directories, find will search the directories in the specified order. |
|
Returns the default data path compiled into the library. This method ignores possible contents of the environment variable "BALL\_DATA". |
|
Modify the data path. This method accepts a newline separated list of paths to specify data paths. |