DDS  ver. 3.4
Classes | Functions
MiscCommon::XMLHelper Namespace Reference

Helpers for Xerces XML parser. More...

Classes

class  smart_XMLCh
 smart-wrapper around XMLCh class More...
 

Functions

bool operator== (const std::string &_Val1, const smart_XMLCh &_Val2)
 
template<class _T >
void get_attr_value (const xercesc::DOMElement *_element, const char *_attr, _T *_data)
 A template function, which helps to retrieve different types of attributes from an XML file. More...
 
template<>
void get_attr_value< bool > (const xercesc::DOMElement *_element, const char *_attr, bool *_data)
 A specialization of the get_attr_value template function with the bool type – xml value: true or false. More...
 
template<class _T >
xercesc::DOMNode * GetSingleNodeByName (const _T *_Val, const std::string &_NodeName)
 Returns a Node by the given name. (basic template without implementation) More...
 
template<class _T >
xercesc::DOMNodeList * GetNodesByName (const _T *_Val, const std::string &_NodeName)
 
template<>
xercesc::DOMNodeList * GetNodesByName (const xercesc::DOMNode *_ParentNode, const std::string &_NodeName)
 
template<>
xercesc::DOMNode * GetSingleNodeByName (const xercesc::DOMDocument *_Doc, const std::string &_NodeName)
 Returns a Node by the given name. A xercesc::DOMDocument specialization. More...
 
template<>
xercesc::DOMNode * GetSingleNodeByName (const xercesc::DOMNode *_node, const std::string &_NodeName)
 Returns a Node by the given name. A xercesc::DOMNode specialization. More...
 
template<class _T >
xercesc::DOMNode * GetSingleNodeByName_Ex (const _T *_Node, const std::string &_NodeName) throw (std::exception)
 A helper template function, which wraps GetSingleNodeByName template-functions. More...
 
template<class _T >
void get_node_value (const xercesc::DOMNode *_parent_node, const char *_node_name, _T *_data)
 A template function, which helps to retrieve a value of xml node. More...
 
template<>
void get_node_value< bool > (const xercesc::DOMNode *_parent_node, const char *_node_name, bool *_data)
 A specialization of the get_node_value template function with the bool type – xml value: true or false. More...
 

Detailed Description

Helpers for Xerces XML parser.

Function Documentation

◆ get_attr_value()

template<class _T >
void MiscCommon::XMLHelper::get_attr_value ( const xercesc::DOMElement *  _element,
const char *  _attr,
_T _data 
)

A template function, which helps to retrieve different types of attributes from an XML file.

Parameters
[in]_element- XML node to process. Must not be a NULL value.
[in]_attr- Name of the attribute to read. Must not be a NULL value.
[in,out]_data- A buffer to keep a return value - value of the attribute. Must not be a NULL value.

◆ get_attr_value< bool >()

template<>
void MiscCommon::XMLHelper::get_attr_value< bool > ( const xercesc::DOMElement *  _element,
const char *  _attr,
bool *  _data 
)
inline

A specialization of the get_attr_value template function with the bool type – xml value: true or false.

Parameters
[in]_element- XML node to process. Must not be a NULL value.
[in]_attr- Name of the attribute to read. Must not be a NULL value.
[in,out]_data- A buffer to keep a retrieved value of the attribute. Must not be a NULL value.

◆ get_node_value()

template<class _T >
void MiscCommon::XMLHelper::get_node_value ( const xercesc::DOMNode *  _parent_node,
const char *  _node_name,
_T _data 
)

A template function, which helps to retrieve a value of xml node.

Parameters
[in]_parent_node- XML parent node to process. Must not be a NULL value.
[in]_node_name- Name of the node which value should be retrieved. Must not be a NULL value.
[in,out]_data- A buffer to keep a return value. Must not be a NULL value.

◆ get_node_value< bool >()

template<>
void MiscCommon::XMLHelper::get_node_value< bool > ( const xercesc::DOMNode *  _parent_node,
const char *  _node_name,
bool *  _data 
)
inline

A specialization of the get_node_value template function with the bool type – xml value: true or false.

Parameters
[in]_parent_node- XML parent node to process. Must not be a NULL value.
[in]_node_name- Name of the node which value should be retrieved. Must not be a NULL value.
[in,out]_data- A buffer to keep a retrieved node value. Must not be a NULL value.

◆ GetNodesByName() [1/2]

template<class _T >
xercesc::DOMNodeList* MiscCommon::XMLHelper::GetNodesByName ( const _T _Val,
const std::string &  _NodeName 
)
inline

◆ GetNodesByName() [2/2]

template<>
xercesc::DOMNodeList* MiscCommon::XMLHelper::GetNodesByName ( const xercesc::DOMNode *  _ParentNode,
const std::string &  _NodeName 
)
inline

◆ GetSingleNodeByName() [1/3]

template<class _T >
xercesc::DOMNode* MiscCommon::XMLHelper::GetSingleNodeByName ( const _T _Val,
const std::string &  _NodeName 
)
inline

Returns a Node by the given name. (basic template without implementation)

◆ GetSingleNodeByName() [2/3]

template<>
xercesc::DOMNode* MiscCommon::XMLHelper::GetSingleNodeByName ( const xercesc::DOMDocument *  _Doc,
const std::string &  _NodeName 
)
inline

Returns a Node by the given name. A xercesc::DOMDocument specialization.

Parameters
[in]_Doc- XML Document object. Must not be a NULL value.
[in]_NodeName- Name of the child node to find.
Returns
A pointer to the found XML node or NULL in case of error

◆ GetSingleNodeByName() [3/3]

template<>
xercesc::DOMNode* MiscCommon::XMLHelper::GetSingleNodeByName ( const xercesc::DOMNode *  _node,
const std::string &  _NodeName 
)
inline

Returns a Node by the given name. A xercesc::DOMNode specialization.

Parameters
[in]_node- XML Node. Must not be a NULL value.
[in]_NodeName- Name of the child node to find.
Returns
A pointer to the found XML node or NULL in case of error

◆ GetSingleNodeByName_Ex()

template<class _T >
xercesc::DOMNode* MiscCommon::XMLHelper::GetSingleNodeByName_Ex ( const _T _Node,
const std::string &  _NodeName 
)
throw (std::exception
)
inline

A helper template function, which wraps GetSingleNodeByName template-functions.

Parameters
[in]_Node- Could be a pointer to either XML Document or XML Node. Must not be a NULL value.
[in]_NodeName- Name of the child node to find.
Exceptions
std::runtime_error- "can't find XML element [_NodeName]"
Returns
A pointer to the found XML node or an exception will be raised.

◆ operator==()

bool MiscCommon::XMLHelper::operator== ( const std::string &  _Val1,
const smart_XMLCh _Val2 
)
inline