Sync with 5.4.0
[deliverable/titan.core.git] / xsdconvert / GeneralTypes.hh
CommitLineData
970ed795 1///////////////////////////////////////////////////////////////////////////////
3abe9331 2// Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
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
3abe9331 13enum ConstructType {
970ed795
EL
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,
3abe9331 24 c_import,
25 c_idattrib
970ed795
EL
26};
27
3abe9331 28enum NameConversionMode {
970ed795
EL
29 nameMode,
30 typeMode,
31 fieldMode
32};
33
3abe9331 34enum UseValue {
970ed795
EL
35 optional,
36 prohibited,
37 required
38};
39
3abe9331 40enum FormValue {
970ed795
EL
41 notset,
42 qualified,
43 unqualified
44};
45
3abe9331 46enum BlockValue {
47 not_set,
48 all,
49 substitution,
50 restriction,
51 extension
52};
53
54enum 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
970ed795 108/** This type just stores the textual information about an XML namespace */
3abe9331 109class NamespaceType {
970ed795
EL
110public:
111 Mstring prefix;
112 Mstring uri;
113
114 NamespaceType()
3abe9331 115 : prefix(), uri() {
116 }
970ed795
EL
117
118 NamespaceType(const Mstring& p, const Mstring& u)
3abe9331 119 : prefix(p), uri(u) {
120 }
970ed795 121
3abe9331 122 bool operator<(const NamespaceType & rhs) const {
123 return uri < rhs.uri;
124 }
125
126 bool operator==(const NamespaceType & rhs) const {
970ed795
EL
127 return (uri == rhs.uri) && (prefix == rhs.prefix);
128 }
129};
130
131class QualifiedName {
132public:
133 Mstring nsuri;
134 Mstring name;
3abe9331 135 Mstring orig_name;
136 bool dup;
970ed795
EL
137
138 QualifiedName()
3abe9331 139 : nsuri(), name(), orig_name(), dup(false) {
140 }
970ed795
EL
141
142 QualifiedName(const Mstring& ns, const Mstring nm)
3abe9331 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 }
970ed795 153
970ed795
EL
154 bool operator==(const QualifiedName& rhs) const {
155 return (nsuri == rhs.nsuri) && (name == rhs.name);
156 }
3abe9331 157
158 bool operator!=(const QualifiedName& rhs) const {
159 return (nsuri != rhs.nsuri) || (name != rhs.name);
160 }
970ed795
EL
161};
162
3abe9331 163enum wanted {
164 want_CT, want_ST, want_BOTH
165};
970ed795
EL
166
167#endif /*GENERAL_TYPES_H_*/
This page took 0.079396 seconds and 5 git commands to generate.