-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclasses.hh
66 lines (58 loc) · 1.7 KB
/
classes.hh
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
63
64
65
66
#include <string>
#include <map>
#include <vector>
using namespace std;
enum xstype { xsstring, xsdecimal, xsboolean, xsinteger, xspositiveInteger, xsnegativeInteger, xsnonNegativeInteger, xsnonPositiveInteger, xsdate, xstime }; //XSD simple elements value types
enum or_indicator { all, choice, sequence }; //XSD elements order indicators
enum el_type { simple, complex }; //Element and Dataunits types
enum d_type { t_string, t_int, t_float, t_bool }; //XML data unit data types
class Attribute { //XSD element attribute
public:
string name;
xstype type;
string def;
string fixed;
string use;
Attribute();
~Attribute();
};
class Parameter { //XSD element parameter
public:
xstype type;
int maxOccurs;
int minOccurs;
Parameter();
~Parameter();
};
class Element { //XSD element
public:
string name;
Attribute* attrs;
Parameter* params;
el_type type;
or_indicator indicator;
vector<Element*> elements;
Element* find_child(string);
Element();
~Element();
};
class DataAttr { //XML data attribute
public:
string attr_name;
string attr_val;
d_type attr_val_type;
DataAttr();
~DataAttr();
};
class DataUnit { //XML data unit
public:
string name;
DataAttr* attr;
string data;
d_type data_type;
el_type unit_type;
map<string,int> child_count;
vector<DataUnit*> data_units;
DataUnit();
~DataUnit();
};