decompiler  1.0.0
Public Member Functions | Protected Attributes | Private Attributes | List of all members
Element Class Reference

An XML element. A node in the DOM tree. More...

#include <xml.hh>

Inheritance diagram for Element:
Document

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. More...
 
void addChild (Element *child)
 Add a new child Element to the model, with this as the parent. More...
 
void addAttribute (const string &nm, const string &vl)
 Add a new name/value attribute pair to this element. More...
 
ElementgetParent (void) const
 Get the parent Element.
 
const string & getName (void) const
 Get the local name of this element.
 
const ListgetChildren (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. More...
 
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

Elementparent
 The parent Element (or null)
 
List children
 A list of child Element objects.
 

Private Attributes

string name
 The (local) name of the element.
 
string content
 Character content of the element.
 
vector< string > attr
 A list of attribute names for this element.
 
vector< string > value
 a (corresponding) list of attribute values for this element
 

Detailed Description

An XML element. A node in the DOM tree.

This is the main node for the in-memory representation of the XML (DOM) tree.

Member Function Documentation

void Element::addAttribute ( const string &  nm,
const string &  vl 
)
inline

Add a new name/value attribute pair to this element.

Parameters
nmis the name of the attribute
vlis the value of the attribute
void Element::addChild ( Element child)
inline

Add a new child Element to the model, with this as the parent.

Parameters
childis the new child Element
void Element::addContent ( const char *  str,
int4  start,
int4  length 
)
inline

Append new character content to this element.

Parameters
stris an array of character data
startis the index of the first character to append
lengthis the number of characters to append
const string& 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.

Parameters
nmis the name of the attribute
Returns
the corresponding attribute value

Referenced by ScopeGhidra::dump2Cache(), LoadImageXml::LoadImageXml(), LoadImageXml::open(), Architecture::parseAggressiveTrim(), TypeFactory::parseDataOrganization(), Architecture::parseDeadcodeDelay(), Architecture::parseDynamicRule(), TypeFactory::parseEnumConfig(), Architecture::parseFuncPtrAlign(), Database::parseParentTag(), Architecture::parsePreferSplit(), Architecture::parseProtoEval(), Architecture::parseSpacebase(), Architecture::parseStackPointer(), ScopeInternal::processCollision(), ScopeGhidra::processHole(), ScopeInternal::processHole(), InjectPayload::readParameter(), ScopeGhidra::reresolveScope(), ContextInternal::restoreContext(), Architecture::restoreFlowOverride(), CompilerTag::restoreXml(), GhidraTranslate::restoreXml(), XmlArchitecture::restoreXml(), SleighBase::restoreXml(), RawBinaryArchitecture::restoreXml(), BfdArchitecture::restoreXml(), VarnodeData::restoreXml(), BlockEdge::restoreXml(), LoadTable::restoreXml(), InjectCallfixupGhidra::restoreXml(), InjectCallotherGhidra::restoreXml(), Comment::restoreXml(), LanguageDescription::restoreXml(), TruncationTag::restoreXml(), TrackedContext::restoreXml(), Override::restoreXml(), CPoolRecord::restoreXml(), FloatFormat::restoreXml(), ParamEntry::restoreXml(), LanedRegister::restoreXml(), VolatileReadOp::restoreXml(), InjectPayload::restoreXml(), VolatileWriteOp::restoreXml(), SymbolEntry::restoreXml(), SeqNum::restoreXml(), AddrSpace::restoreXml(), OpFollow::restoreXml(), Funcdata::restoreXml(), ConstantPoolInternal::CheapSorter::restoreXml(), SpacebaseSpace::restoreXml(), Range::restoreXml(), Architecture::restoreXml(), SegmentOp::restoreXml(), ScopeLocal::restoreXml(), JumpAssistOp::restoreXml(), OverlaySpace::restoreXml(), FunctionSymbol::restoreXml(), ExternRefSymbol::restoreXml(), TypeFactory::restoreXml(), ParamListStandard::restoreXml(), JumpTable::restoreXml(), ProtoModel::restoreXml(), Database::restoreXml(), ProtoModelMerged::restoreXml(), ProtoStoreInternal::restoreXml(), FuncProto::restoreXml(), AddrSpace::restoreXmlAttributes(), JoinSpace::restoreXmlAttributes(), Datatype::restoreXmlBasic(), BlockGraph::restoreXmlBody(), SleighArchitecture::restoreXmlHeader(), FlowBlock::restoreXmlHeader(), Symbol::restoreXmlHeader(), PcodeEmit::restoreXmlOp(), AddrSpaceManager::restoreXmlSpaces(), TypeFactory::restoreXmlType(), TypeFactory::restoreXmlTypeNoRef(), and TypeFactory::restoreXmlTypeWithCodeFlags().


The documentation for this class was generated from the following file: