a2dIOHandlerXML Class Reference
[File IO]

Input handler for the XML format. More...

#include <genxmlpars.h>

Inheritance diagram for a2dIOHandlerXML:

Inheritance graph
[legend]
Collaboration diagram for a2dIOHandlerXML:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 a2dIOHandlerXML ()
 Constructor.
 ~a2dIOHandlerXML ()
 Destructor.
virtual void InitializeLoad ()
 Inits the handler for reading.
virtual void ResetLoad ()
 Reset the object after loading.
XML_Parser & GetXMLParser ()
 Returns the XML parser.
virtual int GetCurrentColumnNumber ()
 Returns the current column no.
virtual int GetCurrentLineNumber ()
 Returns the current line no.
wxString GetErrorString ()
 Returns last error as string.
double ParseDouble (const wxString &buffer, unsigned int &position)
void SkipCommaSpaces (const wxString &buffer, unsigned int &position)
void SkipSpaces (const wxString &buffer, unsigned int &position)

Protected Member Functions

virtual void StartElementHnd (a2dXMLTag *tag)
virtual void EndElementHnd (const wxString &name)
virtual void CharacterDataHnd (const wxString &text)
virtual void CommentHnd (const wxString &comment)
virtual void DefaultHnd (const wxString &def)

Static Protected Member Functions

static void BaseStartElementHnd (void *userData, const char *name, const char **atts)
static void BaseEndElementHnd (void *userData, const char *name)
static void BaseCharacterDataHnd (void *userData, const char *s, int len)
static void BaseCommentHnd (void *userData, const char *data)
static void BaseDefaultHnd (void *userData, const char *s, int len)

Protected Attributes

XML_Parser m_parser
 expat parser
char * m_buffer
 buffer used for passing part of the input stream
bool m_done
 true if reached end of document

Static Protected Attributes

static wxString m_encoding = wxT("UTF-8")
static wxString m_version = wxT("1.0")


Detailed Description

Input handler for the XML format.

The a2dIOHandlerXML uses a fast, lightweight, event-driven XML parser (expat).

Remarks:
It's only a input handler, the a2dIOHandlerXML is not able to write XML data. Use a2dIOHandlerXMLPull to read and write data. a2dIOHandlerXMLPull also has an comfortable API to read / write data, so there's no need to use the a2dIOHandlerXML class directly if you want to create your own XML fileformat.
See also:
a2dIOHandlerXMLPull

Definition at line 193 of file genxmlpars.h.


Constructor & Destructor Documentation

a2dIOHandlerXML::a2dIOHandlerXML (  ) 

Constructor.

Remarks:
Before you can use this object you've to call the InitializeLoad() or InitializeSave() method

The standard IO handlers of wxArt2d (i.e. wxDocviewIOHandlerXmlSer) call the Initialize method in the Load... methods, an extra call to Initialize is not necessary.

See also:
InitializeLoad

Definition at line 41 of file genxmlpars.cpp.


Member Function Documentation

void a2dIOHandlerXML::InitializeLoad (  )  [virtual]

Inits the handler for reading.

This method creates the parser and the buffer and also connects the Base...Hnd methods of this class with the parser.

Remarks:
You've to call this method before you can start doing something useful with this object!

Reimplemented from a2dIOHandlerStrIn.

Reimplemented in a2dIOHandlerXMLPull.

Definition at line 48 of file genxmlpars.cpp.

int a2dIOHandlerXML::GetCurrentColumnNumber (  )  [virtual]

Returns the current column no.

Returns the current column no. Mainly used for error msgs / debugging, but maybe usefull for other purposes.

See also:
GetCurrentLineNumber
Returns:
current column no.

Reimplemented in a2dIOHandlerXMLPull.

Definition at line 87 of file genxmlpars.cpp.

int a2dIOHandlerXML::GetCurrentLineNumber (  )  [virtual]

Returns the current line no.

Returns the current line no. Mainly for error msgs / debugging, but maybe usefull for other purposes.

See also:
GetCurrentColumnNumber
Returns:
current line no.

Reimplemented in a2dIOHandlerXMLPull.

Definition at line 94 of file genxmlpars.cpp.


The documentation for this class was generated from the following files:
a2dIOHandlerXML Class Reference -- Tue Aug 31 18:29:23 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation