Finds a tinyxml2::XMLElement by name.
More...
#include <query.h>
|
| | FindElementByNameVisitor (const std::string &name) |
| |
| void | SetQueryName (const std::string &name) |
| | Changes the name used to find a matching element.
|
| |
| const tinyxml2::XMLElement * | Result () const |
| | Get the query result.
|
| |
| bool | VisitEnter (const tinyxml2::XMLElement &element, const tinyxml2::XMLAttribute *attribute) override |
| |
Finds a tinyxml2::XMLElement by name.
Implements a tinyxml2::XMLVisitor for tinyxml2::XMLNode::Accept.
Example usage:
tinyxml2::XMLDocument document;
document.Accept(&findElementByName);
if(auto color_maps_elem = findElementByName.Result()) {
}
Finds a tinyxml2::XMLElement by name.
Definition at line 27 of file query.h.
◆ FindElementByNameVisitor() [1/2]
| cgv::xml::FindElementByNameVisitor::FindElementByNameVisitor |
( |
| ) |
|
|
inline |
◆ FindElementByNameVisitor() [2/2]
| cgv::xml::FindElementByNameVisitor::FindElementByNameVisitor |
( |
const std::string & |
name | ) |
|
|
inline |
◆ Result()
| const tinyxml2::XMLElement * cgv::xml::FindElementByNameVisitor::Result |
( |
| ) |
const |
|
inline |
Get the query result.
- Returns
- the pointer to the matching tinyxml::XMLElement; if no match was found return nullptr
Definition at line 46 of file query.h.
◆ SetQueryName()
| void cgv::xml::FindElementByNameVisitor::SetQueryName |
( |
const std::string & |
name | ) |
|
|
inline |
Changes the name used to find a matching element.
- Parameters
-
| name | the query name string. |
Definition at line 39 of file query.h.
◆ VisitEnter()
| bool cgv::xml::FindElementByNameVisitor::VisitEnter |
( |
const tinyxml2::XMLElement & |
element, |
|
|
const tinyxml2::XMLAttribute * |
attribute |
|
) |
| |
|
inlineoverride |
The documentation for this class was generated from the following file: