-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmlParser.h
More file actions
62 lines (54 loc) · 2.33 KB
/
xmlParser.h
File metadata and controls
62 lines (54 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __XMLParser__H
#define __XMLParser__H
#include "Xlex.h"
#include <vector>
using namespace std;
//==============================================================================
class xmlParser {
public:
xmlParser(FILE *);
virtual ~ xmlParser(void);
virtual bool CDATA( const void *,
const unsigned &,
const string &);
virtual bool Comments( const void *,
const string &);
virtual bool EndDocument( const void *);
virtual bool EndElement( const void *,
const string &);
virtual bool Error( const void *,
const unsigned &,
const unsigned &,
const string &);
virtual bool JSON( const void *,
const string &,
const vector<pair<string,string> > &);
bool SetPtr( const void *);
virtual bool StartDocument( const void *,
const string &,
const vector<pair<string,string> > &);
virtual bool StartElement( const void *,
const string &,
const vector<pair<string,string> > &);
private:
void Attr();
void Dump();
void Element();
bool Json(int &);
vector<string> elename; // Element name stack
vector<pair<string,string> > attr;
vector<pair<string,string> > json;
string jsonstr;
string xmlname;
string cdata;
string comments;
bool problem;
void * phome;
static const int X = -1; // Cosmic exit table entry
static const int R = -2; // Cosmic return table entry
static const int E = -3; // Cosmic error table entry
Lex Lx; // Lexer
Lex::tokdat Td;
};
//==============================================================================
#endif