copasi API
0.1
|
#include <CExpat.h>
Public Member Functions | |
void | destroy () |
CExpatTemplate () | |
~CExpatTemplate () | |
bool | create (const XML_Char *pszEncoding=NULL, const XML_Char *pszSep=NULL) |
bool | parse (const char *pszBuffer, int nLength=-1, bool fIsFinal=true) |
bool | parseBuffer (int nLength, bool fIsFinal=true) |
void * | getBuffer (int nLength) |
void | enableStartElementHandler (bool fEnable=true) |
void | enableEndElementHandler (bool fEnable=true) |
void | enableElementHandler (bool fEnable=true) |
void | enableCharacterDataHandler (bool fEnable=true) |
void | enableProcessingInstructionHandler (bool fEnable=true) |
void | enableCommentHandler (bool fEnable=true) |
void | enableStartCdataSectionHandler (bool fEnable=true) |
void | enableEndCdataSectionHandler (bool fEnable=true) |
void | enableCdataSectionHandler (bool fEnable=true) |
void | enableDefaultHandler (bool fEnable=true, bool fExpand=true) |
void | enableExternalEntityRefHandler (bool fEnable=true) |
void | enableUnknownEncodingHandler (bool fEnable=true) |
void | enableStartNamespaceDeclHandler (bool fEnable=true) |
void | enableEndNamespaceDeclHandler (bool fEnable=true) |
void | enableNamespaceDeclHandler (bool fEnable=true) |
void | enableXmlDeclHandler (bool fEnable=true) |
void | enableStartDoctypeDeclHandler (bool fEnable=true) |
void | enableEndDoctypeDeclHandler (bool fEnable=true) |
void | enableDoctypeDeclHandler (bool fEnable=true) |
enum XML_Error | getErrorCode () |
const XML_LChar * | getErrorString () |
long | getCurrentByteIndex () |
int | getCurrentLineNumber () const |
int | getCurrentColumnNumber () |
int | getCurrentByteCount () |
const char * | getInputContext (int *pnOffset, int *pnSize) |
void | onStartElement (const XML_Char *pszName, const XML_Char **papszAttrs) |
void | onEndElement (const XML_Char *pszName) |
void | onCharacterData (const XML_Char *pszData, int nLength) |
void | onProcessingInstruction (const XML_Char *pszTarget, const XML_Char *pszData) |
void | onComment (const XML_Char *pszData) |
void | onStartCdataSection () |
void | onEndCdataSection () |
void | onDefault (const XML_Char *pszData, int nLength) |
bool | onExternalEntityRef (const XML_Char *pszContext, const XML_Char *pszBase, const XML_Char *pszSystemID, const XML_Char *pszPublicID) |
bool | onUnknownEncoding (const XML_Char *pszName, XML_Encoding *pInfo) |
void | onStartNamespaceDecl (const XML_Char *pszPrefix, const XML_Char *pszURI) |
void | onEndNamespaceDecl (const XML_Char *pszPrefix) |
void | onXmlDecl (const XML_Char *pszVersion, const XML_Char *pszEncoding, bool fStandalone) |
void | onStartDoctypeDecl (const XML_Char *pszDoctypeName, const XML_Char *pszSysID, const XML_Char *pszPubID, bool fHasInternalSubset) |
void | onEndDoctypeDecl () |
const char * | getAttributeValue (const std::string &name, const char **attributes, const bool &required=true) const |
const char * | getAttributeValue (const std::string &name, const char **attributes, const char *def) const |
Static Public Member Functions | |
static const XML_LChar * | getErrorString (enum XML_Error nError) |
static const XML_LChar * | getExpatVersion () |
static void | getExpatVersion (int &nMajor, int &nMinor, int &nMicro) |
static bool | toBool (const char *attribute) |
Protected Member Functions | |
void | onPostCreate () |
Static Protected Member Functions | |
static void | startElementHandler (void *pUserData, const XML_Char *pszName, const XML_Char **papszAttrs) |
static void | endElementHandler (void *pUserData, const XML_Char *pszName) |
static void | characterDataHandler (void *pUserData, const XML_Char *pszData, int nLength) |
static void | processingInstructionHandler (void *pUserData, const XML_Char *pszTarget, const XML_Char *pszData) |
static void | commentHandler (void *pUserData, const XML_Char *pszData) |
static void | startCdataSectionHandler (void *pUserData) |
static void | endCdataSectionHandler (void *pUserData) |
static void | defaultHandler (void *pUserData, const XML_Char *pszData, int nLength) |
static int | externalEntityRefHandler (void *pUserData, const XML_Char *pszContext, const XML_Char *pszBase, const XML_Char *pszSystemID, const XML_Char *pszPublicID) |
static int | unknownEncodingHandler (void *pUserData, const XML_Char *pszName, XML_Encoding *pInfo) |
static void | startNamespaceDeclHandler (void *pUserData, const XML_Char *pszPrefix, const XML_Char *pszURI) |
static void | endNamespaceDeclHandler (void *pUserData, const XML_Char *pszPrefix) |
static void | xmlDeclHandler (void *pUserData, const XML_Char *pszVersion, const XML_Char *pszEncoding, int nStandalone) |
static void | startDoctypeDeclHandler (void *pUserData, const XML_Char *pszDoctypeName, const XML_Char *pszSysID, const XML_Char *pszPubID, int nHasInternalSubset) |
static void | endDoctypeDeclHandler (void *pUserData) |
Protected Attributes | |
XML_Parser | mParser |
This file describes the C++ interface to the expat library used by COPASI.
Created for Copasi by Stefan Hoops 2003 Copyright Stefan Hoops CExpatTemplate class. The class CExpatTemplate is a demplate defining a C++ interface to the expat library.
Created for Copasi by Stefan Hoops 2003
CExpatTemplate< CType >::CExpatTemplate | ( | ) | [inline] |
Default constructor
CExpatTemplate< CType >::~CExpatTemplate | ( | ) | [inline] |
Destructor
static void CExpatTemplate< CType >::characterDataHandler | ( | void * | pUserData, |
const XML_Char * | pszData, | ||
int | nLength | ||
) | [inline, static, protected] |
Character data handler wrapper
void | *pUserData |
const | XML_Char *pszData |
int | nLength |
static void CExpatTemplate< CType >::commentHandler | ( | void * | pUserData, |
const XML_Char * | pszData | ||
) | [inline, static, protected] |
Comment handler wrapper
void | *pUserData |
const | XML_Char *pszData |
bool CExpatTemplate< CType >::create | ( | const XML_Char * | pszEncoding = NULL , |
const XML_Char * | pszSep = NULL |
||
) | [inline] |
Create a parser
const | XML_Char *pszEncoding (Default = NULL) |
const | XML_Char *pszSep (Default = NULL) |
static void CExpatTemplate< CType >::defaultHandler | ( | void * | pUserData, |
const XML_Char * | pszData, | ||
int | nLength | ||
) | [inline, static, protected] |
Default wrapper
void | *pUserData |
const | XML_Char *pszData |
int | nLength |
void CExpatTemplate< CType >::destroy | ( | ) | [inline] |
Destroy the parser
void CExpatTemplate< CType >::enableCdataSectionHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the CDATA section handlers
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableCharacterDataHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the character data handler
bool | fEnable (Default: true) |
Reimplemented in CCopasiXMLParser.
void CExpatTemplate< CType >::enableCommentHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the comment handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableDefaultHandler | ( | bool | fEnable = true , |
bool | fExpand = true |
||
) | [inline] |
Enable/Disable default handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableDoctypeDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the DOCTYPE declaration handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableElementHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the element handlers
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableEndCdataSectionHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the end CDATA section handlers
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableEndDoctypeDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the end DOCTYPE declaration handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableEndElementHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable end element handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableEndNamespaceDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable end namespace handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableExternalEntityRefHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable external entity ref handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableNamespaceDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable namespace handlers
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableProcessingInstructionHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the processing instruction handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableStartCdataSectionHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the start CDATA section handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableStartDoctypeDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the start DOCTYPE declaration handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableStartElementHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the start element handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableStartNamespaceDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable start namespace handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableUnknownEncodingHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable unknown encoding handler
bool | fEnable (Default: true) |
void CExpatTemplate< CType >::enableXmlDeclHandler | ( | bool | fEnable = true | ) | [inline] |
Enable/Disable the XML declaration handler
bool | fEnable (Default: true) |
static void CExpatTemplate< CType >::endCdataSectionHandler | ( | void * | pUserData | ) | [inline, static, protected] |
End CDATA section wrapper
void | *pUserData |
static void CExpatTemplate< CType >::endDoctypeDeclHandler | ( | void * | pUserData | ) | [inline, static, protected] |
End Doctype declaration wrapper
void | *pUserData |
static void CExpatTemplate< CType >::endElementHandler | ( | void * | pUserData, |
const XML_Char * | pszName | ||
) | [inline, static, protected] |
End element handler wrapper
void | *pUserData |
const | XML_Char *pszName |
static void CExpatTemplate< CType >::endNamespaceDeclHandler | ( | void * | pUserData, |
const XML_Char * | pszPrefix | ||
) | [inline, static, protected] |
End namespace decl wrapper
void | *pUserData |
const | XML_Char *pszPrefix |
static int CExpatTemplate< CType >::externalEntityRefHandler | ( | void * | pUserData, |
const XML_Char * | pszContext, | ||
const XML_Char * | pszBase, | ||
const XML_Char * | pszSystemID, | ||
const XML_Char * | pszPublicID | ||
) | [inline, static, protected] |
External entity ref wrapper
void | *pUserData |
const | XML_Char *pszContext |
const | XML_Char *pszBase |
const | XML_Char *pszSystemID |
const | XML_Char *pszPublicID |
const char* CExpatTemplate< CType >::getAttributeValue | ( | const std::string & | name, |
const char ** | attributes, | ||
const bool & | required = true |
||
) | const [inline] |
Retreive the attribute value for the given name out of the list of attributes. If required is true and the attribute is not found an exception is thrown. If required is false and the attribute is not found NULL is returned.
const | std::string & name |
const | char ** attributes |
const | bool & required (default: true) |
const char* CExpatTemplate< CType >::getAttributeValue | ( | const std::string & | name, |
const char ** | attributes, | ||
const char * | def | ||
) | const [inline] |
Retreive the attribute value for the given name out of the list of attributes. If the attribute is not found default is returned.
const | std::string & name |
const | char ** attributes |
const | char * default |
void* CExpatTemplate< CType >::getBuffer | ( | int | nLength | ) | [inline] |
Get the internal buffer
int CExpatTemplate< CType >::getCurrentByteCount | ( | ) | [inline] |
Get the current byte count
long CExpatTemplate< CType >::getCurrentByteIndex | ( | ) | [inline] |
Get the current byte index
int CExpatTemplate< CType >::getCurrentColumnNumber | ( | ) | [inline] |
Get the current column number
int CExpatTemplate< CType >::getCurrentLineNumber | ( | ) | const [inline] |
Get the current line number
enum XML_Error CExpatTemplate< CType >::getErrorCode | ( | ) | [inline] |
Get last error
const XML_LChar* CExpatTemplate< CType >::getErrorString | ( | ) | [inline] |
Get last error string
static const XML_LChar* CExpatTemplate< CType >::getErrorString | ( | enum XML_Error | nError | ) | [inline, static] |
Get error string
enum | XML_Error nError |
static const XML_LChar* CExpatTemplate< CType >::getExpatVersion | ( | ) | [inline, static] |
Return the version string
static void CExpatTemplate< CType >::getExpatVersion | ( | int & | nMajor, |
int & | nMinor, | ||
int & | nMicro | ||
) | [inline, static] |
Get the version information
int | nMajor |
int | nMinor |
int | nMicro |
const char* CExpatTemplate< CType >::getInputContext | ( | int * | pnOffset, |
int * | pnSize | ||
) | [inline] |
Get the input context char * inputContext
void CExpatTemplate< CType >::onCharacterData | ( | const XML_Char * | pszData, |
int | nLength | ||
) | [inline] |
Character data handler
const | XML_Char *pszData |
int | nLength |
Reimplemented in CCopasiXMLParser, and CExpat.
void CExpatTemplate< CType >::onComment | ( | const XML_Char * | pszData | ) | [inline] |
void CExpatTemplate< CType >::onDefault | ( | const XML_Char * | pszData, |
int | nLength | ||
) | [inline] |
void CExpatTemplate< CType >::onEndCdataSection | ( | ) | [inline] |
End CDATA section handler
Reimplemented in CExpat.
void CExpatTemplate< CType >::onEndDoctypeDecl | ( | ) | [inline] |
End DOCTYPE declaration handler
Reimplemented in CExpat.
void CExpatTemplate< CType >::onEndElement | ( | const XML_Char * | pszName | ) | [inline] |
End element handler
const | XML_Char *pszName |
Reimplemented in CCopasiXMLParser, and CExpat.
void CExpatTemplate< CType >::onEndNamespaceDecl | ( | const XML_Char * | pszPrefix | ) | [inline] |
bool CExpatTemplate< CType >::onExternalEntityRef | ( | const XML_Char * | pszContext, |
const XML_Char * | pszBase, | ||
const XML_Char * | pszSystemID, | ||
const XML_Char * | pszPublicID | ||
) | [inline] |
External entity ref handler
const | XML_Char *pszContext |
const | XML_Char *pszBase |
const | XML_Char *pszSystemID |
const | XML_Char *pszPublicID |
Reimplemented in CExpat.
void CExpatTemplate< CType >::onPostCreate | ( | ) | [inline, protected] |
Handle any post creation
void CExpatTemplate< CType >::onProcessingInstruction | ( | const XML_Char * | pszTarget, |
const XML_Char * | pszData | ||
) | [inline] |
Processing instruction handler
const | XML_Char *pszTarget |
const | XML_Char *pszData |
Reimplemented in CExpat.
void CExpatTemplate< CType >::onStartCdataSection | ( | ) | [inline] |
Start CDATA section handler
Reimplemented in CExpat.
void CExpatTemplate< CType >::onStartDoctypeDecl | ( | const XML_Char * | pszDoctypeName, |
const XML_Char * | pszSysID, | ||
const XML_Char * | pszPubID, | ||
bool | fHasInternalSubset | ||
) | [inline] |
Start DOCTYPE declaration handler
const | XML_Char *pszDoctypeName |
const | XML_Char *pszSysID |
const | XML_Char *pszPubID |
bool | fHasInternalSubset |
Reimplemented in CExpat.
void CExpatTemplate< CType >::onStartElement | ( | const XML_Char * | pszName, |
const XML_Char ** | papszAttrs | ||
) | [inline] |
Start element handler
const | XML_Char *pszName |
const | XML_Char **papszAttrs |
Reimplemented in CCopasiXMLParser, and CExpat.
void CExpatTemplate< CType >::onStartNamespaceDecl | ( | const XML_Char * | pszPrefix, |
const XML_Char * | pszURI | ||
) | [inline] |
Start namespace declaration handler
const | XML_Char *pszPrefix |
const | XML_Char *pszURI |
Reimplemented in CExpat.
bool CExpatTemplate< CType >::onUnknownEncoding | ( | const XML_Char * | pszName, |
XML_Encoding * | pInfo | ||
) | [inline] |
Unknown encoding handler
const | XML_Char *pszName |
XML_Encoding | *pInfo |
Reimplemented in CExpat.
void CExpatTemplate< CType >::onXmlDecl | ( | const XML_Char * | pszVersion, |
const XML_Char * | pszEncoding, | ||
bool | fStandalone | ||
) | [inline] |
XML declaration handler
const | XML_Char *pszVersion |
const | XML_Char *pszEncoding |
bool | fStandalone |
Reimplemented in CExpat.
bool CExpatTemplate< CType >::parse | ( | const char * | pszBuffer, |
int | nLength = -1 , |
||
bool | fIsFinal = true |
||
) | [inline] |
Parse a block of character data
const | char *pszBuffer |
int | nLength (Default: -1 (zero terminated)) |
bool | fIsFinal (Default: true) |
bool CExpatTemplate< CType >::parseBuffer | ( | int | nLength, |
bool | fIsFinal = true |
||
) | [inline] |
Parse internal buffer
int | nLength |
bool | fIsFinal (Default: true) |
static void CExpatTemplate< CType >::processingInstructionHandler | ( | void * | pUserData, |
const XML_Char * | pszTarget, | ||
const XML_Char * | pszData | ||
) | [inline, static, protected] |
Processing instruction handler wrapper
void | *pUserData |
const | XML_Char *pszTarget |
const | XML_Char *pszData |
static void CExpatTemplate< CType >::startCdataSectionHandler | ( | void * | pUserData | ) | [inline, static, protected] |
Start CDATA section wrapper
void | *pUserData |
static void CExpatTemplate< CType >::startDoctypeDeclHandler | ( | void * | pUserData, |
const XML_Char * | pszDoctypeName, | ||
const XML_Char * | pszSysID, | ||
const XML_Char * | pszPubID, | ||
int | nHasInternalSubset | ||
) | [inline, static, protected] |
Start Doctype declaration wrapper
void | *pUserData |
const | XML_Char *pszDoctypeName |
const | XML_Char *pszSysID |
const | XML_Char *pszPubID |
int | nHasInternalSubset |
static void CExpatTemplate< CType >::startElementHandler | ( | void * | pUserData, |
const XML_Char * | pszName, | ||
const XML_Char ** | papszAttrs | ||
) | [inline, static, protected] |
Start element handler wrapper
void | *pUserData |
const | XML_Char *pszName |
const | XML_Char **papszAttrs |
static void CExpatTemplate< CType >::startNamespaceDeclHandler | ( | void * | pUserData, |
const XML_Char * | pszPrefix, | ||
const XML_Char * | pszURI | ||
) | [inline, static, protected] |
Start namespace decl wrapper
void | *pUserData |
const | XML_Char *pszPrefix |
const | XML_Char *pszURI |
static bool CExpatTemplate< CType >::toBool | ( | const char * | attribute | ) | [inline, static] |
Convert an attribute of type xs:boolean to bool. If attribute is NULL false is returned.
const | char * attribute |
static int CExpatTemplate< CType >::unknownEncodingHandler | ( | void * | pUserData, |
const XML_Char * | pszName, | ||
XML_Encoding * | pInfo | ||
) | [inline, static, protected] |
Unknown encoding wrapper
void | *pUserData |
const | XML_Char *pszName |
XML_Encoding | *pInfo |
static void CExpatTemplate< CType >::xmlDeclHandler | ( | void * | pUserData, |
const XML_Char * | pszVersion, | ||
const XML_Char * | pszEncoding, | ||
int | nStandalone | ||
) | [inline, static, protected] |
XML declaration wrapper
void | *pUserData |
const | XML_Char *pszVersion |
const | XML_Char *pszEncoding |
int | nStandalone |
XML_Parser CExpatTemplate< CType >::mParser [protected] |
The expat parser