bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
ncml_module::SimpleLocationParser Class Referenceabstract

SaxParser implementation that just grabs the netcdf@location attribute and returns it. More...

#include <SimpleLocationParser.h>

Inheritance diagram for ncml_module::SimpleLocationParser:
Inheritance graph
Collaboration diagram for ncml_module::SimpleLocationParser:
Collaboration graph

Public Member Functions

virtual void onCharacters (const std::string &)
 
virtual void onEndDocument ()
 
virtual void onEndElement (const std::string &)
 
virtual void onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri)=0
 
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)=0
 
std::string parseAndGetLocation (const std::string &filename)
 
virtual void setParseLineNumber (int)
 

Detailed Description

SaxParser implementation that just grabs the netcdf@location attribute and returns it.

See also
parseAndGetLocation()

Currently will still process the entire file. TODO maybe find a way to early exit?

Author
Michael Johnson m.joh.nosp@m.nson.nosp@m.@open.nosp@m.dap..nosp@m.org

Definition at line 46 of file SimpleLocationParser.h.

Constructor & Destructor Documentation

◆ SimpleLocationParser()

SimpleLocationParser::SimpleLocationParser ( )

Definition at line 41 of file SimpleLocationParser.cc.

◆ ~SimpleLocationParser()

SimpleLocationParser::~SimpleLocationParser ( )
virtual

Definition at line 46 of file SimpleLocationParser.cc.

Member Function Documentation

◆ onCharacters()

virtual void ncml_module::SimpleLocationParser::onCharacters ( const std::string & content)
inlinevirtual

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 75 of file SimpleLocationParser.h.

◆ onEndDocument()

virtual void ncml_module::SimpleLocationParser::onEndDocument ( )
inlinevirtual

Implements ncml_module::SaxParser.

Definition at line 65 of file SimpleLocationParser.h.

◆ onEndElement()

virtual void ncml_module::SimpleLocationParser::onEndElement ( const std::string & name)
inlinevirtual
Deprecated
We are preferring onEndElementWithNamespace() now. Called at the end of the element with the given name. The args are only valid for the duration of the call, so copy if necessary to keep.

Implements ncml_module::SaxParser.

Definition at line 72 of file SimpleLocationParser.h.

◆ onEndElementWithNamespace()

virtual void ncml_module::SaxParser::onEndElementWithNamespace ( const std::string & localname,
const std::string & prefix,
const std::string & uri )
pure virtualinherited

SAX2 End element with namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix or "" on the element
urithe uri (or "") associated with the namespace of the element.

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

◆ onParseError()

void SimpleLocationParser::onParseError ( std::string msg)
virtual

An unrecoverable parse error occurred

Implements ncml_module::SaxParser.

Definition at line 72 of file SimpleLocationParser.cc.

◆ onParseWarning()

void SimpleLocationParser::onParseWarning ( std::string msg)
virtual

A recoverable parse error occured.

Implements ncml_module::SaxParser.

Definition at line 67 of file SimpleLocationParser.cc.

◆ onStartDocument()

virtual void ncml_module::SimpleLocationParser::onStartDocument ( )
inlinevirtual

Implements ncml_module::SaxParser.

Definition at line 62 of file SimpleLocationParser.h.

◆ onStartElement()

void SimpleLocationParser::onStartElement ( const std::string & name,
const XMLAttributeMap & attrs )
virtual

We only use this get the the nedcdf@location attribute out

Implements ncml_module::SaxParser.

Definition at line 60 of file SimpleLocationParser.cc.

◆ onStartElementWithNamespace()

virtual void ncml_module::SaxParser::onStartElementWithNamespace ( const std::string & localname,
const std::string & prefix,
const std::string & uri,
const XMLAttributeMap & attributes,
const XMLNamespaceMap & namespaces )
pure virtualinherited

SAX2 start element call with gets namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix of the element, or "" if none.
urithe uri for the namespace of the element.
attributestable of the attributes (excluding namespace attributes prefixed with xmlns)
namespacetable of all the namespaces specification on this element

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

◆ parseAndGetLocation()

string SimpleLocationParser::parseAndGetLocation ( const std::string & filename)

Parse the NcML filename and return the netcdf@location attribute, assuming there's only one netCDF node. If more than one, we'll get the last node's location.

Definition at line 51 of file SimpleLocationParser.cc.

◆ setParseLineNumber()

virtual void ncml_module::SaxParser::setParseLineNumber ( int )
inlinevirtualinherited

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 in ncml_module::NCMLParser.

Definition at line 113 of file SaxParser.h.


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