|
0
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
3 |
* All rights reserved.
|
|
|
4 |
* This component and the accompanying materials are made available
|
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
|
6 |
* which accompanies this distribution, and is available
|
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
|
8 |
*
|
|
|
9 |
* Initial Contributors:
|
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
|
11 |
*
|
|
|
12 |
* Contributors:
|
|
|
13 |
*
|
|
|
14 |
* Description:
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
#ifndef __LA_PARSER_HPP__
|
|
|
18 |
#define __LA_PARSER_HPP__
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
#include <xercesc/dom/DOM.hpp>
|
|
|
22 |
#include <xercesc/dom/DOMErrorHandler.hpp>
|
|
|
23 |
#include <xercesc/util/XMLString.hpp>
|
|
|
24 |
#include <xercesc/util/PlatformUtils.hpp>
|
|
|
25 |
#include <xercesc/framework/LocalFileFormatTarget.hpp>
|
|
|
26 |
|
|
|
27 |
#include <string>
|
|
|
28 |
#include <iostream>
|
|
|
29 |
#include <map>
|
|
|
30 |
#include <vector>
|
|
|
31 |
#include <algorithm>
|
|
|
32 |
#include <fstream>
|
|
|
33 |
|
|
|
34 |
#define _X(s) XMLString::transcode(s)
|
|
|
35 |
#define _XX(s) XMLString::release(&s)
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
using namespace std;
|
|
|
39 |
XERCES_CPP_NAMESPACE_USE
|
|
|
40 |
|
|
|
41 |
namespace XmlTools
|
|
|
42 |
{
|
|
|
43 |
// initialization
|
|
|
44 |
int initialiseDOM();
|
|
|
45 |
void uninitialiseDOM();
|
|
|
46 |
// I/O
|
|
|
47 |
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* readFile( const char* aFilename );
|
|
|
48 |
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* getTagNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* aParentNode, const char* aTagName );
|
|
|
49 |
int getTagValue(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* aParentNode, const char* aTagName, char* aTagValue, int minLen, int maxLen );
|
|
|
50 |
DOMBuilder* iParser = NULL;
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
class DOMPrintErrorHandler : public DOMErrorHandler
|
|
|
54 |
{
|
|
|
55 |
public:
|
|
|
56 |
|
|
|
57 |
DOMPrintErrorHandler(){};
|
|
|
58 |
~DOMPrintErrorHandler(){};
|
|
|
59 |
|
|
|
60 |
//The error handler interface
|
|
|
61 |
bool handleError(const DOMError& domError);
|
|
|
62 |
void resetErrors(){};
|
|
|
63 |
|
|
|
64 |
private :
|
|
|
65 |
// Unimplemented constructors and operators
|
|
|
66 |
DOMPrintErrorHandler(const DOMErrorHandler&);
|
|
|
67 |
void operator=(const DOMErrorHandler&);
|
|
|
68 |
|
|
|
69 |
};
|
|
|
70 |
#endif
|