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

#include <cXmlDocument.h>

Inheritance diagram for GrayLib::cXmlDeclaration:
GrayLib::cXmlNode Gray::cListNodeT< cXmlNode > GrayLib::cXml Gray::cNonCopyable Gray::cListNodeBase Gray::cHeapObject Gray::IHeapObject

Public Member Functions

 cXmlDeclaration (cXmlString sVersion="1.0", cXmlString sEncoding="", cXmlString sStandalone="")
 Construct an empty declaration. More...
 
 cXmlDeclaration (const cXmlDeclaration &rCopy)
 
void operator= (const cXmlDeclaration &rCopy)
 
virtual ~cXmlDeclaration ()
 
const cXmlStringget_Version () const
 
const cXmlStringget_Encoding () const
 
const cXmlStringget_Standalone () const
 
CXML_ENCODING_TYPE get_EncodingEnum () const
 
virtual cXmlNodeClone () const
 Creates a copy of this Declaration and returns it. More...
 
virtual HRESULT SetParseNode (cXmlReader &rReader)
 
cXmlString get_PrintStr () const
 Print this declaration to a cStreamOutput stream. More...
 
virtual HRESULT Print (cStreamOutput &rOut, int nDepth=0) const
 
virtual bool OnVisit (IXmlVisitor *visitor) const
 Walk the XML tree visiting this node and all of its children. More...
 
virtual cXmlDeclarationToDeclaration ()
 
virtual const cXmlDeclarationToDeclaration () const
 
- Public Member Functions inherited from GrayLib::cXmlNode
virtual ~cXmlNode ()
 
XMLNODE_TYPE get_Type () const
 
bool isType (XMLNODE_TYPE eType) const
 
void put_UserData (void *pUserData)
 
void * get_UserData () const
 
void put_Value (cXmlString sValue)
 
const cXmlStringget_Value () const
 
HRESULT QueryValueInt (int *piValue) const
 
HRESULT QueryValueDouble (double *pdValue) const
 QueryValueDouble examines the value string. See QueryValueInt(). More...
 
int get_ValueInt () const
 Return the value of this attribute, converted to an integer. More...
 
double get_ValueDouble () const
 Return the value of this attribute, converted to a double. More...
 
void put_ValueInt (int iValue)
 Set the value from an integer. More...
 
void put_ValueDouble (double dValue)
 Set the value from a double. More...
 
cXmlDocumentget_Document () const
 
cXmlNodeGetPreviousSibling (const char *pszValue) const
 Navigate to a sibling node. More...
 
cXmlNodeGetNextSiblingX (const char *pszValue) const
 Navigate to a sibling node with the given 'value'. More...
 
cXmlElementget_NextSiblingElement () const
 
cXmlElementGetNextSiblingElement (const char *pszValue) const
 
virtual cXmlContainerToContainer ()
 
HRESULT SetParse (const char *pszData, CXML_ENCODING_TYPE eEncoding=CXML_ENCODING_UNKNOWN)
 
ITERATE_t get_Row () const
 
StrLen_t get_Column () const
 
- Public Member Functions inherited from Gray::cListNodeT< cXmlNode >
cXmlNode * get_Next () const
 
cXmlNode * get_Prev () const
 
- Public Member Functions inherited from Gray::cListNodeBase
virtual ~cListNodeBase ()
 
cListBaseget_Parent () const noexcept
 
cListNodeBaseget_Next () const noexcept
 
cListNodeBaseget_Prev () const noexcept
 
bool hasParent () const noexcept
 
void RemoveFromParent ()
 
virtual HRESULT DisposeThis ()
 
- Public Member Functions inherited from Gray::cHeapObject
 cHeapObject ()
 
virtual ~cHeapObject ()
 
bool IsValidInsideN (INT_PTR index) const
 
bool IsValidInsidePtr (void const *pTest) const
 
virtual size_t GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const
 
virtual bool isValidCheck () const noexcept
 

Static Public Attributes

static const char k_pszVersion [] = "version"
 
static const char k_pszEncoding [] = "encoding"
 
static const char k_pszStandalone [] = "standalone"
 
- 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...
 

Protected Member Functions

virtual void SetCopy (const cXmlDeclaration &n)
 
virtual void SetClear ()
 Delete all the children of this node. Does not affect 'this'. More...
 
- Protected Member Functions inherited from GrayLib::cXmlNode
 cXmlNode (XMLNODE_TYPE eNodeType, cXmlString sValue="")
 Only instantiate as a derived type. More...
 
virtual void SetCopy (const cXmlNode &n)
 
- Protected Member Functions inherited from Gray::cListNodeBase
virtual void put_Parent (cListBase *pParent)
 
 cListNodeBase () noexcept
 
- Protected Member Functions inherited from Gray::cHeapObject
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 
- Protected Member Functions inherited from Gray::cNonCopyable
 cNonCopyable () noexcept
 Force the use of Factory creation via protected constructor. More...
 
 ~cNonCopyable () noexcept
 

Additional Inherited Members

- Public Types inherited from GrayLib::cXml
enum  XMLNODE_TYPE { XMLNODE_QTY }
 
- Static Public Member Functions inherited from GrayLib::cXmlNode
static HRESULT PrintDepth (cStreamOutput &rOut, int nDepth)
 
- 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)
 
- Public Attributes inherited from GrayLib::cXmlNode
cTextPos m_Pos
 Where (line,col) in the parsed XML document is this node? m_PosNode. More...
 
- Protected Attributes inherited from GrayLib::cXmlNode
const XMLNODE_TYPE m_eNodeType
 
cXmlString m_sValue
 parent usage dependent m_eNodeType. More...
 
void * m_pUserData
 Field containing a generic pointer to arbitrary user data. More...
 

Detailed Description

In correct XML the declaration is the first entry in the file. cXml will read or write files without a declaration. its optional.

//!     <?xml version="1.0" standalone="yes"?>
//! 
There are 3 possible attributes to the declaration:
version, encoding, and standalone.

@note In this version of the code, the attributes are
handled as special cases, not generic attributes, simply
because there can only be at most 3 and they are always the same. 

Constructor & Destructor Documentation

◆ cXmlDeclaration() [1/2]

GrayLib::cXmlDeclaration::cXmlDeclaration ( cXmlString  sVersion = "1.0",
cXmlString  sEncoding = "",
cXmlString  sStandalone = "" 
)

Construct an empty declaration.

◆ cXmlDeclaration() [2/2]

GrayLib::cXmlDeclaration::cXmlDeclaration ( const cXmlDeclaration rCopy)

◆ ~cXmlDeclaration()

virtual GrayLib::cXmlDeclaration::~cXmlDeclaration ( )
inlinevirtual

Member Function Documentation

◆ Clone()

cXmlNode * GrayLib::cXmlDeclaration::Clone ( ) const
virtual

Creates a copy of this Declaration and returns it.

Implements GrayLib::cXmlNode.

◆ get_Encoding()

const cXmlString& GrayLib::cXmlDeclaration::get_Encoding ( ) const
inline

Encoding. Will return an empty string if none was found.

◆ get_EncodingEnum()

CXML_ENCODING_TYPE GrayLib::cXmlDeclaration::get_EncodingEnum ( ) const

◆ get_PrintStr()

cXmlString GrayLib::cXmlDeclaration::get_PrintStr ( ) const

Print this declaration to a cStreamOutput stream.

print to a string.

◆ get_Standalone()

const cXmlString& GrayLib::cXmlDeclaration::get_Standalone ( ) const
inline

Is this a standalone document?

◆ get_Version()

const cXmlString& GrayLib::cXmlDeclaration::get_Version ( ) const
inline

Version. Will return an empty string if none was found.

◆ OnVisit()

bool GrayLib::cXmlDeclaration::OnVisit ( IXmlVisitor visitor) const
virtual

Walk the XML tree visiting this node and all of its children.

Implements GrayLib::cXmlNode.

◆ operator=()

void GrayLib::cXmlDeclaration::operator= ( const cXmlDeclaration rCopy)
inline

◆ Print()

virtual HRESULT GrayLib::cXmlDeclaration::Print ( cStreamOutput rOut,
int  nDepth = 0 
) const
inlinevirtual

All cXml classes can print themselves to a filestream or the string class (cXmlString in non-STL mode, std::string in STL mode.) Either or both pFile and string can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements GrayLib::cXmlNode.

◆ SetClear()

virtual void GrayLib::cXmlDeclaration::SetClear ( )
inlineprotectedvirtual

Delete all the children of this node. Does not affect 'this'.

Reimplemented from GrayLib::cXmlNode.

◆ SetCopy()

void GrayLib::cXmlDeclaration::SetCopy ( const cXmlDeclaration n)
protectedvirtual

◆ SetParseNode()

HRESULT GrayLib::cXmlDeclaration::SetParseNode ( cXmlReader rReader)
virtual

Populate node. Parse XMLNODE_Declaration

Implements GrayLib::cXmlNode.

◆ ToDeclaration() [1/2]

virtual cXmlDeclaration* GrayLib::cXmlDeclaration::ToDeclaration ( )
inlinevirtual

◆ ToDeclaration() [2/2]

virtual const cXmlDeclaration* GrayLib::cXmlDeclaration::ToDeclaration ( ) const
inlinevirtual

Member Data Documentation

◆ k_pszEncoding

const char GrayLib::cXmlDeclaration::k_pszEncoding = "encoding"
static

◆ k_pszStandalone

const char GrayLib::cXmlDeclaration::k_pszStandalone = "standalone"
static

◆ k_pszVersion

const char GrayLib::cXmlDeclaration::k_pszVersion = "version"
static

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