Regina Calculation Engine
|
Used to parse an entire XML file. More...
#include <utilities/xmlutils.h>
Public Member Functions | |
XMLParser (XMLParserCallback &callback) | |
Creates a new XML parser. More... | |
virtual | ~XMLParser () |
Destroys this XML parser. More... | |
void | parse_chunk (const std::string &s) |
Parses the given chunk of XML. More... | |
void | finish () |
Signals that there are no more XML chunks to parse. More... | |
XMLParser (const XMLParser &)=delete | |
XMLParser & | operator= (const XMLParser &)=delete |
Static Public Member Functions | |
static void | parse_stream (XMLParserCallback &callback, std::istream &file, unsigned chunkSize=1024) |
Parses an entire XML file. More... | |
Used to parse an entire XML file.
When particular XML components are encountered, this will be signalled by calling corresponding routines from the XMLParserCallback that is passed to the XMLParser constructor.
To parse an entire XML file, simply call static routine parse_stream(), which does not require you to create an XMLParser yourself.
If you desire more fine-grained control over the parsing process, you may create an XMLParser yourself and parse the file manually in small pieces. To do this, routine parse_chunk() should be called repeatedly with consecutive pieces of the XML file. Once the entire XML file has been sent through parse_chunk(), routine finish() should be called once to signal that processing is complete.