initial import
[platform/core/security/drm-service-core-intel.git] / include / CXMLFile.h
1 /********************************************************************************\r
2 * Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr).                                 *\r
3 * All rights reserved.                                                                  * \r
4 *                                                                                       * \r
5 * No parts of this source code may be in any way copied, reproduced, modified   *\r
6 * or distributed without the prior written consent of INKA Entworks, Inc.       *\r
7 * CXMLFile.h: interface for the CXMLFile class.                                                                 *\r
8 *********************************************************************************/ \r
9 \r
10 #if !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r
11 #define AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_\r
12 \r
13 #include "InkaTypes.h"\r
14 #include "CXMLElement.h"\r
15 \r
16 #if _MSC_VER > 1000\r
17 #pragma once\r
18 #endif // _MSC_VER > 1000\r
19 \r
20 #ifndef IN\r
21         #define IN\r
22 #endif\r
23 \r
24 #ifndef OUT\r
25         #define OUT\r
26 #endif\r
27 \r
28 #define ELEMENT_QUEUE_MAX               2048\r
29 class CXMLFile  \r
30 {\r
31 protected:\r
32         LPCTSTR                                                 m_pszXML;\r
33         CXMLElement*                                    m_paElementQueue[ ELEMENT_QUEUE_MAX ];\r
34         int                                                             m_nQueueIndex;\r
35         CXMLElement*                                    m_pRoot;\r
36         \r
37         int                                     _Parse();\r
38         int                                             _GetElementName(  LPTSTR pszElementName );\r
39         CXMLElement*                            _Pop();\r
40         int                                             _Push( CXMLElement* p );\r
41         int                                             _GetAttributeNameAndValue(  LPTSTR pszName,  LPTSTR pszValue );\r
42 \r
43 public:\r
44         CXMLFile();\r
45         virtual ~CXMLFile();\r
46 \r
47         int                                             LoadFromStream(  LPCTSTR pszXML );\r
48         int                                             LoadFromFile(  LPCTSTR pszFileName );\r
49         inline CXMLElement*             GetRoot() { return m_pRoot; }\r
50 };\r
51 \r
52 #endif // !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r