|
VICI
0.11.815
Visual Chart Interpreter
|
Load an XML configuration file. More...
#include <vici/xini.h>
Public Member Functions | |
| bool | getVal (const std::string &xpath_expression, std::string &val) |
| get a value from the config file. More... | |
| int | getVals (const std::string &xpath_expr, std::vector< std::string > &results) |
| get a set of values More... | |
| void | getPath (const std::string &xpath_expr, VICI::Path &path) |
| get a path from a set of paths More... | |
| const Path & | getConfigFilename () const |
| get the name of the config file being used More... | |
Static Public Member Functions | |
| static void | configure (const Path &p) |
| Configure XINI to use the specified path. More... | |
| static void | configure (int c, char **v) |
| Configure XINI to use the command line args. More... | |
| static XINI & | instance () |
| get a reference to the single instance of the class. | |
Protected Member Functions | |
| XINI () | |
| constructor | |
Static Protected Attributes | |
| static int | argc = 0 |
| number of command line args | |
| static char ** | argv = NULL |
| command line args | |
| static Path | configFile |
| path to config file | |
| static const std::string | config |
| configuration string defined by the using application using the format specified. More... | |
Friends | |
| class | ::XiniTestCase |
Load an XML configuration file.
Ini file, XML format, loaded by looking in the following locations:
Containing application must provide a string containing the keys for the above search locations:
const string ini::config = "PECHD:-i:QM_CONF:qmd.xml:.qmd.xml:/etc/qmd/qmd.xml";
The above will first look for a command line parameter following -i, then it will look in the environment for a variable QM_CONF, then in the current directory for a file called qmd.xml, then for a file $HOME/.qmd.xml, and finally for /etc/qmd/qmd.xml
Any further paths added at the end are checked in sequence.
|
static |
Configure XINI to use the specified path.
| p | The path to the XML config file to use |
|
static |
Configure XINI to use the command line args.
| c | The number of command line args |
| v | the command line args |
| const Path & XINI::getConfigFilename | ( | ) | const |
get the name of the config file being used
| void XINI::getPath | ( | const std::string & | xpath_expr, |
| VICI::Path & | path | ||
| ) |
get a path from a set of paths
| xpath_expr | An expression returning a set of paths to search |
| path | The first path that points to an existing file |
| bool XINI::getVal | ( | const std::string & | xpath_expression, |
| std::string & | val | ||
| ) |
get a value from the config file.
| xpath_expression | an expression to find in the config file. |
| val | value is returned into this |
| int XINI::getVals | ( | const std::string & | xpath_expr, |
| std::vector< std::string > & | results | ||
| ) |
get a set of values
| xpath_expr | an expression to find in the config file. |
| results | set of values returned in this |
|
staticprotected |
configuration string defined by the using application using the format specified.
1.8.5