Regina Calculation Engine
Public Member Functions | Protected Attributes | List of all members
regina::XMLPacketReader Class Reference

An XML element reader that reads the data for an individual packet. More...

#include <packet/xmlpacketreader.h>

Inheritance diagram for regina::XMLPacketReader:
regina::XMLElementReader regina::XMLAngleStructuresReader regina::XMLContainerReader regina::XMLFilterPacketReader regina::XMLLinkReader regina::XMLNormalHypersurfacesReader regina::XMLNormalSurfacesReader regina::XMLPDFReader regina::XMLScriptReader regina::XMLSnapPeaReader regina::XMLTextReader

Public Member Functions

 XMLPacketReader (XMLTreeResolver &resolver)
 Creates a new packet element reader. More...
 
virtual Packetpacket ()
 Returns the newly allocated packet that has been read by this element reader. More...
 
virtual XMLElementReaderstartContentSubElement (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 XMLElementReaderstartSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps) override
 Signifies that a subelement of this XML element is about to be parsed. More...
 
virtual void endSubElement (const std::string &subTagName, XMLElementReader *subReader) override
 Signifies that parsing has finished for a subelement of this XML element. More...
 
virtual void abort (XMLElementReader *subReader) override
 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

XMLTreeResolverresolver_
 The master resolver that will be used to fix dangling packet references after the entire XML file has been read. More...
 

Detailed Description

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.

Python:\n Not present.

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

Copyright © 1999-2018, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).