Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
CExpatImpl< _T > Class Template Reference

#include <XMLParser.h>

Public Member Functions

 CExpatImpl ()
 
bool Create (const XML_Char *pszEncoding=nullptr, const XML_Char *pszSep=nullptr)
 
void Destroy (void)
 
void * GetBuffer (int nLength)
 
int GetCurrentByteCount ()
 
long GetCurrentByteIndex ()
 
int GetCurrentColumnNumber ()
 
int GetCurrentLineNumber ()
 
enum XML_Error GetErrorCode ()
 
const XML_LChar * GetErrorString ()
 
const char * GetInputContext (int *pnOffset, int *pnSize)
 
void OnCharacterData (const XML_Char *pszData, int nLength)
 
void OnComment (const XML_Char *pszData)
 
void OnDefault (const XML_Char *pszData, int nLength)
 
void OnEndCdataSection ()
 
void OnEndDoctypeDecl ()
 
void OnEndElement (const XML_Char *pszName)
 
void OnEndNamespaceDecl (const XML_Char *pszPrefix)
 
bool OnExternalEntityRef (const XML_Char *pszContext, const XML_Char *pszBase, const XML_Char *pszSystemID, const XML_Char *pszPublicID)
 
void OnProcessingInstruction (const XML_Char *pszTarget, const XML_Char *pszData)
 
void OnStartCdataSection ()
 
void OnStartDoctypeDecl (const XML_Char *pszDoctypeName, const XML_Char *pszSysID, const XML_Char *pszPubID, bool fHasInternalSubset)
 
void OnStartElement (const XML_Char *pszName, const XML_Char **papszAttrs)
 
void OnStartNamespaceDecl (const XML_Char *pszPrefix, const XML_Char *pszURI)
 
bool OnUnknownEncoding (const XML_Char *pszName, XML_Encoding *pInfo)
 
void OnXmlDecl (const XML_Char *pszVersion, const XML_Char *pszEncoding, bool fStandalone)
 
bool Parse (const char *pszBuffer, int nLength, bool fIsFinal=true)
 
bool ParseBuffer (int nLength, bool fIsFinal=true)
 
 ~CExpatImpl ()
 

Static Public Member Functions

static const XML_LChar * GetErrorString (enum XML_Error nError)
 
static const XML_LChar * GetExpatVersion ()
 
static void GetExpatVersion (int *pnMajor, int *pnMinor, int *pnMicro)
 

Protected Member Functions

void EnableCdataSectionHandler (bool fEnable=true)
 
void EnableCharacterDataHandler (bool fEnable=true)
 
void EnableCommentHandler (bool fEnable=true)
 
void EnableDefaultHandler (bool fEnable=true, bool fExpand=true)
 
void EnableDoctypeDeclHandler (bool fEnable=true)
 
void EnableElementHandler (bool fEnable=true)
 
void EnableEndCdataSectionHandler (bool fEnable=true)
 
void EnableEndDoctypeDeclHandler (bool fEnable=true)
 
void EnableEndElementHandler (bool fEnable=true)
 
void EnableEndNamespaceDeclHandler (bool fEnable=true)
 
void EnableExternalEntityRefHandler (bool fEnable=true)
 
void EnableNamespaceDeclHandler (bool fEnable=true)
 
void EnableProcessingInstructionHandler (bool fEnable=true)
 
void EnableStartCdataSectionHandler (bool fEnable=true)
 
void EnableStartDoctypeDeclHandler (bool fEnable=true)
 
void EnableStartElementHandler (bool fEnable=true)
 
void EnableStartNamespaceDeclHandler (bool fEnable=true)
 
void EnableUnknownEncodingHandler (bool fEnable=true)
 
void EnableXmlDeclHandler (bool fEnable=true)
 
void OnPostCreate ()
 

Static Protected Member Functions

static void __cdecl CharacterDataHandler (void *pUserData, const XML_Char *pszData, int nLength)
 
static void __cdecl CommentHandler (void *pUserData, const XML_Char *pszData)
 
static void __cdecl DefaultHandler (void *pUserData, const XML_Char *pszData, int nLength)
 
static void __cdecl EndCdataSectionHandler (void *pUserData)
 
static void __cdecl EndDoctypeDeclHandler (void *pUserData)
 
static void __cdecl EndElementHandler (void *pUserData, const XML_Char *pszName)
 
static void __cdecl EndNamespaceDeclHandler (void *pUserData, const XML_Char *pszPrefix)
 
static int __cdecl ExternalEntityRefHandler (void *pUserData, const XML_Char *pszContext, const XML_Char *pszBase, const XML_Char *pszSystemID, const XML_Char *pszPublicID)
 
static const XML_Char * FindAttr (const XML_Char **iAttrs, const XML_Char *iAttrToFind)
 Returns the value of the specified attribute, if found; nullptr otherwise. More...
 
static void __cdecl ProcessingInstructionHandler (void *pUserData, const XML_Char *pszTarget, const XML_Char *pszData)
 
static void __cdecl StartCdataSectionHandler (void *pUserData)
 
static void __cdecl StartDoctypeDeclHandler (void *pUserData, const XML_Char *pszDoctypeName, const XML_Char *pszSysID, const XML_Char *pszPubID, int nHasInternalSubset)
 
static void __cdecl StartElementHandler (void *pUserData, const XML_Char *pszName, const XML_Char **papszAttrs)
 
static void __cdecl StartNamespaceDeclHandler (void *pUserData, const XML_Char *pszPrefix, const XML_Char *pszURI)
 
static int __cdecl UnknownEncodingHandler (void *pUserData, const XML_Char *pszName, XML_Encoding *pInfo)
 
static void __cdecl XmlDeclHandler (void *pUserData, const XML_Char *pszVersion, const XML_Char *pszEncoding, int nStandalone)
 

Protected Attributes

XML_Parser m_p
 

Detailed Description

template<class _T>
class CExpatImpl< _T >

Definition at line 77 of file XMLParser.h.

Constructor & Destructor Documentation

◆ CExpatImpl()

template<class _T >
CExpatImpl< _T >::CExpatImpl ( )
inline

Definition at line 85 of file XMLParser.h.

◆ ~CExpatImpl()

template<class _T >
CExpatImpl< _T >::~CExpatImpl ( )
inline

Definition at line 92 of file XMLParser.h.

Member Function Documentation

◆ CharacterDataHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::CharacterDataHandler ( void *  pUserData,
const XML_Char *  pszData,
int  nLength 
)
inlinestaticprotected

Definition at line 575 of file XMLParser.h.

◆ CommentHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::CommentHandler ( void *  pUserData,
const XML_Char *  pszData 
)
inlinestaticprotected

Definition at line 593 of file XMLParser.h.

◆ Create()

template<class _T >
bool CExpatImpl< _T >::Create ( const XML_Char *  pszEncoding = nullptr,
const XML_Char *  pszSep = nullptr 
)
inline

Definition at line 102 of file XMLParser.h.

◆ DefaultHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::DefaultHandler ( void *  pUserData,
const XML_Char *  pszData,
int  nLength 
)
inlinestaticprotected

Definition at line 618 of file XMLParser.h.

◆ Destroy()

template<class _T >
void CExpatImpl< _T >::Destroy ( void  )
inline

Definition at line 135 of file XMLParser.h.

◆ EnableCdataSectionHandler()

template<class _T >
void CExpatImpl< _T >::EnableCdataSectionHandler ( bool  fEnable = true)
inlineprotected

Definition at line 240 of file XMLParser.h.

◆ EnableCharacterDataHandler()

template<class _T >
void CExpatImpl< _T >::EnableCharacterDataHandler ( bool  fEnable = true)
inlineprotected

Definition at line 200 of file XMLParser.h.

◆ EnableCommentHandler()

template<class _T >
void CExpatImpl< _T >::EnableCommentHandler ( bool  fEnable = true)
inlineprotected

Definition at line 216 of file XMLParser.h.

◆ EnableDefaultHandler()

template<class _T >
void CExpatImpl< _T >::EnableDefaultHandler ( bool  fEnable = true,
bool  fExpand = true 
)
inlineprotected

Definition at line 249 of file XMLParser.h.

◆ EnableDoctypeDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableDoctypeDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 329 of file XMLParser.h.

◆ EnableElementHandler()

template<class _T >
void CExpatImpl< _T >::EnableElementHandler ( bool  fEnable = true)
inlineprotected

Definition at line 191 of file XMLParser.h.

◆ EnableEndCdataSectionHandler()

template<class _T >
void CExpatImpl< _T >::EnableEndCdataSectionHandler ( bool  fEnable = true)
inlineprotected

Definition at line 232 of file XMLParser.h.

◆ EnableEndDoctypeDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableEndDoctypeDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 320 of file XMLParser.h.

◆ EnableEndElementHandler()

template<class _T >
void CExpatImpl< _T >::EnableEndElementHandler ( bool  fEnable = true)
inlineprotected

Definition at line 183 of file XMLParser.h.

◆ EnableEndNamespaceDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableEndNamespaceDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 288 of file XMLParser.h.

◆ EnableExternalEntityRefHandler()

template<class _T >
void CExpatImpl< _T >::EnableExternalEntityRefHandler ( bool  fEnable = true)
inlineprotected

Definition at line 264 of file XMLParser.h.

◆ EnableNamespaceDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableNamespaceDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 296 of file XMLParser.h.

◆ EnableProcessingInstructionHandler()

template<class _T >
void CExpatImpl< _T >::EnableProcessingInstructionHandler ( bool  fEnable = true)
inlineprotected

Definition at line 208 of file XMLParser.h.

◆ EnableStartCdataSectionHandler()

template<class _T >
void CExpatImpl< _T >::EnableStartCdataSectionHandler ( bool  fEnable = true)
inlineprotected

Definition at line 224 of file XMLParser.h.

◆ EnableStartDoctypeDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableStartDoctypeDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 312 of file XMLParser.h.

◆ EnableStartElementHandler()

template<class _T >
void CExpatImpl< _T >::EnableStartElementHandler ( bool  fEnable = true)
inlineprotected

Definition at line 175 of file XMLParser.h.

◆ EnableStartNamespaceDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableStartNamespaceDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 280 of file XMLParser.h.

◆ EnableUnknownEncodingHandler()

template<class _T >
void CExpatImpl< _T >::EnableUnknownEncodingHandler ( bool  fEnable = true)
inlineprotected

Definition at line 272 of file XMLParser.h.

◆ EnableXmlDeclHandler()

template<class _T >
void CExpatImpl< _T >::EnableXmlDeclHandler ( bool  fEnable = true)
inlineprotected

Definition at line 304 of file XMLParser.h.

◆ EndCdataSectionHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::EndCdataSectionHandler ( void *  pUserData)
inlinestaticprotected

Definition at line 610 of file XMLParser.h.

◆ EndDoctypeDeclHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::EndDoctypeDeclHandler ( void *  pUserData)
inlinestaticprotected

Definition at line 682 of file XMLParser.h.

◆ EndElementHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::EndElementHandler ( void *  pUserData,
const XML_Char *  pszName 
)
inlinestaticprotected

Definition at line 566 of file XMLParser.h.

◆ EndNamespaceDeclHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::EndNamespaceDeclHandler ( void *  pUserData,
const XML_Char *  pszPrefix 
)
inlinestaticprotected

Definition at line 654 of file XMLParser.h.

◆ ExternalEntityRefHandler()

template<class _T >
static int __cdecl CExpatImpl< _T >::ExternalEntityRefHandler ( void *  pUserData,
const XML_Char *  pszContext,
const XML_Char *  pszBase,
const XML_Char *  pszSystemID,
const XML_Char *  pszPublicID 
)
inlinestaticprotected

Definition at line 627 of file XMLParser.h.

◆ FindAttr()

template<class _T >
static const XML_Char* CExpatImpl< _T >::FindAttr ( const XML_Char **  iAttrs,
const XML_Char *  iAttrToFind 
)
inlinestaticprotected

Returns the value of the specified attribute, if found; nullptr otherwise.

Definition at line 694 of file XMLParser.h.

◆ GetBuffer()

template<class _T >
void* CExpatImpl< _T >::GetBuffer ( int  nLength)
inline

Definition at line 163 of file XMLParser.h.

◆ GetCurrentByteCount()

template<class _T >
int CExpatImpl< _T >::GetCurrentByteCount ( )
inline

Definition at line 373 of file XMLParser.h.

◆ GetCurrentByteIndex()

template<class _T >
long CExpatImpl< _T >::GetCurrentByteIndex ( )
inline

Definition at line 349 of file XMLParser.h.

◆ GetCurrentColumnNumber()

template<class _T >
int CExpatImpl< _T >::GetCurrentColumnNumber ( )
inline

Definition at line 365 of file XMLParser.h.

◆ GetCurrentLineNumber()

template<class _T >
int CExpatImpl< _T >::GetCurrentLineNumber ( )
inline

Definition at line 357 of file XMLParser.h.

◆ GetErrorCode()

template<class _T >
enum XML_Error CExpatImpl< _T >::GetErrorCode ( )
inline

Definition at line 329 of file XMLParser.h.

◆ GetErrorString() [1/2]

template<class _T >
const XML_LChar* CExpatImpl< _T >::GetErrorString ( )
inline

Definition at line 389 of file XMLParser.h.

◆ GetErrorString() [2/2]

template<class _T >
static const XML_LChar* CExpatImpl< _T >::GetErrorString ( enum XML_Error  nError)
inlinestatic

Definition at line 422 of file XMLParser.h.

◆ GetExpatVersion() [1/2]

template<class _T >
static const XML_LChar* CExpatImpl< _T >::GetExpatVersion ( )
inlinestatic

Definition at line 396 of file XMLParser.h.

◆ GetExpatVersion() [2/2]

template<class _T >
static void CExpatImpl< _T >::GetExpatVersion ( int *  pnMajor,
int *  pnMinor,
int *  pnMicro 
)
inlinestatic

Definition at line 403 of file XMLParser.h.

◆ GetInputContext()

template<class _T >
const char* CExpatImpl< _T >::GetInputContext ( int *  pnOffset,
int *  pnSize 
)
inline

Definition at line 381 of file XMLParser.h.

◆ OnCharacterData()

template<class _T >
void CExpatImpl< _T >::OnCharacterData ( const XML_Char *  pszData,
int  nLength 
)
inline

Definition at line 447 of file XMLParser.h.

◆ OnComment()

template<class _T >
void CExpatImpl< _T >::OnComment ( const XML_Char *  pszData)
inline

Definition at line 462 of file XMLParser.h.

◆ OnDefault()

template<class _T >
void CExpatImpl< _T >::OnDefault ( const XML_Char *  pszData,
int  nLength 
)
inline

Definition at line 483 of file XMLParser.h.

◆ OnEndCdataSection()

template<class _T >
void CExpatImpl< _T >::OnEndCdataSection ( )
inline

Definition at line 476 of file XMLParser.h.

◆ OnEndDoctypeDecl()

template<class _T >
void CExpatImpl< _T >::OnEndDoctypeDecl ( )
inline

Definition at line 538 of file XMLParser.h.

◆ OnEndElement()

template<class _T >
void CExpatImpl< _T >::OnEndElement ( const XML_Char *  pszName)
inline

Definition at line 440 of file XMLParser.h.

◆ OnEndNamespaceDecl()

template<class _T >
void CExpatImpl< _T >::OnEndNamespaceDecl ( const XML_Char *  pszPrefix)
inline

Definition at line 514 of file XMLParser.h.

◆ OnExternalEntityRef()

template<class _T >
bool CExpatImpl< _T >::OnExternalEntityRef ( const XML_Char *  pszContext,
const XML_Char *  pszBase,
const XML_Char *  pszSystemID,
const XML_Char *  pszPublicID 
)
inline

Definition at line 490 of file XMLParser.h.

◆ OnPostCreate()

template<class _T >
void CExpatImpl< _T >::OnPostCreate ( )
inlineprotected

Definition at line 548 of file XMLParser.h.

◆ OnProcessingInstruction()

template<class _T >
void CExpatImpl< _T >::OnProcessingInstruction ( const XML_Char *  pszTarget,
const XML_Char *  pszData 
)
inline

Definition at line 454 of file XMLParser.h.

◆ OnStartCdataSection()

template<class _T >
void CExpatImpl< _T >::OnStartCdataSection ( )
inline

Definition at line 469 of file XMLParser.h.

◆ OnStartDoctypeDecl()

template<class _T >
void CExpatImpl< _T >::OnStartDoctypeDecl ( const XML_Char *  pszDoctypeName,
const XML_Char *  pszSysID,
const XML_Char *  pszPubID,
bool  fHasInternalSubset 
)
inline

Definition at line 529 of file XMLParser.h.

◆ OnStartElement()

template<class _T >
void CExpatImpl< _T >::OnStartElement ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
inline

Definition at line 433 of file XMLParser.h.

◆ OnStartNamespaceDecl()

template<class _T >
void CExpatImpl< _T >::OnStartNamespaceDecl ( const XML_Char *  pszPrefix,
const XML_Char *  pszURI 
)
inline

Definition at line 506 of file XMLParser.h.

◆ OnUnknownEncoding()

template<class _T >
bool CExpatImpl< _T >::OnUnknownEncoding ( const XML_Char *  pszName,
XML_Encoding *  pInfo 
)
inline

Definition at line 499 of file XMLParser.h.

◆ OnXmlDecl()

template<class _T >
void CExpatImpl< _T >::OnXmlDecl ( const XML_Char *  pszVersion,
const XML_Char *  pszEncoding,
bool  fStandalone 
)
inline

Definition at line 521 of file XMLParser.h.

◆ Parse()

template<class _T >
bool CExpatImpl< _T >::Parse ( const char *  pszBuffer,
int  nLength,
bool  fIsFinal = true 
)
inline

Definition at line 147 of file XMLParser.h.

◆ ParseBuffer()

template<class _T >
bool CExpatImpl< _T >::ParseBuffer ( int  nLength,
bool  fIsFinal = true 
)
inline

Definition at line 155 of file XMLParser.h.

◆ ProcessingInstructionHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::ProcessingInstructionHandler ( void *  pUserData,
const XML_Char *  pszTarget,
const XML_Char *  pszData 
)
inlinestaticprotected

Definition at line 584 of file XMLParser.h.

◆ StartCdataSectionHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::StartCdataSectionHandler ( void *  pUserData)
inlinestaticprotected

Definition at line 602 of file XMLParser.h.

◆ StartDoctypeDeclHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::StartDoctypeDeclHandler ( void *  pUserData,
const XML_Char *  pszDoctypeName,
const XML_Char *  pszSysID,
const XML_Char *  pszPubID,
int  nHasInternalSubset 
)
inlinestaticprotected

Definition at line 670 of file XMLParser.h.

◆ StartElementHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::StartElementHandler ( void *  pUserData,
const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
inlinestaticprotected

Definition at line 557 of file XMLParser.h.

◆ StartNamespaceDeclHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::StartNamespaceDeclHandler ( void *  pUserData,
const XML_Char *  pszPrefix,
const XML_Char *  pszURI 
)
inlinestaticprotected

Definition at line 646 of file XMLParser.h.

◆ UnknownEncodingHandler()

template<class _T >
static int __cdecl CExpatImpl< _T >::UnknownEncodingHandler ( void *  pUserData,
const XML_Char *  pszName,
XML_Encoding *  pInfo 
)
inlinestaticprotected

Definition at line 638 of file XMLParser.h.

◆ XmlDeclHandler()

template<class _T >
static void __cdecl CExpatImpl< _T >::XmlDeclHandler ( void *  pUserData,
const XML_Char *  pszVersion,
const XML_Char *  pszEncoding,
int  nStandalone 
)
inlinestaticprotected

Definition at line 662 of file XMLParser.h.

Member Data Documentation

◆ m_p

template<class _T >
XML_Parser CExpatImpl< _T >::m_p
protected

Definition at line 691 of file XMLParser.h.


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