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

#include <cXml.h>

Public Types

enum  E_TYPE {
  E_AMP = 0 , E_LT , E_GT , E_QUOT ,
  E_APOS , E_QTY = 5
}
 

Static Public Member Functions

static const cXmlEntity *GRAYCALL FindEntityName (const char *pszName)
 
static const cXmlEntity *GRAYCALL FindEntityChar (wchar_t ch)
 
static cXmlString GRAYCALL EncodeString (const cXmlString &sInp, cXmlString sPrefix="")
 
static const char *GRAYCALL DecodeEntity (const char *pszData, OUT char *pszOutputValue, OUT StrLen_t *piOutputLength, CXML_ENCODING_TYPE eEncoding=CXML_ENCODING_UNKNOWN)
 

Public Attributes

const char * m_pszName
 raw string for the entity. e.g. "&amp;" More...
 
StrLen_t m_nLenName
 length of m_pszName including ; More...
 
wchar_t m_chValue
 The result UNICODE char this entity will produce. More...
 

Static Public Attributes

static const cXmlEntity k_Entity [E_QTY]
 The predefined XML entities. More...
 

Detailed Description

Member Enumeration Documentation

◆ E_TYPE

predefined XML entities.

Enumerator
E_AMP 

'&' = "&amp;"

E_LT 

'<' = "&lt;"

E_GT 

'>'

E_QUOT 

'"'

E_APOS 

'\''

E_QTY 

Member Function Documentation

◆ DecodeEntity()

const char * GrayLib::cXmlEntity::DecodeEntity ( const char *  pszData,
OUT char *  pszOutputValue,
OUT StrLen_t piOutputLength,
CXML_ENCODING_TYPE  eEncoding = CXML_ENCODING_UNKNOWN 
)
static

If an entity has been found, transform it into a character. Presume an entity, and pull it out. Opposite of cXml::EncodeString ASSUME pszOutputValue can hold the UTF8 char output.

Returns
next pszInputData after parse. nullptr = its not an encoded char i recognize.

◆ EncodeString()

cXmlString GrayLib::cXmlEntity::EncodeString ( const cXmlString sInp,
cXmlString  sPrefix = "" 
)
static

Encode XML string. Expands entities in a string. Note this should not contain the tag's '<', '>', etc, or they will be transformed into entities! Opposite of cXmlEntity::DecodeEntity

Todo:
Allow "&#nnnn;" decimal format encode ?

◆ FindEntityChar()

const cXmlEntity * GrayLib::cXmlEntity::FindEntityChar ( wchar_t  ch)
static

◆ FindEntityName()

const cXmlEntity * GrayLib::cXmlEntity::FindEntityName ( const char *  pszName)
static

Member Data Documentation

◆ k_Entity

const cXmlEntity GrayLib::cXmlEntity::k_Entity
static
Initial value:
=
{
{ "&amp;", 5, '&' },
{ "&lt;", 4, '<' },
{ "&gt;", 4, '>' },
{ "&quot;", 6, '\"' },
{ "&apos;", 6, '\'' }
}

The predefined XML entities.

◆ m_chValue

wchar_t GrayLib::cXmlEntity::m_chValue

The result UNICODE char this entity will produce.

◆ m_nLenName

StrLen_t GrayLib::cXmlEntity::m_nLenName

length of m_pszName including ;

◆ m_pszName

const char* GrayLib::cXmlEntity::m_pszName

raw string for the entity. e.g. "&amp;"


The documentation for this struct was generated from the following files: