Regina Calculation Engine
|
An XML element reader that reads the data for an individual packet. More...
#include <packet/xmlpacketreader.h>
Public Member Functions | |
XMLPacketReader (XMLTreeResolver &resolver) | |
Creates a new packet element reader. More... | |
virtual Packet * | packet () |
Returns the newly allocated packet that has been read by this element reader. More... | |
virtual XMLElementReader * | startContentSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps) |
Used instead of startSubElement() for XML subelements that are not child packets or packet tags. More... | |
virtual void | endContentSubElement (const std::string &subTagName, XMLElementReader *subReader) |
Used instead of endSubElement() for XML subelements that are not child packets or packet tags. More... | |
virtual XMLElementReader * | startSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps) |
Signifies that a subelement of this XML element is about to be parsed. More... | |
virtual void | endSubElement (const std::string &subTagName, XMLElementReader *subReader) |
Signifies that parsing has finished for a subelement of this XML element. More... | |
virtual void | abort (XMLElementReader *subReader) |
Signifies that XML parsing has been aborted. More... | |
virtual void | startElement (const std::string &tagName, const regina::xml::XMLPropertyDict &tagProps, XMLElementReader *parentReader) |
Signifies that parsing of this XML element is beginning. More... | |
virtual void | initialChars (const std::string &chars) |
Signifies that the initial text belonging to this XML element has been read. More... | |
virtual void | endElement () |
Signifies that parsing of this XML element is finished. More... | |
virtual void | usingParser (regina::xml::XMLParser *parser) |
Called for the top-level element in an XML file when parsing begins. More... | |
Protected Attributes | |
XMLTreeResolver & | resolver_ |
The master resolver that will be used to fix dangling packet references after the entire XML file has been read. More... | |
An XML element reader that reads the data for an individual packet.
Generally a subclass of XMLPacketReader will be used to receive and store packets that you care about. However, if you simply wish to ignore a particular packet (and all of its descendants), you can use class XMLPacketReader itself for the packet(s) you wish to ignore.
Routine packet() is used to return the packet that was read; see its documentation for further notes on how the packet should be constructed.
Routines startSubElement() and endSubElement() should not be overridden by derived classes. They determine whether the subelement is another packet element or a packet tag; if so then they deal with the subelement themselves (packet elements will be read using a new XMLPacketReader of the correct type), and if not then they call startContentSubElement() and endContentSubElement() which should be overridden for processing of non-packet XML subelements.
If routine abort() is overridden, it must at some point call XMLPacketReader::abort() which will destroy whatever new packets have already been created.