#include <AISDatabaseParser.h>
Public Member Functions | |
void | intern (const string &database, AISResources *ais) |
Static Public Member Functions | |
SAX Parser Callbacks | |
These methods are declared static in the class header. This gives them C linkage which allows them to be used as callbacks by the SAX parser engine. | |
void | aisEndDocument (AISParserState *state) |
void | aisEndElement (AISParserState *state, const char *name) |
void | aisError (AISParserState *state, const char *msg,...) |
void | aisFatalError (AISParserState *state, const char *msg,...) |
xmlEntityPtr | aisGetEntity (AISParserState *state, const xmlChar *name) |
void | aisStartDocument (AISParserState *state) |
void | aisStartElement (AISParserState *state, const char *name, const char **attrs) |
void | aisWarning (AISParserState *state, const char *msg,...) |
Static methods are used as callbacks for the SAX parser. They do not throw exceptions because exceptions from within callbacks are not reliable or portable. To signal errors, the methods record information in the AISParserState object. Once any of the error handlers (aisWarning, aisError or aisFatalError) is called, construction of an AISResources object ends even though the SAX parser still calls the various callback functions. The parse method throws an AISDatabaseReadFailed exception if an error was found.
Note that this class uses the C++-supplied default definitions for the default and copy constructors as well as the destructor and assignment operator.
This class should be extended so that the line number is added to error messages.
Definition at line 66 of file AISDatabaseParser.h.
|
Clean up after finishing a parse.
Definition at line 78 of file AISDatabaseParser.cc. References aisFatalError(), DBG, and DBG2. |
Here is the call graph for this function:
|
Process an end element tag. This is where values are added to the AISResources object that's held by
Definition at line 204 of file AISDatabaseParser.cc. References DBG2. |
|
Process an XML error. This is treated as a fatal error since there's no easy way for libdap++ to signal a warning to users.
Definition at line 292 of file AISDatabaseParser.cc. References long_to_string(). |
Here is the call graph for this function:
|
Process an XML fatal error.
Definition at line 317 of file AISDatabaseParser.cc. References long_to_string(). Referenced by aisEndDocument(), and aisStartElement(). |
Here is the call graph for this function:
|
Handle the standard XML entities.
Definition at line 256 of file AISDatabaseParser.cc. |
|
Initialize the SAX parser state object. This object is passed to each callback as a void pointer.
Definition at line 65 of file AISDatabaseParser.cc. References DBG2. |
|
Process a start element tag. Because the AIS DTD uses attributes and because libxml2 does not validate those, we do attribute validation here. Values pulled from the attributes are recorded in
Definition at line 99 of file AISDatabaseParser.cc. References aisFatalError(), DBG, and DBG2. |
Here is the call graph for this function:
|
Process an XML warning. This is treated as a fatal error since there's no easy way for libdap++ to signal a warning to users.
Definition at line 266 of file AISDatabaseParser.cc. References long_to_string(). |
Here is the call graph for this function:
|
Parse an AIS database encoded in XML. The information in the XML document is loaded into an instance of AISResources.
Definition at line 389 of file AISDatabaseParser.cc. Referenced by AISResources::read_database(). |