|
Ghidra 11.4.2
Ghidra internal decompiler documentation.
|
An XML element. A node in the DOM tree. More...
#include <xml.hh>
Public Member Functions | |
| Element (Element *par) | |
| Constructor given a parent Element. | |
| ~Element (void) | |
| Destructor. | |
| void | setName (const string &nm) |
| Set the local name of the element. | |
| void | addContent (const char *str, int4 start, int4 length) |
| Append new character content to this element. | |
| void | addChild (Element *child) |
| Add a new child Element to the model, with this as the parent. | |
| void | addAttribute (const string &nm, const string &vl) |
| Add a new name/value attribute pair to this element. | |
| Element * | getParent (void) const |
| Get the parent Element. | |
| const string & | getName (void) const |
| Get the local name of this element. | |
| const List & | getChildren (void) const |
| Get the list of child elements. | |
| const string & | getContent (void) const |
| Get the character content of this element. | |
| const string & | getAttributeValue (const string &nm) const |
| Get an attribute value by name. | |
| int4 | getNumAttributes (void) const |
| Get the number of attributes for this element. | |
| const string & | getAttributeName (int4 i) const |
| Get the name of the i-th attribute. | |
| const string & | getAttributeValue (int4 i) const |
| Get the value of the i-th attribute. | |
Protected Attributes | |
| Element * | parent |
| The parent Element (or null) | |
| List | children |
| A list of child Element objects. | |
An XML element. A node in the DOM tree.
This is the main node for the in-memory representation of the XML (DOM) tree.
|
inline |
Add a new name/value attribute pair to this element.
| nm | is the name of the attribute |
| vl | is the value of the attribute |
Referenced by ghidra::TreeHandler::startElement().
|
inline |
Add a new child Element to the model, with this as the parent.
| child | is the new child Element |
References children.
Referenced by ghidra::TreeHandler::startElement().
|
inline |
Append new character content to this element.
| str | is an array of character data |
| start | is the index of the first character to append |
| length | is the number of characters to append |
References content.
Referenced by ghidra::TreeHandler::characters().
| const string & ghidra::Element::getAttributeValue | ( | const string & | nm | ) | const |
Get an attribute value by name.
Look up the value for the given attribute name and return it. An exception is thrown if the attribute does not exist.
| nm | is the name of the attribute |
Referenced by ghidra::LoadImageXml::LoadImageXml(), ghidra::XmlDecode::readBool(), ghidra::XmlDecode::readBool(), ghidra::XmlDecode::readOpcode(), ghidra::XmlDecode::readOpcode(), ghidra::XmlDecode::readSignedInteger(), ghidra::XmlDecode::readSignedInteger(), ghidra::XmlDecode::readSignedIntegerExpectString(), ghidra::XmlDecode::readSpace(), ghidra::XmlDecode::readSpace(), ghidra::XmlDecode::readString(), ghidra::XmlDecode::readString(), ghidra::XmlDecode::readUnsignedInteger(), and ghidra::XmlDecode::readUnsignedInteger().