brief defines abstraction over XML node.
More...
#include <src/api/mip/xml_node.h>
|
virtual void | AddAttribute (const std::string &attributeName, const std::string &attributeValue)=0 |
| Add a property to an existing node.
|
|
virtual bool | AddContent (const std::string &content)=0 |
| Add inner text to this xml node.
|
|
virtual std::shared_ptr< XmlNode > | AddNewChild (const std::string &name)=0 |
| Add a child to this XmlNode.
|
|
virtual std::shared_ptr< XmlNode > | AddNewChild (const std::string &name, const std::string &namespaceName)=0 |
| Add a child to this XmlNode.
|
|
virtual std::vector< std::pair< std::string, std::string > > | GetAttributes () const =0 |
|
virtual std::string | GetAttributeValue (const std::string &attributeName) const =0 |
|
virtual std::string | GetContent () const =0 |
|
virtual std::shared_ptr< XmlNode > | GetFirstChild () const =0 |
|
virtual std::string | GetInnerText () const =0 |
|
virtual std::string | GetName () const =0 |
|
virtual XmlNamespace | GetNamespace () const =0 |
|
virtual std::shared_ptr< XmlNode > | GetNextNode () const =0 |
|
virtual XmlNodeType | GetNodeType () const =0 |
| Get the type of node this xml is represented as.
|
|
virtual bool | IsNull () const =0 |
| See if the object has been initialized with an underlying xml node.
|
|
virtual int | RemoveAttribute (const std::string &attributeName)=0 |
| Removes a node property by name.
|
|
virtual bool | RemoveNodeFromDocument ()=0 |
| Remove this node and children from the xml document.
|
|
brief defines abstraction over XML node.
- Warning
- XmlNodes will be treated as memory managed by XmlDocument except for RemoveNodeFromDocument() which should handle its own memory clean up
Definition at line 89 of file xml_node.h.
◆ AddAttribute()
virtual void xml::XmlNode::AddAttribute |
( |
const std::string & | attributeName, |
|
|
const std::string & | attributeValue ) |
|
pure virtual |
Add a property to an existing node.
- Parameters
-
attributeName | Name of the attribute to add |
attributeValue | Value of the attribute to add |
◆ AddContent()
virtual bool xml::XmlNode::AddContent |
( |
const std::string & | content | ) |
|
|
pure virtual |
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.
◆ AddNewChild() [1/2]
virtual std::shared_ptr< XmlNode > xml::XmlNode::AddNewChild |
( |
const std::string & | name | ) |
|
|
pure virtual |
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() [2/2]
virtual std::shared_ptr< XmlNode > xml::XmlNode::AddNewChild |
( |
const std::string & | name, |
|
|
const std::string & | namespaceName ) |
|
pure virtual |
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.
◆ GetAttributes()
virtual std::vector< std::pair< std::string, std::string > > xml::XmlNode::GetAttributes |
( |
| ) |
const |
|
pure virtual |
◆ GetAttributeValue()
virtual std::string xml::XmlNode::GetAttributeValue |
( |
const std::string & | attributeName | ) |
const |
|
pure virtual |
◆ GetContent()
virtual std::string xml::XmlNode::GetContent |
( |
| ) |
const |
|
pure virtual |
◆ GetFirstChild()
virtual std::shared_ptr< XmlNode > xml::XmlNode::GetFirstChild |
( |
| ) |
const |
|
pure virtual |
◆ GetInnerText()
virtual std::string xml::XmlNode::GetInnerText |
( |
| ) |
const |
|
pure virtual |
◆ GetName()
virtual std::string xml::XmlNode::GetName |
( |
| ) |
const |
|
pure virtual |
◆ GetNamespace()
◆ GetNextNode()
virtual std::shared_ptr< XmlNode > xml::XmlNode::GetNextNode |
( |
| ) |
const |
|
pure virtual |
◆ GetNodeType()
virtual XmlNodeType xml::XmlNode::GetNodeType |
( |
| ) |
const |
|
pure virtual |
Get the type of node this xml is represented as.
- Returns
- A member of the enum describing the node type
◆ IsNull()
virtual bool xml::XmlNode::IsNull |
( |
| ) |
const |
|
pure virtual |
See if the object has been initialized with an underlying xml node.
- Returns
- True if underlying node. False if not.
◆ RemoveAttribute()
virtual int xml::XmlNode::RemoveAttribute |
( |
const std::string & | attributeName | ) |
|
|
pure virtual |
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
◆ RemoveNodeFromDocument()
virtual bool xml::XmlNode::RemoveNodeFromDocument |
( |
| ) |
|
|
pure virtual |
Remove this node and children from the xml document.
- Returns
- true if node was successfully deleted or false if failed.
The documentation for this class was generated from the following file: