FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoXmlReader Class Reference

#include <Reader.h>

Inherits FdoDisposable.

Inheritance diagram for FdoXmlReader:

[legend]
List of all members.

Detailed Description

FdoXmlReader reads an XML document from a text or binary stream. As various document fragments are read, it calls the appropriate SAX Handler callback on the current SAX Handler. This object maintains a stack of SAX Handlers, with the current one being the top handler in the stack. Callers provide this object with SAX Handlers to customize the processing of the XML document. FdoSAXHandler callbacks also provide a means to push other handlers onto the stack. For example, a SAX Handler for a particular XML element might push another handler to read a particular sub-element.

Definition at line 35 of file Reader.h.


Public Member Functions

virtual FDO_API_COMMON FdoStringP DecodeName (FdoStringP name)=0
 Utility function that is typically called for element names or name type attributes that were adjusted when they were written to XML. FDO names that correspond to XML names, but aren't valid XML names, are adjusted. This function undoes the name adjustment.
FDO_API_COMMON FdoBoolean GetEOD ()
 Indicates whether the end of the XML document has been reached.
FDO_API_COMMON FdoDictionaryGetNamespaces ()
 Returns all of the XML namespace declarations that are currently in-scope for the current position in the XML document being read.
FDO_API_COMMON FdoIoStreamGetStream ()
 Gets the underlying stream. If a text reader was passed to this object then the stream for this text reader is returned. If a stream was passed to this object then this stream is returned. If a file name as passed then a auto-generated stream (wrapped around the file) is returned.
FDO_API_COMMON FdoIoTextReaderGetTextReader ()
 Gets the underlying text reader. If a text reader was passed to this object then this text reader is returned. Otherwise, an auto-generated text reader is returned (a text reader wrapped around the file name or stream that was passed to this object).
virtual FDO_API_COMMON FdoBoolean Parse (FdoXmlSaxHandler *saxHandler=NULL, FdoXmlSaxContext *saxContext=NULL, FdoBoolean incremental=false)=0
 Parses the XML document.
FDO_API_COMMON FdoStringPrefixToUri (FdoString *prefix)
 Gets the URI for a namespace prefix.

Static Public Member Functions

FDO_API_COMMON FdoXmlReaderCreate (FdoIoTextReader *reader)
 Constructs an XML reader on a text reader.
FDO_API_COMMON FdoXmlReaderCreate (FdoIoStream *stream)
 Constructs an XML reader on a stream.
FDO_API_COMMON FdoXmlReaderCreate (FdoString *fileName)
 Constructs an XML reader on a file.

Protected Member Functions

virtual FDO_API_COMMON void Dispose ()
 Deletes myself.
 FdoXmlReader (FdoIoTextReader *reader)
 FdoXmlReader ()
 DOXYGEN-IGNORE
FdoBoolean GetParsed ()
 true if the first parse has been performed
FdoXmlSaxHandlerGetSaxHandler ()
 Gets the top SAX Handler from the stack without popping it.
FdoBoolean GetStopParse ()
 true if parse must be stopped.
void HandleCharacters (FdoString *chars)
void HandleEndDocument ()
void HandleEndElement (FdoString *pUri, FdoString *pElementName, FdoString *pElementQName)
void HandleEndPrefixMapping (FdoString *pPrefix)
void HandleStartDocument ()
void HandleStartElement (FdoString *pUri, FdoString *pElementName, FdoString *pElementQName, FdoXmlAttributeCollection *pAttrs)
void HandleStartPrefixMapping (FdoString *pPrefix, FdoString *pUri)
FdoXmlSaxHandlerPopSaxHandler ()
 Pops the top SAX Handler from the stack.
void PushSaxHandler (FdoXmlSaxHandler *saxHandler)
 Pushes the given object onto the SAX Handler stack. This object will now receive the SAX events.
void SetParsed ()
 set to true when the first parse has been performed
void SetSaxContext (FdoXmlSaxContext *saxContext)
void SetStopParse (FdoBoolean stopParse)
 set to true when parse is to be stopped
virtual ~FdoXmlReader (void)

Constructor & Destructor Documentation

FdoXmlReader::FdoXmlReader  )  [inline, protected]
 

DOXYGEN-IGNORE

Definition at line 175 of file Reader.h.

FdoXmlReader::FdoXmlReader FdoIoTextReader reader  )  [protected]
 

virtual FdoXmlReader::~FdoXmlReader void   )  [protected, virtual]
 


Member Function Documentation

FDO_API_COMMON FdoXmlReader* FdoXmlReader::Create FdoIoTextReader reader  )  [static]
 

Constructs an XML reader on a text reader.

Parameters:
reader Input the text reader.
Returns:
Returns FdoXmlReader

FDO_API_COMMON FdoXmlReader* FdoXmlReader::Create FdoIoStream stream  )  [static]
 

Constructs an XML reader on a stream.

Parameters:
stream Input the stream to read.
Returns:
Returns FdoXmlReader

FDO_API_COMMON FdoXmlReader* FdoXmlReader::Create FdoString fileName  )  [static]
 

Constructs an XML reader on a file.

Parameters:
fileName Input name of the file to read.
Returns:
Returns FdoXmlReader

virtual FDO_API_COMMON FdoStringP FdoXmlReader::DecodeName FdoStringP  name  )  [pure virtual]
 

Utility function that is typically called for element names or name type attributes that were adjusted when they were written to XML. FDO names that correspond to XML names, but aren't valid XML names, are adjusted. This function undoes the name adjustment.

Parameters:
name Input the name to decode.
Returns:
Returns the decoded name.

virtual FDO_API_COMMON void FdoXmlReader::Dispose  )  [inline, protected, virtual]
 

Deletes myself.

Reimplemented from FdoDisposable.

Definition at line 180 of file Reader.h.

References FDO_API_COMMON.

FDO_API_COMMON FdoBoolean FdoXmlReader::GetEOD  ) 
 

Indicates whether the end of the XML document has been reached.

Returns:
Returns true if this reader is at the end of the document, false otherwise

FDO_API_COMMON FdoDictionary* FdoXmlReader::GetNamespaces  ) 
 

Returns all of the XML namespace declarations that are currently in-scope for the current position in the XML document being read.

Returns:
Returns FdoDictionary. The dictionary has one FdoDictionaryElement entry per namespace declaration. FdoDictionaryElement->GetName() returns the namespace prefix. FdoDictionaryElement->GetValue() returns the URI.

FdoBoolean FdoXmlReader::GetParsed  )  [protected]
 

true if the first parse has been performed

FdoXmlSaxHandler* FdoXmlReader::GetSaxHandler  )  [protected]
 

Gets the top SAX Handler from the stack without popping it.

Returns:
Returns the top SAX Handler.

FdoBoolean FdoXmlReader::GetStopParse  )  [protected]
 

true if parse must be stopped.

FDO_API_COMMON FdoIoStream* FdoXmlReader::GetStream  ) 
 

Gets the underlying stream. If a text reader was passed to this object then the stream for this text reader is returned. If a stream was passed to this object then this stream is returned. If a file name as passed then a auto-generated stream (wrapped around the file) is returned.

Returns:
Returns the underlying stream

FDO_API_COMMON FdoIoTextReader* FdoXmlReader::GetTextReader  ) 
 

Gets the underlying text reader. If a text reader was passed to this object then this text reader is returned. Otherwise, an auto-generated text reader is returned (a text reader wrapped around the file name or stream that was passed to this object).

Returns:
Returns the underlying text reader

void FdoXmlReader::HandleCharacters FdoString chars  )  [protected]
 

void FdoXmlReader::HandleEndDocument  )  [protected]
 

void FdoXmlReader::HandleEndElement FdoString pUri,
FdoString pElementName,
FdoString pElementQName
[protected]
 

void FdoXmlReader::HandleEndPrefixMapping FdoString pPrefix  )  [protected]
 

void FdoXmlReader::HandleStartDocument  )  [protected]
 

These functions are invoked when various SAX events occur. They delegate these events to the current SAX Handler.

void FdoXmlReader::HandleStartElement FdoString pUri,
FdoString pElementName,
FdoString pElementQName,
FdoXmlAttributeCollection pAttrs
[protected]
 

void FdoXmlReader::HandleStartPrefixMapping FdoString pPrefix,
FdoString pUri
[protected]
 

virtual FDO_API_COMMON FdoBoolean FdoXmlReader::Parse FdoXmlSaxHandler saxHandler = NULL,
FdoXmlSaxContext saxContext = NULL,
FdoBoolean  incremental = false
[pure virtual]
 

Parses the XML document.

Parameters:
saxHandler Input SAX Handler to receive the FdoMathUtility events. This object is pushed onto the SAX Handler stack when parse() starts and popped when parse() is finished. If NULL then no handler is pushed, meaning that the current top SAX Handler receives the events. If saxHander is NULL and there is on current top SAX Handler then this function does a parse and reports syntax errors, but does no semantic processing.
saxContext Input Caller-specific contextual information that is pass to all SAX callbacks.
incremental Input true: an incremental (progressive) parse is performed. The first call to FdoXmlReader::Parse() causes the XML document to be read from the current position until the FdoXmlSaxHandler::EndElement() callback returns false or the end of the document is reached. On subsequent calls to Parse() the read continues where the previous call left off. false: the whole document is parsed in a single call to FdoXmlReader::Parse(). The FdoXmlSaxHandler::EndElement() return value is ignored. If a previous call was made to FdoXmlReader::Parse(), with incremental = true, then the rest of the document is parsed ( the EndElement() return value is ignored ).
Returns:
Returns true if the end of the document has not yet been reached

FdoXmlSaxHandler* FdoXmlReader::PopSaxHandler  )  [protected]
 

Pops the top SAX Handler from the stack.

Returns:
Returns the SAX Handler that was popped.

FDO_API_COMMON FdoString* FdoXmlReader::PrefixToUri FdoString prefix  ) 
 

Gets the URI for a namespace prefix.

Parameters:
prefix Input the namespace prefix.
Returns:
Returns the URI; L"" if the prefix is not in-scope at the current position in the XML document.

void FdoXmlReader::PushSaxHandler FdoXmlSaxHandler saxHandler  )  [protected]
 

Pushes the given object onto the SAX Handler stack. This object will now receive the SAX events.

Parameters:
saxHandler Input the SAX Handler to push.

void FdoXmlReader::SetParsed  )  [protected]
 

set to true when the first parse has been performed

void FdoXmlReader::SetSaxContext FdoXmlSaxContext saxContext  )  [protected]
 

Sets the SAX Context for the current parse. The SAX Context is passed to all FdoMathUtility callbacks.

void FdoXmlReader::SetStopParse FdoBoolean  stopParse  )  [protected]
 

set to true when parse is to be stopped


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.