decompiler
1.0.0
|
A container for parsed XML documents. More...
#include <xml.hh>
Public Member Functions | |
~DocumentStorage (void) | |
Destructor. | |
Document * | parseDocument (istream &s) |
Parse an XML document from the given stream. More... | |
Document * | openDocument (const string &filename) |
Open and parse an XML file. More... | |
void | registerTag (const Element *el) |
Register the given XML Element object under its tag name. More... | |
const Element * | getTag (const string &nm) const |
Retrieve a registered XML Element by name. More... | |
Private Attributes | |
vector< Document * > | doclist |
The list of documents held by this container. | |
map< string, const Element * > | tagmap |
The map from name to registered XML elements. | |
A container for parsed XML documents.
This holds multiple XML documents that have already been parsed. Documents can be put in this container, either by handing it a stream via parseDocument() or a filename via openDocument(). If they are explicitly registered, specific XML Elements can be looked up by name via getTag().
const Element* ghidra::DocumentStorage::getTag | ( | const string & | nm | ) | const |
Retrieve a registered XML Element by name.
nm | is the XML tag name |
Referenced by ghidra::XmlArchitecture::buildLoader(), ghidra::ArchitectureGhidra::buildSymbols(), ghidra::SleighArchitecture::buildSymbols(), ghidra::ArchitectureGhidra::buildTypegrp(), ghidra::SleighArchitecture::buildTypegrp(), ghidra::GhidraTranslate::initialize(), ghidra::Sleigh::initialize(), ghidra::Architecture::parseCompilerConfig(), ghidra::Architecture::parseExtraRules(), ghidra::Architecture::parseProcessorConfig(), ghidra::XmlArchitecture::restoreXml(), ghidra::RawBinaryArchitecture::restoreXml(), ghidra::BfdArchitecture::restoreXml(), and ghidra::Architecture::restoreXml().
Document* ghidra::DocumentStorage::openDocument | ( | const string & | filename | ) |
Open and parse an XML file.
The given filename is opened on the local filesystem and an attempt is made to parse its contents into an in-memory DOM tree. An XmlException is thrown for any parsing error.
filename | is the name of the XML document file |
Referenced by ghidra::XmlArchitecture::buildLoader(), ghidra::SleighArchitecture::buildSpecFile(), and ghidra::FunctionTestCollection::loadTest().
Document* ghidra::DocumentStorage::parseDocument | ( | istream & | s | ) |
Parse an XML document from the given stream.
Parsing starts immediately on the stream, attempting to make an in-memory DOM tree. An XmlException is thrown for any parsing error.
s | is the given stream to parse |
Referenced by ghidra::ArchitectureGhidra::buildSpecFile(), ghidra::IfcCallGraphLoad::execute(), and ghidra::IfcStructureBlocks::execute().
void ghidra::DocumentStorage::registerTag | ( | const Element * | el | ) |
Register the given XML Element object under its tag name.
Only one Element can be stored on this object per tag name.
el | is the given XML element |
Referenced by ghidra::XmlArchitecture::buildLoader(), ghidra::ArchitectureGhidra::buildSpecFile(), ghidra::SleighArchitecture::buildSpecFile(), ghidra::Architecture::parseProcessorConfig(), ghidra::RawBinaryArchitecture::restoreXml(), ghidra::XmlArchitecture::restoreXml(), ghidra::BfdArchitecture::restoreXml(), and ghidra::FunctionTestCollection::restoreXml().