decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::TreeHandler Class Reference

A SAX interface implementation for constructing an in-memory DOM model. More...

#include <xml.hh>

Inheritance diagram for ghidra::TreeHandler:
ghidra::ContentHandler

Public Member Functions

 TreeHandler (Element *rt)
 Constructor given root Element.
 
virtual void setDocumentLocator (Locator locator)
 Set the Locator object for documents.
 
virtual void startDocument (void)
 Start processing a new XML document.
 
virtual void endDocument (void)
 End processing for the current XML document.
 
virtual void startPrefixMapping (const string &prefix, const string &uri)
 Start a new prefix to namespace URI mapping.
 
virtual void endPrefixMapping (const string &prefix)
 Finish the current prefix.
 
virtual void startElement (const string &namespaceURI, const string &localName, const string &qualifiedName, const Attributes &atts)
 Callback indicating a new XML element has started. More...
 
virtual void endElement (const string &namespaceURI, const string &localName, const string &qualifiedName)
 Callback indicating parsing of the current XML element is finished. More...
 
virtual void characters (const char *text, int4 start, int4 length)
 Callback with raw characters to be inserted in the current XML element. More...
 
virtual void ignorableWhitespace (const char *text, int4 start, int4 length)
 Callback with whitespace character data for the current XML element. More...
 
virtual void processingInstruction (const string &target, const string &data)
 Callback for a formal processing instruction seen in the current document. More...
 
virtual void setVersion (const string &val)
 Set the XML version as specified by the current document. More...
 
virtual void setEncoding (const string &val)
 Set the character encoding as specified by the current document. More...
 
virtual void skippedEntity (const string &name)
 Callback for an XML entity skipped by the parser. More...
 
virtual void setError (const string &errmsg)
 Callback for handling an error condition during XML parsing. More...
 
const string & getError (void) const
 Get the current error message.
 
- Public Member Functions inherited from ghidra::ContentHandler
virtual ~ContentHandler (void)
 Destructor.
 

Private Attributes

Elementroot
 The root XML element being processed by this handler.
 
Elementcur
 The current XML element being processed by this handler.
 
string error
 The last error condition returned by the parser (if not empty)
 

Detailed Description

A SAX interface implementation for constructing an in-memory DOM model.

This implementation builds a DOM model of the XML stream being parsed, creating an Element object for each XML element tag in the stream. This handler is initialized with a root Element object, which after parsing is complete will own all parsed elements.

Member Function Documentation

◆ characters()

virtual void ghidra::TreeHandler::characters ( const char *  text,
int4  start,
int4  length 
)
virtual

Callback with raw characters to be inserted in the current XML element.

Parameters
textis an array of character data being inserted.
startis the first character within the array to insert.
lengthis the number of characters to insert.

Implements ghidra::ContentHandler.

◆ endElement()

virtual void ghidra::TreeHandler::endElement ( const string &  namespaceURI,
const string &  localName,
const string &  qualifiedName 
)
virtual

Callback indicating parsing of the current XML element is finished.

Parameters
namespaceURIis the namespace to which the element belongs
localNameis the local name of the new element
qualifiedNameis the fully qualified name of the element.

Implements ghidra::ContentHandler.

◆ ignorableWhitespace()

virtual void ghidra::TreeHandler::ignorableWhitespace ( const char *  text,
int4  start,
int4  length 
)
inlinevirtual

Callback with whitespace character data for the current XML element.

Parameters
textis an array of character data that can be inserted.
startis the first character within the array to insert.
lengthis the number of characters to insert.

Implements ghidra::ContentHandler.

◆ processingInstruction()

virtual void ghidra::TreeHandler::processingInstruction ( const string &  target,
const string &  data 
)
inlinevirtual

Callback for a formal processing instruction seen in the current document.

Parameters
targetis the target instruction to process
datais (optional) character data for the instruction

Implements ghidra::ContentHandler.

◆ setEncoding()

virtual void ghidra::TreeHandler::setEncoding ( const string &  encoding)
inlinevirtual

Set the character encoding as specified by the current document.

Parameters
encodingis the parsed encoding string

Implements ghidra::ContentHandler.

◆ setError()

virtual void ghidra::TreeHandler::setError ( const string &  errmsg)
inlinevirtual

Callback for handling an error condition during XML parsing.

Parameters
errmsgis a message describing the error condition

Implements ghidra::ContentHandler.

◆ setVersion()

virtual void ghidra::TreeHandler::setVersion ( const string &  version)
inlinevirtual

Set the XML version as specified by the current document.

Parameters
versionis the parsed version string

Implements ghidra::ContentHandler.

◆ skippedEntity()

virtual void ghidra::TreeHandler::skippedEntity ( const string &  name)
inlinevirtual

Callback for an XML entity skipped by the parser.

Parameters
nameis the name of the entity being skipped

Implements ghidra::ContentHandler.

◆ startElement()

virtual void ghidra::TreeHandler::startElement ( const string &  namespaceURI,
const string &  localName,
const string &  qualifiedName,
const Attributes atts 
)
virtual

Callback indicating a new XML element has started.

Parameters
namespaceURIis the namespace to which the new element belongs
localNameis the local name of the new element
qualifiedNameis the fully qualified name of the new element
attsis the set of (previously parsed) attributes to attach to the new element

Implements ghidra::ContentHandler.


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