Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cXmlReadVisitor Class Reference

#include <cXmlReader.h>

Inheritance diagram for GrayLib::cXmlReadVisitor:
GrayLib::cXml

Public Member Functions

 cXmlReadVisitor () noexcept
 
virtual ~cXmlReadVisitor ()
 
virtual HRESULT onElementStart (cXmlReader &rReader, const cXmlString &sElement, cXmlAttributeSet &Attribs, bool bEnd)
 
virtual HRESULT onText (cXmlReader &rReader, XMLNODE_TYPE eType, const cXmlString &sValue, bool bCDATA)
 
virtual HRESULT onElementEnd (cXmlReader &rReader, const cXmlString &sElement)
 

Additional Inherited Members

- Public Types inherited from GrayLib::cXml
enum  XMLNODE_TYPE { XMLNODE_QTY }
 
- Static Public Member Functions inherited from GrayLib::cXml
static StrLen_t GRAYCALL ParseMicrosoftBOM (const BYTE *pszData)
 
static bool GRAYCALL IsXML (const IniChar_t *pszStr, StrLen_t iLenMax=StrT::k_LEN_MAX)
 
static cXmlString GRAYCALL GetAttributeStr (const IniChar_t *pszName, const cXmlString &sValue)
 
static void AddPathElement (cXmlString &sPath, const cXmlString &sElement)
 
static void RemovePathElement (cXmlString &sPath, const cXmlString &sElement)
 
- Static Public Attributes inherited from GrayLib::cXml
static const char k_xmlHeader [6] = "<?xml"
 "<?xml" // not case sensitive ! More...
 
static const char k_xmlEnd [3] = "?>"
 "?>" More...
 
static const char k_commentHeader [5] = "<!--"
 "<!--" // comments are not reentrant! More...
 
static const char k_commentEnd [4] = "-->"
 "-->" More...
 
static const char k_cdataHeader [10] = "<![CDATA["
 "<![CDATA[" More...
 
static const char k_cdataEnd [4] = "]]>"
 "]]>" More...
 
static const char k_dtdHeader [3] = "<!"
 "<!" More...
 

Detailed Description

eXPat like generic XML loading. Similar to .Net XmlReader. Allow this to run without cXmlDocument or intermixed with cXmlElement loading.

Constructor & Destructor Documentation

◆ cXmlReadVisitor()

GrayLib::cXmlReadVisitor::cXmlReadVisitor ( )
inlinenoexcept

◆ ~cXmlReadVisitor()

virtual GrayLib::cXmlReadVisitor::~cXmlReadVisitor ( )
inlinevirtual

Member Function Documentation

◆ onElementEnd()

virtual HRESULT GrayLib::cXmlReadVisitor::onElementEnd ( cXmlReader rReader,
const cXmlString sElement 
)
inlinevirtual

This sElement is "</closed>".

◆ onElementStart()

virtual HRESULT GrayLib::cXmlReadVisitor::onElementStart ( cXmlReader rReader,
const cXmlString sElement,
cXmlAttributeSet Attribs,
bool  bEnd 
)
inlinevirtual

Define my child sElement. Can make Parse() calls to another cXmlReadVisitor for type specific handlers.

  • bEnd = this tag has no value body. It is "<closed/>" or "<?XML?>". onElementEnd will not be called.
    Returns
    S_FALSE = body has been processed (if it had one). S_OK = default process (descend element).

◆ onText()

virtual HRESULT GrayLib::cXmlReadVisitor::onText ( cXmlReader rReader,
XMLNODE_TYPE  eType,
const cXmlString sValue,
bool  bCDATA 
)
inlinevirtual

block of characters for current element. can be called multiple times inside 1 onElementStart/onElementEnd pair.

  • eType = XMLNODE_Comment = can just be ignored.
  • eType = XMLNODE_Unknown = a block in format "<unknown>"

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