class xml::XmlNode

brief defines abstraction over XML node.

Summary

Members Descriptions
public std::string GetAttributeValue(const std::string& attributeName) const Not yet documented.
public std::vector<std::pair<std::string, std::string>> GetAttributes() const Not yet documented.
public std::shared_ptr<XmlNode> GetNextNode() const Not yet documented.
public std::shared_ptr<XmlNode> GetFirstChild() const Not yet documented.
public std::string GetName() const Not yet documented.
public std::string GetContent() const Not yet documented.
public std::string GetInnerText() const Not yet documented.
public XmlNamespace GetNamespace() const Not yet documented.
public bool IsNull() const See if the object has been initialized with an underlying xml node.
public void AddAttribute(const std::string& attributeName, const std::string& attributeValue) Add a property to an existing node.
public int RemoveAttribute(const std::string& attributeName) Removes a node property by name.
public std::shared_ptr<XmlNode> AddNewChild(const std::string& name) Add a child to this XmlNode. New child is inserted after any existing children.
public std::shared_ptr<XmlNode> AddNewChild(const std::string& name, const std::string& namespaceName) Add a child to this XmlNode. New child is inserted after any existing children.
public bool AddContent(const std::string& content) Add inner text to this xml node.
public bool RemoveNodeFromDocument() Remove this node and children from the xml document.

Members

GetAttributeValue function

Not documented yet.

GetAttributes function

Not documented yet.

GetNextNode function

Not documented yet.

GetFirstChild function

Not documented yet.

GetName function

Not documented yet.

GetContent function

Not documented yet.

GetInnerText function

Not documented yet.

GetNamespace function

Not documented yet.

IsNull function

See if the object has been initialized with an underlying xml node.

Returns: True if underlying node. False if not.

AddAttribute function

Add a property to an existing node.

Parameters:

  • attributeName: Name of the attribute to add

  • attributeValue: Value of the attribute to add

RemoveAttribute function

Removes a node property by name.

Parameters:

  • attributeName: The property name to remove

Returns: 0 if the property was found and successfully removed and -1 otherwise

AddNewChild function

Add a child to this XmlNode. New child is inserted after any existing children.

Parameters:

  • name: The name of the new node

Returns: A pointer to the node that was added or a nullptr if the operation failed.

AddNewChild function

Add a child to this XmlNode. New child is inserted after any existing children.

Parameters:

  • name: The name of the new node

  • namespaceName: The namespace prefix to insert the new node under

Returns: A pointer to the node that was added or a nullptr if the operation failed.

AddContent function

Add inner text to this xml node.

Parameters:

  • content: The string to add as inner text

Returns: True if content was added or false if the operation failed.

RemoveNodeFromDocument function

Remove this node and children from the xml document.

Returns: True if node was successfully deleted or false if failed.d.