Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cXmlHandle.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cXmlHandle_H
7 #define _INC_cXmlHandle_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cXmlDocument.h"
14 
15 namespace GrayLib
16 {
17  class GRAYLIB_LINK cXmlHandle : public cPtrFacade<cXmlNode>, public cXml
18  {
98  //
99 
100  cXmlContainer* get_Container() const;
101 
102  public:
104  {
106  this->m_p = pNode;
107  }
108  cXmlHandle(const cXmlHandle& ref)
109  {
111  this->m_p = ref.m_p;
112  }
113 
115  {
116  this->m_p = ref.m_p;
117  return *this;
118  }
119 
120  cXmlHandle get_Head() const;
121  cXmlHandle GetChildFirst(const char* value) const;
122  cXmlHandle get_FirstChildElement() const;
123  cXmlHandle GetFirstChildElement(const char* value) const;
124 
127  cXmlHandle GetChild(int index) const;
128 
131  cXmlHandle GetChild(const char* value, int index) const;
132 
136  cXmlHandle GetChildElement(int index) const;
137 
141  cXmlHandle GetChildElement(const char* value, int index) const;
142 
143  cXmlNode* ToNode() const
144  {
147  return m_p;
148  }
149 
151  {
153  return ((m_p != nullptr && m_p->isType(XMLNODE_Element)) ? CHECKPTR_CAST(cXmlElement, m_p) : nullptr);
154  }
155 
156  cXmlText* ToText() const
157  {
159  return ((m_p != nullptr && m_p->isType(XMLNODE_Text)) ? CHECKPTR_CAST(cXmlText, m_p) : nullptr);
160  }
161 
163  {
165  return ((m_p != nullptr && m_p->isType(XMLNODE_Unknown)) ? CHECKPTR_CAST(cXmlUnknown, m_p) : nullptr);
166  }
167  };
168 };
169 #endif // _INC_cXmlHandle_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define CHECKPTR_CAST(t, p)
Definition: PtrCast.h:50
Definition: cXmlDocument.h:480
Definition: cXmlDocument.h:549
Definition: cXmlHandle.h:18
cXmlUnknown * ToUnknown() const
Definition: cXmlHandle.h:162
cXmlNode * ToNode() const
Definition: cXmlHandle.h:143
cXmlHandle(const cXmlHandle &ref)
Definition: cXmlHandle.h:108
cXmlElement * ToElement() const
Definition: cXmlHandle.h:150
cXmlText * ToText() const
Definition: cXmlHandle.h:156
cXmlHandle(cXmlNode *pNode)
Definition: cXmlHandle.h:103
cXmlHandle & operator=(const cXmlHandle &ref)
Definition: cXmlHandle.h:114
Definition: cXmlDocument.h:30
Definition: cXmlDocument.h:279
Definition: cXmlDocument.h:441
Definition: cPtrFacade.h:19
TYPE * m_p
Pointer to some object of TYPE.
Definition: cPtrFacade.h:28
Definition: cMesh.h:22
uint16 index
Definition: sample3.cpp:29
Definition: cXml.h:34