Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Copyright (c) 2000-2014 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 | { | |
15 | c_unknown, | |
16 | c_schema, | |
17 | c_simpleType, | |
18 | c_complexType, | |
19 | c_element, | |
20 | c_attribute, | |
21 | c_attributeGroup, | |
22 | c_group, | |
23 | c_annotation, | |
24 | c_include, | |
25 | c_import | |
26 | }; | |
27 | ||
28 | enum NameConversionMode | |
29 | { | |
30 | nameMode, | |
31 | typeMode, | |
32 | fieldMode | |
33 | }; | |
34 | ||
35 | enum UseValue | |
36 | { | |
37 | optional, | |
38 | prohibited, | |
39 | required | |
40 | }; | |
41 | ||
42 | enum FormValue | |
43 | { | |
44 | notset, | |
45 | qualified, | |
46 | unqualified | |
47 | }; | |
48 | ||
49 | /** This type just stores the textual information about an XML namespace */ | |
50 | class NamespaceType | |
51 | { | |
52 | public: | |
53 | Mstring prefix; | |
54 | Mstring uri; | |
55 | ||
56 | NamespaceType() | |
57 | : prefix(), uri() | |
58 | {} | |
59 | ||
60 | NamespaceType(const Mstring& p, const Mstring& u) | |
61 | : prefix(p), uri(u) | |
62 | {} | |
63 | ||
64 | bool operator < (const NamespaceType & rhs) const { return uri < rhs.uri; } | |
65 | bool operator== (const NamespaceType & rhs) const { | |
66 | return (uri == rhs.uri) && (prefix == rhs.prefix); | |
67 | } | |
68 | }; | |
69 | ||
70 | class QualifiedName { | |
71 | public: | |
72 | Mstring nsuri; | |
73 | Mstring name; | |
74 | bool dup; | |
75 | ||
76 | QualifiedName() | |
77 | : nsuri(), name(), dup(false) | |
78 | {} | |
79 | ||
80 | QualifiedName(const Mstring& ns, const Mstring nm) | |
81 | : nsuri(ns), name(nm), dup(false) | |
82 | {} | |
83 | ||
84 | bool operator <(const QualifiedName& rhs) const { return name < rhs.name; } | |
85 | bool operator==(const QualifiedName& rhs) const { | |
86 | return (nsuri == rhs.nsuri) && (name == rhs.name); | |
87 | } | |
88 | }; | |
89 | ||
90 | enum wanted { want_CT, want_ST }; | |
91 | ||
92 | #endif /*GENERAL_TYPES_H_*/ |