Data Structures | Macros | Functions
XML helper utilities

A PUGIXML wrappers to safely extract values of requested type. More...

Data Structures

struct  parse_result
 A XML parse result structure with an error message and the pugi::xml_document document. More...
 

Macros

#define FOREACH_CHILD(c, p, tag)   for (auto c = p.child(tag); !c.empty(); c = c.next_sibling(tag))
 Defines convinient for-each based cycle to iterate over node childs. More...
 

Functions

int XMLParseUtils::GetIntAttr (const pugi::xml_node &node, const char *str)
 Gets the integer attribute from pugi::xml_node More...
 
int64_t XMLParseUtils::GetInt64Attr (const pugi::xml_node &node, const char *str)
 Gets the int64_t attribute from pugi::xml_node More...
 
int64_t XMLParseUtils::GetInt64Attr (const pugi::xml_node &node, const char *str, int64_t defVal)
 Gets the int64_t attribute from pugi::xml_node More...
 
uint64_t XMLParseUtils::GetUInt64Attr (const pugi::xml_node &node, const char *str)
 Gets the uint64_t attribute from pugi::xml_node More...
 
uint64_t XMLParseUtils::GetUInt64Attr (const pugi::xml_node &node, const char *str, uint64_t defVal)
 Gets the uint64_t attribute from pugi::xml_node More...
 
unsigned int XMLParseUtils::GetUIntAttr (const pugi::xml_node &node, const char *str)
 Gets the unsigned integer attribute from pugi::xml_node More...
 
unsigned int XMLParseUtils::GetUIntAttr (const pugi::xml_node &node, const char *str, unsigned int defVal)
 Gets the unsigned integer attribute from pugi::xml_node More...
 
std::string XMLParseUtils::GetStrAttr (const pugi::xml_node &node, const char *str)
 Gets the string attribute from pugi::xml_node More...
 
std::string XMLParseUtils::GetStrAttr (const pugi::xml_node &node, const char *str, const char *def)
 Gets the string attribute from pugi::xml_node More...
 
bool XMLParseUtils::GetBoolAttr (const pugi::xml_node &node, const char *str)
 Gets the bool attribute from pugi::xml_node More...
 
bool XMLParseUtils::GetBoolAttr (const pugi::xml_node &node, const char *str, const bool def)
 Gets the bool attribute from pugi::xml_node More...
 
float XMLParseUtils::GetFloatAttr (const pugi::xml_node &node, const char *str)
 Gets the float attribute from pugi::xml_node More...
 
float XMLParseUtils::GetFloatAttr (const pugi::xml_node &node, const char *str, float defVal)
 Gets the float attribute from pugi::xml_node More...
 
InferenceEngine::Precision XMLParseUtils::GetPrecisionAttr (const pugi::xml_node &node, const char *str)
 Gets the Precision attribute from pugi::xml_node More...
 
InferenceEngine::Precision XMLParseUtils::GetPrecisionAttr (const pugi::xml_node &node, const char *str, InferenceEngine::Precision def)
 Gets the Precision attribute from pugi::xml_node More...
 
int XMLParseUtils::GetIntChild (const pugi::xml_node &node, const char *str, int defVal)
 Gets the integer value located in a child node. More...
 
static parse_result ParseXml (const char *file_path)
 Parses a file and returns parse_result. More...
 

Detailed Description

A PUGIXML wrappers to safely extract values of requested type.

Macro Definition Documentation

◆ FOREACH_CHILD

#define FOREACH_CHILD (   c,
  p,
  tag 
)    for (auto c = p.child(tag); !c.empty(); c = c.next_sibling(tag))

Defines convinient for-each based cycle to iterate over node childs.

Parameters
cChild node name
pParent node name
tagThe tag represented as a string value

Function Documentation

◆ GetBoolAttr() [1/2]

bool XMLParseUtils::GetBoolAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the bool attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
A boolean value

◆ GetBoolAttr() [2/2]

bool XMLParseUtils::GetBoolAttr ( const pugi::xml_node &  node,
const char *  str,
const bool  def 
)

Gets the bool attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defThe default value
Returns
A boolean value

◆ GetFloatAttr() [1/2]

float XMLParseUtils::GetFloatAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the float attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
A single-precision floating point value

◆ GetFloatAttr() [2/2]

float XMLParseUtils::GetFloatAttr ( const pugi::xml_node &  node,
const char *  str,
float  defVal 
)

Gets the float attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defValThe default value
Returns
A single-precision floating point value

◆ GetInt64Attr() [1/2]

int64_t XMLParseUtils::GetInt64Attr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the int64_t attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
An int64_t value

◆ GetInt64Attr() [2/2]

int64_t XMLParseUtils::GetInt64Attr ( const pugi::xml_node &  node,
const char *  str,
int64_t  defVal 
)

Gets the int64_t attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defValThe default value
Returns
An int64_t value

◆ GetIntAttr()

int XMLParseUtils::GetIntAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the integer attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string
Returns
An integer value

◆ GetIntChild()

int XMLParseUtils::GetIntChild ( const pugi::xml_node &  node,
const char *  str,
int  defVal 
)

Gets the integer value located in a child node.

Parameters
[in]nodeThe node
[in]strThe string value identifying a child node
[in]defValThe default value
Returns
An ingeter value located in a child node, devVal otherwise.

◆ GetPrecisionAttr() [1/2]

InferenceEngine::Precision XMLParseUtils::GetPrecisionAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the Precision attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
A Precision value

◆ GetPrecisionAttr() [2/2]

InferenceEngine::Precision XMLParseUtils::GetPrecisionAttr ( const pugi::xml_node &  node,
const char *  str,
InferenceEngine::Precision  def 
)

Gets the Precision attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defThe default value
Returns
A Precision value

◆ GetStrAttr() [1/2]

std::string XMLParseUtils::GetStrAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the string attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
A string value

◆ GetStrAttr() [2/2]

std::string XMLParseUtils::GetStrAttr ( const pugi::xml_node &  node,
const char *  str,
const char *  def 
)

Gets the string attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defThe default value
Returns
A string value

◆ GetUInt64Attr() [1/2]

uint64_t XMLParseUtils::GetUInt64Attr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the uint64_t attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
An uint64_t value

◆ GetUInt64Attr() [2/2]

uint64_t XMLParseUtils::GetUInt64Attr ( const pugi::xml_node &  node,
const char *  str,
uint64_t  defVal 
)

Gets the uint64_t attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defValThe default value
Returns
An uint64_t value

◆ GetUIntAttr() [1/2]

unsigned int XMLParseUtils::GetUIntAttr ( const pugi::xml_node &  node,
const char *  str 
)

Gets the unsigned integer attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
Returns
An unsigned integer value

◆ GetUIntAttr() [2/2]

unsigned int XMLParseUtils::GetUIntAttr ( const pugi::xml_node &  node,
const char *  str,
unsigned int  defVal 
)

Gets the unsigned integer attribute from pugi::xml_node

Parameters
[in]nodeThe node
[in]strThe string identifying value name
[in]defValThe default value
Returns
An unsigned integer value

◆ ParseXml()

static parse_result ParseXml ( const char *  file_path)
static

Parses a file and returns parse_result.

Parameters
[in]file_pathThe file path
Returns
The parse_result.