ExpatXmlParser Class Reference

(Internal) ExpatXmlParser defines the primary controlling class for the Expat XML Parser. More...

#include <librets/ExpatXmlParser.h>

Inheritance diagram for ExpatXmlParser:

RetsXmlParser

List of all members.

Public Member Functions

 ExpatXmlParser (istreamPtr inputStream, const char *encoding="US-ASCII")
 Constructor used to parse XML data arriving through a stream.
 ExpatXmlParser (std::string inputString, const char *encoding="US-ASCII")
 Constructor used to parse XML data in a string.
virtual ~ExpatXmlParser ()
virtual bool HasNext ()
 Indicates whether or not there are additional XML events to process.
virtual RetsXmlEventPtr GetNextEvent ()
 Returns a reference to the next XML event to process.
RetsXmlEventListPtr GetEventList ()
 Returns all remaining events as a vector.
RetsXmlEventPtr GetNextSkippingEmptyText ()
RetsXmlEventListPtr GetEventListSkippingEmptyText ()
 Returns all remaining events as a vector, ingoring all empty text events.
RetsXmlStartElementEventPtr AssertNextIsStartEvent (std::string prefix="")
 Assert that the next event is a start element event.
RetsXmlEndElementEventPtr AssertNextIsEndEvent (std::string prefix="")
 Assert that the next event is an end element event.
RetsXmlTextEventPtr AssertNextIsTextEvent (std::string prefix="")
 Assert that the next event is a text element event.
RetsXmlEndDocumentEventPtr AssertNextIsEndDocumentEvent (std::string prefix="")
 Assert that the next event is the end document event.

Static Public Member Functions

static RetsXmlParserPtr CreateDefault (istreamPtr inputStream)
 Create a default XML parser around the speicified input stream.
static RetsXmlStartElementEventPtr AssertStartEvent (RetsXmlEventPtr event, std::string prefix="")
 Assert that the event is a start element event.
static RetsXmlEndElementEventPtr AssertEndEvent (RetsXmlEventPtr event, std::string prefix="")
 Assert that the event is an end element event.
static RetsXmlTextEventPtr AssertTextEvent (RetsXmlEventPtr event, std::string prefix="")
 Assert that the event is a text element event.
static RetsXmlEndDocumentEventPtr AssertEndDocumentEvent (RetsXmlEventPtr event, std::string prefix="")
 Assert that the event is the end document event.


Detailed Description

(Internal) ExpatXmlParser defines the primary controlling class for the Expat XML Parser.

Constructor & Destructor Documentation

ExpatXmlParser ( istreamPtr  inputStream,
const char *  encoding = "US-ASCII" 
)

Constructor used to parse XML data arriving through a stream.

Parameters:
inputStream The input stream.
encoding The encoding of the data within the stream. This defaults to "US-ASCII".

ExpatXmlParser ( std::string  inputString,
const char *  encoding = "US-ASCII" 
)

Constructor used to parse XML data in a string.

Parameters:
inputString The string containing the XML data.
encoding The encoding of the data within the string. This defaults to "US-ASCII".

virtual ~ExpatXmlParser (  )  [virtual]


Member Function Documentation

static RetsXmlEndDocumentEventPtr AssertEndDocumentEvent ( RetsXmlEventPtr  event,
std::string  prefix = "" 
) [static, inherited]

Assert that the event is the end document event.

Parameters:
event A pointer to the object containing the event.
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the event.
Exceptions:
RetsException If the element is not the end document event.

static RetsXmlEndElementEventPtr AssertEndEvent ( RetsXmlEventPtr  event,
std::string  prefix = "" 
) [static, inherited]

Assert that the event is an end element event.

Parameters:
event A pointer to the object containing the event.
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the event.
Exceptions:
RetsException If the next element is not an end event.

RetsXmlEndDocumentEventPtr AssertNextIsEndDocumentEvent ( std::string  prefix = ""  )  [inherited]

Assert that the next event is the end document event.

A side effect of this call is that the next element in the input stream is parsed.

Parameters:
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the next event.
Exceptions:
RetsException if the next element is not the end document event.

RetsXmlEndElementEventPtr AssertNextIsEndEvent ( std::string  prefix = ""  )  [inherited]

Assert that the next event is an end element event.

A side effect of this call is that the next element in the input stream is parsed.

Parameters:
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the next event.
Exceptions:
RetsException if the next element is not an end event.

RetsXmlStartElementEventPtr AssertNextIsStartEvent ( std::string  prefix = ""  )  [inherited]

Assert that the next event is a start element event.

A side effect of this call is that the next element in the input stream is parsed.

Parameters:
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the next event.
Exceptions:
RetsException if the next element is not a start event.

RetsXmlTextEventPtr AssertNextIsTextEvent ( std::string  prefix = ""  )  [inherited]

Assert that the next event is a text element event.

A side effect of this call is that the next element in the input stream is parsed.

Parameters:
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the next event.
Exceptions:
RetsException if the next element is not a text event.

static RetsXmlStartElementEventPtr AssertStartEvent ( RetsXmlEventPtr  event,
std::string  prefix = "" 
) [static, inherited]

Assert that the event is a start element event.

Parameters:
event A pointer to the object containing the event.
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the event.
Exceptions:
RetsException if the element is not a start event.

static RetsXmlTextEventPtr AssertTextEvent ( RetsXmlEventPtr  event,
std::string  prefix = "" 
) [static, inherited]

Assert that the event is a text element event.

Parameters:
event A pointer to the object containing the event.
prefix A string to be included when reporting errors.
Returns:
A RetsXmlStartElementEvent pointer to the event.
Exceptions:
RetsException If the element is not a text event.

static RetsXmlParserPtr CreateDefault ( istreamPtr  inputStream  )  [static, inherited]

Create a default XML parser around the speicified input stream.

Parameters:
inputStream A pointer to the input stream to be parsed.
Returns:
A pointer to the parser.

RetsXmlEventListPtr GetEventList (  )  [inherited]

Returns all remaining events as a vector.

Returns:
Vector of events.

RetsXmlEventListPtr GetEventListSkippingEmptyText (  )  [inherited]

Returns all remaining events as a vector, ingoring all empty text events.

Returns:
Vector of events.

virtual RetsXmlEventPtr GetNextEvent (  )  [virtual]

Returns a reference to the next XML event to process.

Returns:
A pointer as returned from Expat for the next event.

Implements RetsXmlParser.

RetsXmlEventPtr GetNextSkippingEmptyText (  )  [inherited]

virtual bool HasNext (  )  [virtual]

Indicates whether or not there are additional XML events to process.

Returns:
TRUE indicates that there are more XML tags to process.

Implements RetsXmlParser.


Generated by  doxygen