#include <confignode.h>
Config node. Represents a XML node of the configuration file.
ConfigNode::ConfigNode |
( |
void * |
node, |
|
|
const Config * |
config |
|
) |
| |
Internal constructor. The constructor is used internally.
- Parameters
-
node | pugixml's internal object for xml_node. |
Config. | |
std::string ConfigNode::AttributeValue |
( |
const std::string & |
name | ) |
const |
Get the value of the attribute by name.
- Parameters
-
- Returns
- Value of the attribute.
ConfigNode ConfigNode::Child |
( |
const std::string & |
name | ) |
const |
Get child node by element name. Returns empty node is the node specified by #name does not exist.
- Parameters
-
- Returns
- Child node or empty node.
template<typename T >
bool ConfigNode::ChildValue |
( |
const std::string & |
name, |
|
|
T & |
value |
|
) |
| const |
|
inline |
Get the value of the child. Obtains the value of the child node specified by #name. Returns false if the child node does not exist.
- Parameters
-
name | Name of the child node. |
value | Value to be obtained. |
- Return values
-
true | Child node is found. |
false | Child node is not found. |
template<typename T >
bool ConfigNode::ChildValueOrDefault |
( |
const std::string & |
name, |
|
|
const T & |
defaultValue, |
|
|
T & |
value |
|
) |
| const |
|
inline |
Get the value of the child with default value. Obtains the value of the child node specified by #name if the node exists. If not, the value specified by #defaultValue is returned.
- Parameters
-
name | Name of the child node. |
value | Value to be obtained. |
- Return values
-
true | Child node is found. |
false | Child node is not found. |
bool ConfigNode::Empty |
( |
| ) |
const |
Check if the node is empty.
- Return values
-
true | Node is empty. |
false | Node is not empty. |
Get the first child node.
- Returns
- First child node.
const Config * ConfigNode::GetConfig |
( |
| ) |
const |
std::string ConfigNode::Name |
( |
| ) |
const |
Get the name of the node.
- Returns
- Name of the node.
Get the next child node.
- Returns
- Next child node.
lightmetrica::ConfigNode ConfigNode::NextChild |
( |
const std::string & |
name | ) |
const |
Get the next child node with given name.
- Parameters
-
- Returns
- Next child node.
template LM_PUBLIC_API bool ConfigNode::Value< bool > |
( |
| ) |
const |
Get the value of the node by string.
- Returns
- Value of the node in string.
template<typename T >
T ConfigNode::Value |
( |
| ) |
const |
Get the value of the node by type.
- Template Parameters
-
- Returns
- Value of the node with type #T.
The documentation for this class was generated from the following files:
- /home/travis/build/hi2p-perim/lightmetrica/include/lightmetrica/confignode.h
- /home/travis/build/hi2p-perim/lightmetrica/src/liblightmetrica/confignode.cpp