Migrate to openssl3
[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 #ifndef __CXMLFILE_H__
17 #define __CXMLFILE_H__
18
19 #include "TadcTypes.h"
20 #include "CXMLElement.h"
21
22 #define ELEMENT_QUEUE_MAX 2048
23
24 class CXMLFile {
25 protected:
26         LPCTSTR m_pszXML;
27         CXMLElement *m_paElementQueue[ELEMENT_QUEUE_MAX];
28         int m_nQueueIndex;
29         CXMLElement *m_pRoot;
30
31         int _Parse();
32         int _GetElementName(LPTSTR pszElementName);
33         CXMLElement *_Pop();
34         int _Push(CXMLElement *p);
35         int _GetAttributeNameAndValue(LPTSTR pszName, LPTSTR pszValue);
36
37 public:
38         CXMLFile();
39         virtual ~CXMLFile();
40
41         int LoadFromStream(LPCTSTR pszXML);
42         int LoadFromFile(LPCTSTR pszFileName);
43
44         inline CXMLElement *GetRoot()
45         {
46                 return m_pRoot;
47         }
48 };
49
50 #endif //__CXMLFILE_H_