#include <nxmlelementreader.h>
Inheritance diagram for regina::NXMLElementReader:
Public Member Functions | |
NXMLElementReader () | |
Creates a new element reader. | |
virtual | ~NXMLElementReader () |
Destroys this element reader. | |
virtual void | startElement (const std::string &tagName, const regina::xml::XMLPropertyDict &tagProps, NXMLElementReader *parentReader) |
Signifies that parsing of this XML element is beginning. | |
virtual void | initialChars (const std::string &chars) |
Signifies that the initial text belonging to this XML element has been read. | |
virtual NXMLElementReader * | startSubElement (const std::string &subTagName, const regina::xml::XMLPropertyDict &subTagProps) |
Signifies that a subelement of this XML element is about to be parsed. | |
virtual void | endSubElement (const std::string &subTagName, NXMLElementReader *subReader) |
Signifies that parsing has finished for a subelement of this XML element. | |
virtual void | endElement () |
Signifies that parsing of this XML element is finished. | |
virtual void | abort (NXMLElementReader *subReader) |
Signifies that XML parsing has been aborted. |
Specifically, this class concerns itself with reading and storing the contents between a single opening tag and the corresponding closing tag. It is not concerned with reading subelements of the element in question, although the contents of subelements will be made available.
Generally a subclass of NXMLElementReader will be used to receive and store information that you care about. However, if you simply wish to ignore the contents of a particular XML element (and all of its subelements), you can use class NXMLElementReader itself for the element(s) you wish to ignore.
When the parser runs through a particular XML element, the routines of the corresponding NXMLElementReader will be called as follows. First startElement() and initialChars() will be called. Then for each subelement encountered the following processing will take place: startSubElement() will be called to create a new child reader, the entire cycle of parsing routines will be called upon this child reader and then endSubElement() will be called upon the parent reader, after which the child reader will be destroyed. After all subelements have been processed, endElement() will be called.
If at any point parsing is aborted, routine abort() will be called upon all active readers and all active readers will be destroyed.
To parse an entire XML file using a variety of element readers (all of which may be of different subclasses of NXMLElementReader), create a new regina::xml::XMLParser with an NXMLCallback as its corresponding callback object.
|
Creates a new element reader.
|
|
Destroys this element reader. The default implementation does nothing. |
|
Signifies that XML parsing has been aborted. This element reader will be destroyed shortly after this routine is called. The default implementation does nothing.
Reimplemented in regina::NXMLPacketReader. |
|
Signifies that parsing of this XML element is finished. It is guaranteed that endSubElement() has not yet been called upon the parent reader (if one exists). The default implementation does nothing. |
|
Signifies that parsing has finished for a subelement of this XML element. The default implementation does nothing.
Reimplemented in regina::NXMLGroupPresentationReader, and regina::NXMLPacketReader. |
|
Signifies that the initial text belonging to this XML element has been read. The initial text is everything between the opening tag and the first subelement or closing tag. The default implementation does nothing.
Reimplemented in regina::NXMLAbelianGroupReader, regina::NXMLAngleStructureReader, regina::NXMLCharsReader, and regina::NXMLNormalSurfaceReader. |
|
Signifies that parsing of this XML element is beginning. The default implementation does nothing.
Reimplemented in regina::NXMLAbelianGroupReader, regina::NXMLGroupPresentationReader, regina::NXMLAngleStructureReader, and regina::NXMLNormalSurfaceReader. |
|
Signifies that a subelement of this XML element is about to be parsed. The default implementation returns a new NXMLElementReader which can be used to ignore the subelement completely.
Reimplemented in regina::NXMLGroupPresentationReader, regina::NXMLAngleStructureReader, regina::NXMLPacketReader, and regina::NXMLNormalSurfaceReader. |