Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions | List of all members
ConfigNode Class Reference

#include <confignode.h>

Classes

class  Impl
 

Public Member Functions

 ConfigNode (const ConfigNode &config)
 
void operator= (const ConfigNode &config)
 
 ConfigNode (ConfigNode &&config)
 
void operator= (ConfigNode &&config)
 
 ConfigNode (void *node, const Config *config)
 
const ConfigGetConfig () const
 
bool Empty () const
 
ConfigNode Child (const std::string &name) const
 
ConfigNode FirstChild () const
 
ConfigNode NextChild () const
 
ConfigNode NextChild (const std::string &name) const
 
std::string Name () const
 
std::string Value () const
 
template<typename T >
Value () const
 
std::string AttributeValue (const std::string &name) const
 
template<typename T >
bool ChildValueOrDefault (const std::string &name, const T &defaultValue, T &value) const
 
template<typename T >
bool ChildValue (const std::string &name, T &value) const
 
template<>
LM_PUBLIC_API int Value () const
 
template<>
LM_PUBLIC_API long long Value () const
 
template<>
LM_PUBLIC_API bool Value () const
 
- Public Member Functions inherited from Object
void * operator new (std::size_t size) throw (std::bad_alloc)
 
void operator delete (void *p)
 

Detailed Description

Config node. Represents a XML node of the configuration file.

Inheritance diagram for ConfigNode:
Object

Constructor & Destructor Documentation

ConfigNode::ConfigNode ( void *  node,
const Config config 
)

Internal constructor. The constructor is used internally.

Parameters
nodepugixml's internal object for xml_node.
Config.

Member Function Documentation

std::string ConfigNode::AttributeValue ( const std::string &  name) const

Get the value of the attribute by name.

Parameters
nameAttribute name.
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
nameElement name.
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
nameName of the child node.
valueValue to be obtained.
Return values
trueChild node is found.
falseChild 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
nameName of the child node.
valueValue to be obtained.
Return values
trueChild node is found.
falseChild node is not found.
bool ConfigNode::Empty ( ) const

Check if the node is empty.

Return values
trueNode is empty.
falseNode is not empty.
ConfigNode ConfigNode::FirstChild ( ) const

Get the first child node.

Returns
First child node.
const Config * ConfigNode::GetConfig ( ) const

Get config.

Returns
Config.
std::string ConfigNode::Name ( ) const

Get the name of the node.

Returns
Name of the node.
ConfigNode ConfigNode::NextChild ( ) const

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
nameNode name.
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
TReturn type.
Returns
Value of the node with type #T.

The documentation for this class was generated from the following files: