Synchronize with tizen 2.4
[platform/core/security/drm-service-core-tizen.git] / tadcore / include / CXMLFile.h
1 /*
2  * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #if !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)
18 #define AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_
19
20 #include "TadcTypes.h"
21 #include "CXMLElement.h"
22
23 #if _MSC_VER > 1000
24 #pragma once
25 #endif // _MSC_VER > 1000
26
27 #ifndef IN
28         #define IN
29 #endif
30
31 #ifndef OUT
32         #define OUT
33 #endif
34
35 #define ELEMENT_QUEUE_MAX       2048
36
37 class CXMLFile  
38 {
39 protected:
40         LPCTSTR                                 m_pszXML;
41         CXMLElement*                    m_paElementQueue[ ELEMENT_QUEUE_MAX ];
42         int                                             m_nQueueIndex;
43         CXMLElement*                    m_pRoot;
44         
45         int                                     _Parse();
46         int                                     _GetElementName(  LPTSTR pszElementName );
47         CXMLElement*                    _Pop();
48         int                                     _Push( CXMLElement* p );
49         int                                     _GetAttributeNameAndValue(  LPTSTR pszName,  LPTSTR pszValue );
50
51 public:
52         CXMLFile();
53         virtual ~CXMLFile();
54
55         int                                     LoadFromStream(  LPCTSTR pszXML );
56         int                                     LoadFromFile(  LPCTSTR pszFileName );
57         inline CXMLElement*     GetRoot() { return m_pRoot; }
58 };
59
60 #endif // !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)