Sync with 5.4.3
[deliverable/titan.core.git] / xsdconvert / GeneralTypes.hh
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef GENERAL_TYPES_H_
9 #define GENERAL_TYPES_H_
10
11 #include "Mstring.hh"
12
13 enum ConstructType {
14 c_unknown,
15 c_schema,
16 c_simpleType,
17 c_complexType,
18 c_element,
19 c_attribute,
20 c_attributeGroup,
21 c_group,
22 c_annotation,
23 c_include,
24 c_import,
25 c_idattrib
26 };
27
28 enum NameConversionMode {
29 nameMode,
30 typeMode,
31 fieldMode
32 };
33
34 enum UseValue {
35 optional,
36 prohibited,
37 required
38 };
39
40 enum FormValue {
41 notset,
42 qualified,
43 unqualified
44 };
45
46 enum BlockValue {
47 not_set,
48 all,
49 substitution,
50 restriction,
51 extension
52 };
53
54 enum TagName {
55 // XSD Elements:
56 n_all,
57 n_annotation,
58 n_any,
59 n_anyAttribute,
60 n_appinfo,
61 n_attribute,
62 n_attributeGroup,
63 n_choice,
64 n_complexContent,
65 n_complexType,
66 n_documentation,
67 n_element,
68 n_extension,
69 n_field, // Not supported by now
70 n_group,
71 n_import,
72 n_include,
73 n_key, // Not supported by now
74 n_keyref, // Not supported by now
75 n_list,
76 n_notation, // Not supported by now
77 n_redefine,
78 n_restriction,
79 n_schema,
80 n_selector, // Not supported by now
81 n_sequence,
82 n_simpleContent,
83 n_simpleType,
84 n_union,
85 n_unique, // Not supported by now
86
87 // XSD Restrictions / Facets for Datatypes:
88 n_enumeration,
89 n_fractionDigits, // Not supported by now
90 n_length,
91 n_maxExclusive,
92 n_maxInclusive,
93 n_maxLength,
94 n_minExclusive,
95 n_minInclusive,
96 n_minLength,
97 n_pattern,
98 n_totalDigits,
99 n_whiteSpace,
100
101 // Others - non-standard, but used:
102 n_label, // ???
103 n_definition, // ???
104
105 n_NOTSET
106 };
107
108 /** This type just stores the textual information about an XML namespace */
109 class NamespaceType {
110 public:
111 Mstring prefix;
112 Mstring uri;
113
114 NamespaceType()
115 : prefix(), uri() {
116 }
117
118 NamespaceType(const Mstring& p, const Mstring& u)
119 : prefix(p), uri(u) {
120 }
121
122 bool operator<(const NamespaceType & rhs) const {
123 return uri < rhs.uri;
124 }
125
126 bool operator==(const NamespaceType & rhs) const {
127 return (uri == rhs.uri) && (prefix == rhs.prefix);
128 }
129 };
130
131 class QualifiedName {
132 public:
133 Mstring nsuri;
134 Mstring name;
135 Mstring orig_name;
136 bool dup;
137
138 QualifiedName()
139 : nsuri(), name(), orig_name(), dup(false) {
140 }
141
142 QualifiedName(const Mstring& ns, const Mstring nm)
143 : nsuri(ns), name(nm), dup(false) {
144 }
145
146 QualifiedName(const Mstring& ns, const Mstring nm, const Mstring orig)
147 : nsuri(ns), name(nm), orig_name(orig), dup(false) {
148 }
149
150 bool operator<(const QualifiedName& rhs) const {
151 return name < rhs.name;
152 }
153
154 bool operator==(const QualifiedName& rhs) const {
155 return (nsuri == rhs.nsuri) && (name == rhs.name);
156 }
157
158 bool operator!=(const QualifiedName& rhs) const {
159 return (nsuri != rhs.nsuri) || (name != rhs.name);
160 }
161 };
162
163 enum wanted {
164 want_CT, want_ST, want_BOTH
165 };
166
167 #endif /*GENERAL_TYPES_H_*/
This page took 0.047426 seconds and 5 git commands to generate.