When searching for configuration files, W2Config will look in:
Public Member Functions | |
void | useEnglishUnits (bool useEnglish) |
When enabled, look for PATH/englishUnits/file before trying PATH/file. | |
bool | isEnglishUnits () const |
SmartPtr< XML::Document > | getXMLDocument (const std::string &directory, const std::string &filename) const |
Return XML document corresponding to the file identified by the class (e.g: icons) and file name (e.g: SCIT) passed in. | |
SmartPtr< XML::Document > | getXMLDocument (const std::string &path) const |
Convenience function equivalent to getXMLDocument(dir+"/"+file);. | |
SmartPtr< XML::Document > | getAbsoluteXMLDocument (const URL &) const |
Read the URL and return its contents parsed into an XML::Document. | |
URL | getConfigFile (const std::string &pathToFile) const |
Returns the absolute location of this file. | |
void | getConfigFiles (const std::string &pathToFile, std::vector< URL > *inhere) const |
Populates `inhere' with all the places we found pathToFile. | |
URL | getAbsoluteForRelative (const std::string &relativePath) const |
Finds the absolute path of the given relative path. | |
void | getAbsoluteForRelative (const std::string &relativePath, std::vector< URL > *inhere) const |
Finds all absolute paths that match this given relative path. | |
virtual | ~W2Config () |
Virtual destructor. | |
Static Public Member Functions | |
static W2Config & | instance () |
static std::string | getEnvVar (const std::string &envVarName) |
Find and return an environment variable. |
virtual code::W2Config::~W2Config | ( | ) | [inline, virtual] |
Virtual destructor.
void code::W2Config::getAbsoluteForRelative | ( | const std::string & | relativePath, | |
std::vector< URL > * | inhere | |||
) | const |
Finds all absolute paths that match this given relative path.
URL code::W2Config::getAbsoluteForRelative | ( | const std::string & | relativePath | ) | const |
Finds the absolute path of the given relative path.
SmartPtr< XML::Document > code::W2Config::getAbsoluteXMLDocument | ( | const URL & | ) | const |
Read the URL and return its contents parsed into an XML::Document.
URL code::W2Config::getConfigFile | ( | const std::string & | pathToFile | ) | const |
Returns the absolute location of this file.
The first match in our search paths is returned.
void code::W2Config::getConfigFiles | ( | const std::string & | pathToFile, | |
std::vector< URL > * | inhere | |||
) | const |
Populates `inhere' with all the places we found pathToFile.
static std::string code::W2Config::getEnvVar | ( | const std::string & | envVarName | ) | [static] |
Find and return an environment variable.
This string is empty if there is no such environment variable. Wrapper to the getenv method.
SmartPtr<XML::Document> code::W2Config::getXMLDocument | ( | const std::string & | path | ) | const |
Convenience function equivalent to getXMLDocument(dir+"/"+file);.
SmartPtr< XML::Document > code::W2Config::getXMLDocument | ( | const std::string & | directory, | |
const std::string & | filename | |||
) | const |
Return XML document corresponding to the file identified by the class (e.g: icons) and file name (e.g: SCIT) passed in.
directory | relative to standard locations (e.g: W2Config::Icons) | |
filename |
static W2Config& code::W2Config::instance | ( | ) | [inline, static] |
bool code::W2Config::isEnglishUnits | ( | ) | const [inline] |
void code::W2Config::useEnglishUnits | ( | bool | useEnglish | ) | [inline] |
When enabled, look for PATH/englishUnits/file before trying PATH/file.