eb74a0c55f2fb8830a884cecb6a4a5a65b9c56be
[framework/web/wrt-installer.git] / src / commons / drm / CXMLElement.h
1 \r
2 /********************************************************************************\r
3 * Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr).                                 *\r
4 * All rights reserved.                                                                  * \r
5 *                                                                                       * \r
6 * No parts of this source code may be in any way copied, reproduced, modified   *\r
7 * or distributed without the prior written consent of INKA Entworks, Inc.       *\r
8 * CXMLElement.h: interface for the CXMLElement class.                                                   *\r
9 *********************************************************************************/ \r
10 \r
11 #if !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r
12 #define AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_\r
13 \r
14 //#include "Shp.h"\r
15 #include "InkaTypes.h"\r
16 #include "CXMLAttribute.h"\r
17 #include "CPointerArray.h"\r
18 \r
19 \r
20 #if _MSC_VER > 1000\r
21 #pragma once\r
22 #endif // _MSC_VER > 1000\r
23 \r
24 class CXMLElement  \r
25 {\r
26 protected:\r
27         LPTSTR                                                  m_pszName;\r
28         LPTSTR                                                  m_pszValue;\r
29         \r
30         CPointerArray                                   m_pChilds;\r
31         CPointerArray                                   m_pAttributes;\r
32         \r
33         int                                             _SearchNodes(  CPointerArray* ppaChildNodes,  CXMLElement* pCurrent,  LPCTSTR pszTagName,  va_list args );\r
34 \r
35 public:\r
36         CXMLElement();\r
37         virtual ~CXMLElement();\r
38 \r
39         int                                     SetName(  LPCTSTR pszName );\r
40         int                                             SetValue(  LPCTSTR pszValue );\r
41         int                                             AddAttribute(  LPCTSTR pszName,  LPCTSTR pszValue );\r
42 \r
43         inline LPCTSTR                  GetName() { return m_pszName; }\r
44         inline LPCTSTR                  GetValue() { return m_pszValue; }\r
45 \r
46         int                                             AddChild(  CXMLElement* pChild );\r
47         LPCTSTR                                         GetAttribute(  LPCTSTR pszName );\r
48 \r
49         inline int                              GetChildCount() { return m_pChilds.GetCount(); }\r
50         inline int                              GetAttributeCount() { return m_pAttributes.GetCount(); }\r
51         inline CXMLElement*             GetChild(  int nIndex ) { return (CXMLElement*)m_pChilds.Get( nIndex ); }\r
52         inline CXMLAttribute*   GetAttribute(  int nIndex ) { return (CXMLAttribute*)m_pAttributes.Get( nIndex ); }\r
53 \r
54         int                                                             Find(  CPointerArray* pSearchedChild,  LPCTSTR pszChildName, ... );\r
55 };\r
56 \r
57 #endif // !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r