bes
Updated for version 3.20.6
|
Public Member Functions | |
void | checkDataIsValidForCanonicalTypeOrThrow (const string &type, const vector< string > &tokens) const |
Make sure the given tokens are valid for the listed type. For example, makes sure floats are well formed, UInt16 are unsigned, etc. A successful call will return normally, else we throw an exception. More... | |
int | getParseLineNumber () const |
const XMLNamespaceStack & | getXMLNamespaceStack () const |
NCMLParser (agg_util::DDSLoader &loader) | |
Create a structure that can parse an NCML filename and returned a transformed response of requested type. More... | |
virtual void | onCharacters (const std::string &content) |
virtual void | onEndDocument () |
virtual void | onEndElement (const std::string &name) |
virtual void | onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri) |
virtual void | onParseError (std::string msg) |
virtual void | onParseWarning (std::string msg) |
virtual void | onStartDocument () |
virtual void | onStartElement (const std::string &name, const XMLAttributeMap &attrs) |
virtual void | onStartElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri, const XMLAttributeMap &attributes, const XMLNamespaceMap &namespaces) |
std::auto_ptr< BESDapResponse > | parse (const std::string &ncmlFilename, agg_util::DDSLoader::ResponseType type) |
Parse the NcML filename, returning a newly allocated DDS response containing the underlying dataset transformed by the NcML. The caller owns the returned memory. More... | |
void | parseInto (const string &ncmlFilename, agg_util::DDSLoader::ResponseType responseType, BESDapResponse *response) |
Same as parse, but the response object to parse into is passed down by the caller rather than created. More... | |
bool | parsing () const |
virtual void | setParseLineNumber (int line) |
Static Public Member Functions | |
static string | convertNcmlTypeToCanonicalType (const string &ncmlType) |
Static Public Attributes | |
static const string | STRUCTURE_TYPE |
Definition at line 158 of file NCMLParser.h.
ncml_module::NCMLParser::NCMLParser | ( | agg_util::DDSLoader & | loader | ) |
Create a structure that can parse an NCML filename and returned a transformed response of requested type.
loader | helper for loading a location referred to in the ncml. |
Definition at line 134 of file NCMLParser.cc.
void ncml_module::NCMLParser::checkDataIsValidForCanonicalTypeOrThrow | ( | const string & | type, |
const vector< string > & | tokens | ||
) | const |
Make sure the given tokens are valid for the listed type. For example, makes sure floats are well formed, UInt16 are unsigned, etc. A successful call will return normally, else we throw an exception.
BESUserSyntaxError | on invalid values. |
Definition at line 968 of file NCMLParser.cc.
|
static |
Convert the NCML type in ncmlType into a canonical type we will use in the parser. Specifically, we map NcML types to their closest DAP equivalent type, but we leave Structure as Structure since it is assumed to mean Constructor for DAP which is a superclass type. Note this passes DAP types through unchanged as well. It is illegal for ncmlType
to be empty(). We return "" to indicate an error in conversion.
ncmlType | a non empty() string that could be an NcML type (or built-in DAP type) |
Definition at line 944 of file NCMLParser.cc.
int ncml_module::NCMLParser::getParseLineNumber | ( | ) | const |
Get the line of the NCML file the parser is currently parsing
Definition at line 200 of file NCMLParser.cc.
const XMLNamespaceStack & ncml_module::NCMLParser::getXMLNamespaceStack | ( | ) | const |
If using namespaces, get the current stack of namespaces. Might be empty.
Definition at line 206 of file NCMLParser.cc.
|
virtual |
Called when characters are encountered within an element. content is only valid for the call duration. Note: this will return all whitespace in the document as well, which makes it messy to use.
Implements ncml_module::SaxParser.
Definition at line 329 of file NCMLParser.cc.
|
virtual |
Implements ncml_module::SaxParser.
Definition at line 253 of file NCMLParser.cc.
|
virtual |
SAX2 End element with namespace information.
localname | the localname of the element |
prefix | the namespace prefix or "" on the element |
uri | the uri (or "") associated with the namespace of the element. |
Implements ncml_module::SaxParser.
Definition at line 298 of file NCMLParser.cc.
|
virtual |
An unrecoverable parse error occurred
Implements ncml_module::SaxParser.
Definition at line 352 of file NCMLParser.cc.
|
virtual |
A recoverable parse error occured.
Implements ncml_module::SaxParser.
Definition at line 346 of file NCMLParser.cc.
|
virtual |
name | name of the element |
attrs | a map of any attributes -> values. Volatile for this call. |
Implements ncml_module::SaxParser.
Definition at line 221 of file NCMLParser.cc.
|
virtual |
SAX2 start element call with gets namespace information.
localname | the localname of the element |
prefix | the namespace prefix of the element, or "" if none. |
uri | the uri for the namespace of the element. |
attributes | table of the attributes (excluding namespace attributes prefixed with xmlns) |
namespace | table of all the namespaces specification on this element |
Implements ncml_module::SaxParser.
Definition at line 282 of file NCMLParser.cc.
auto_ptr< BESDapResponse > ncml_module::NCMLParser::parse | ( | const std::string & | ncmlFilename, |
agg_util::DDSLoader::ResponseType | type | ||
) |
Parse the NcML filename, returning a newly allocated DDS response containing the underlying dataset transformed by the NcML. The caller owns the returned memory.
BESSyntaxUserError | for parse errors such as bad XML or NcML referring to variables that do not exist. |
BESInternalError | for assertion failures, null ptr exceptions, or logic errors. |
Definition at line 148 of file NCMLParser.cc.
void ncml_module::NCMLParser::parseInto | ( | const string & | ncmlFilename, |
agg_util::DDSLoader::ResponseType | responseType, | ||
BESDapResponse * | response | ||
) |
Same as parse, but the response object to parse into is passed down by the caller rather than created.
ncmlFilename | the ncml file to parse |
responseType | the type of response. Must match response. |
response | the premade response object. The caller owns this memory. |
Definition at line 161 of file NCMLParser.cc.
bool ncml_module::NCMLParser::parsing | ( | ) | const |
Are we currently parsing?
Definition at line 195 of file NCMLParser.cc.
|
virtual |
Before any of the callbacks are issued, this function is called to let the implementing parser know what line number in the parse the next callback is being issued from to allow for more informative error messages. (Default impl is to ignore it now).
Reimplemented from ncml_module::SaxParser.
Definition at line 358 of file NCMLParser.cc.
|
static |
The string describing the type "Structure"
Definition at line 577 of file NCMLParser.h.