XMLParserCPP 1.0
Loading...
Searching...
No Matches
XMLAlgorithms Class Reference

The XMLAlgorithms class. More...

#include <XMLAlgorithms.h>

Public Member Functions

 XMLAlgorithms ()
 XMLAlgorithms constructor.

Static Public Member Functions

static void searchElement (const std::vector< XMLElement > &elements, const std::string &element_name, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement > &elements, const XMLElement::Type &element_type, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement > &elements, const std::string &element_name, const std::string &attribute_id, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement > &elements, const std::string &element_name, const std::string &attribute_id, const std::string &attribute_value, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement * > &elements, const std::string &element_name, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement * > &elements, const XMLElement::Type &element_type, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement * > &elements, const std::string &element_name, const std::string &attribute_id, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void searchElement (const std::vector< XMLElement * > &elements, const std::string &element_name, const std::string &attribute_id, const std::string &attribute_value, std::vector< XMLElement * > &result)
 Searches for XML elements.
static void writeXML (const std::vector< XMLElement > &elements, std::string &result)
 Writes XML elements to given string.
static void writeXML (const std::vector< XMLElement * > &elements, std::string &result)
 Writes XML elements to given string.

Detailed Description

The XMLAlgorithms class.

XMLAlgorithms class contains various methods for XMLElement processing.

Member Function Documentation

◆ searchElement() [1/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement * > & elements,
const std::string & element_name,
const std::string & attribute_id,
const std::string & attribute_value,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given name containing attribute of given ID set to given value within vector of pointers to XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Parameters
elementsVector of pointers to XMLElement search to be carried out on.
element_nameDesired XML element name.
attribute_idDesired XML element attribute name.
attribute_valueDesired XML element attribute value.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [2/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement * > & elements,
const std::string & element_name,
const std::string & attribute_id,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given name containing attribute of given ID within vector of pointers to XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Parameters
elementsVector of pointers to XMLElement search to be carried out on.
element_nameDesired XML element name.
attribute_idDesired XML element attribute name.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [3/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement * > & elements,
const std::string & element_name,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches for XML elements of a given name within vector of pointers to XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Parameters
elementsVector of pointers to XMLElement search to be carried out on.
element_nameDesired XML element name.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [4/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement * > & elements,
const XMLElement::Type & element_type,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given type within vector of poiters to XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Parameters
elementsVector of pointers to XMLElement search to be carried out on.
element_typeDesired XML element type.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [5/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement > & elements,
const std::string & element_name,
const std::string & attribute_id,
const std::string & attribute_value,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given name containing attribute of given ID set to given value within vector of XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Warning
Resulting pointers can become invalid if any changes are made to the source elements vector.
Parameters
elementsVector of XMLElement search to be carried out on.
element_nameDesired XML element name.
attribute_idDesired attribute name.
attribute_valueDesired attribute value.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [6/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement > & elements,
const std::string & element_name,
const std::string & attribute_id,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given name containing attribute of given ID within vector of XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Warning
Resulting pointers can become invalid if any changes are made to the source elements vector.
Parameters
elementsVector of XMLElement search to be carried out on.
element_nameDesired XML element name.
attribute_idDesired XML element attribute name.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [7/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement > & elements,
const std::string & element_name,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches for XML elements of a given name within vector of XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Warning
Resulting pointers can become invalid if any changes are made to the source elements vector.
Parameters
elementsVector of XMLElement search to be carried out on.
element_nameDesired XML element name.
resultVector of pointers to XMLElement search results to be appended to.

◆ searchElement() [8/8]

void XMLAlgorithms::searchElement ( const std::vector< XMLElement > & elements,
const XMLElement::Type & element_type,
std::vector< XMLElement * > & result )
static

Searches for XML elements.

This method searches XML elements of given type within vector of XMLElement provided. Search is carried out in subelements as well (see XMLElement documentation).

Warning
Resulting pointers can become invalid if any changes are made to the source elements vector.
Parameters
elementsVector of XMLElement search to be carried out on.
element_typeDesired XML element type.
resultVector of pointers to XMLElement search results to be appended to.

◆ writeXML() [1/2]

void XMLAlgorithms::writeXML ( const std::vector< XMLElement * > & elements,
std::string & result )
static

Writes XML elements to given string.

Parameters
elementsVector of pointers to XMLElement to be written.
resultString XML elements are to be written to.

◆ writeXML() [2/2]

void XMLAlgorithms::writeXML ( const std::vector< XMLElement > & elements,
std::string & result )
static

Writes XML elements to given string.

Parameters
elementsVector of XML elements to be written.
resultString XML elements are to be written to.