|
ADS-IDAC Engine 5.0.0
|
One XML element with its attributes and child elements. More...
#include <xml_lite.hpp>
Public Member Functions | |
| const std::string * | attribute (const std::string &name) const |
| std::string | attributeOr (const std::string &name, const std::string &fallback) const |
| const Element * | child (const std::string &name) const |
| std::vector< const Element * > | childrenNamed (const std::string &name) const |
Public Attributes | |
| std::string | name |
| tag name as written More... | |
| std::vector< Attribute > | attributes |
| in document order More... | |
| std::vector< Element > | children |
| child elements in document order More... | |
One XML element with its attributes and child elements.
Text content is not kept. An Element owns its children by value, so the pointers returned by the lookup helpers stay valid as long as the element they were taken from is neither modified nor destroyed.
Definition at line 53 of file xml_lite.hpp.
| const std::string * faulttree::xml::Element::attribute | ( | const std::string & | name | ) | const |
Returns the attribute value, or nullptr when absent.
| name | Attribute name, compared exactly. If the element repeats an attribute name, the first one is returned. |
Definition at line 9 of file xml_lite.cpp.
References attributes, and name.
Referenced by attributeOr().
| std::string faulttree::xml::Element::attributeOr | ( | const std::string & | name, |
| const std::string & | fallback | ||
| ) | const |
Returns the attribute value, or fallback when absent.
| name | Attribute name, compared exactly. |
| fallback | Value returned when the attribute is absent. |
Definition at line 16 of file xml_lite.cpp.
References attribute(), and name.
| const Element * faulttree::xml::Element::child | ( | const std::string & | name | ) | const |
First child element with this tag name, or nullptr.
| name | Tag name, compared exactly. Only direct children are searched. |
Definition at line 22 of file xml_lite.cpp.
| std::vector< const Element * > faulttree::xml::Element::childrenNamed | ( | const std::string & | name | ) | const |
All child elements with this tag name, in document order.
| name | Tag name, compared exactly. Only direct children are searched. |
children; empty when there is no match. Definition at line 30 of file xml_lite.cpp.
| std::vector<Attribute> faulttree::xml::Element::attributes |
| std::vector<Element> faulttree::xml::Element::children |
child elements in document order
Definition at line 56 of file xml_lite.hpp.
Referenced by child(), and childrenNamed().
| std::string faulttree::xml::Element::name |
tag name as written
Definition at line 54 of file xml_lite.hpp.
Referenced by attribute(), attributeOr(), child(), and childrenNamed().