Class xml_node_t

Inheritance Relationships

Base Type

Class Documentation

class xml_node_t : public wt::scene::loader::node_t

Node for an XML data source.

Public Functions

xml_node_t(const pugi::xml_node &xmlnode, const xml_data_source_t *data_source) noexcept
~xml_node_t() noexcept = default
inline const auto *get_data_source() const noexcept
inline virtual const std::string &type() const noexcept override

Node type. For example, XML nodes should all return the same type (e.g., “XML”).

inline virtual const std::string &path() const noexcept override

Node path.

inline virtual const std::string &name() const noexcept override

Node name.

inline virtual bool has_attrib(const std::string &attribute) const noexcept override
inline virtual const std::string &operator[](const std::string &attribute) const noexcept override

Accesses an attribute by name.

inline virtual const std::map<std::string, std::string> &attributes() const noexcept override

List of attributes.

inline virtual std::vector<const node_t*> children(const std::string &name) const noexcept override

List of all children nodes of name name.

inline virtual const std::vector<std::unique_ptr<node_t>> &children() const noexcept override

List of all children nodes.

inline virtual std::vector<std::unique_ptr<node_t>> extract_children() && noexcept override

Moves all children out of this node. Destructive.

inline virtual bool set_attribute(const std::string &name, const std::string &value) noexcept override

Sets or updates attribute value.

inline virtual bool add_child(std::unique_ptr<node_t> child) noexcept override

Insert a child node.

inline virtual bool replace_child(const node_t &child, std::vector<std::unique_ptr<node_t>> nodes) noexcept override

Replaces a child node child with other nodes.

inline virtual bool erase_child(const node_t &node) noexcept override

Remove the node from this node’s children. Does nothing if node is not a child node.

inline auto get_node_offset_in_xmlfile() const noexcept
inline auto *get_node_data_source() const noexcept