Zorba
The XQuery Processor
Documentation
Live Demo
Modules
Download
Tools
Blog
Code
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
include
zorba
typeident.h
Go to the documentation of this file.
1
/*
2
* Copyright 2006-2008 The FLWOR Foundation.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef ZORBA_TYPES_TYPEIDENT_H
17
#define ZORBA_TYPES_TYPEIDENT_H
18
19
#include <zorba/config.h>
20
#include <
zorba/api_shared_types.h
>
21
#include <
zorba/identtypes.h
>
22
#include <
zorba/zorba_string.h
>
23
#include <iostream>
24
25
namespace
zorba {
26
27
/** \brief Type identifiers
28
*
29
* The type identifiers are not used, yet.
30
*
31
* Note: This class is reference counted. When writing multi-threaded clients,
32
* it is the responibility of the client code to synchronize assignments to the
33
* SmartPtr holding this object.
34
*/
35
class
ZORBA_DLL_PUBLIC
TypeIdentifier
:
public
SmartObject
{
36
public
:
37
/** \brief Destructor
38
*/
39
~
TypeIdentifier
();
40
41
static
42
TypeIdentifier_t
43
createNamedType(
44
const
String
& uri,
45
const
String
& localName,
46
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
47
);
48
49
static
50
TypeIdentifier_t
51
createElementType(
52
const
String
& uri,
53
bool
uriWildcard,
54
const
String
& localName,
55
bool
localNameWildcard,
56
TypeIdentifier_t
contentType,
57
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
58
);
59
60
static
61
TypeIdentifier_t
62
createAttributeType(
63
const
String
& uri,
64
bool
uriWildcard,
65
const
String
& localName,
66
bool
localNameWildcard,
67
TypeIdentifier_t
contentType,
68
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
69
);
70
71
static
72
TypeIdentifier_t
73
createDocumentType(
74
TypeIdentifier_t
contentType,
75
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
76
);
77
78
static
79
TypeIdentifier_t
80
createPIType(
81
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
82
);
83
84
static
85
TypeIdentifier_t
86
createTextType(
87
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
88
);
89
90
static
91
TypeIdentifier_t
92
createCommentType(
93
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
94
);
95
96
static
97
TypeIdentifier_t
98
createAnyNodeType(
99
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
100
);
101
102
static
103
TypeIdentifier_t
104
createItemType(
105
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
106
);
107
108
static
109
TypeIdentifier_t
110
createEmptyType();
111
112
static
113
TypeIdentifier_t
114
createSchemaElementType(
115
const
String
& uri,
116
const
String
& localName,
117
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
118
);
119
120
static
121
TypeIdentifier_t
122
createSchemaAttributeType(
123
const
String
& uri,
124
const
String
& localName,
125
IdentTypes::quantifier_t
quantifier =
IdentTypes::QUANT_ONE
126
);
127
128
IdentTypes::kind_t
129
getKind()
const
;
130
131
IdentTypes::quantifier_t
132
getQuantifier()
const
;
133
134
const
String
&
135
getUri()
const
;
136
137
bool
138
isUriWildcard()
const
;
139
140
const
String
&
141
getLocalName()
const
;
142
143
bool
144
isLocalNameWildcard()
const
;
145
146
TypeIdentifier_t
147
getContentType()
const
;
148
149
std::ostream&
150
emit(std::ostream&)
const
;
151
152
private
:
153
TypeIdentifier
();
154
155
std::ostream&
156
emitItemType(std::ostream&)
const
;
157
158
std::ostream&
159
emitName(std::ostream&)
const
;
160
161
IdentTypes::kind_t
m_kind;
162
IdentTypes::quantifier_t
m_quantifier;
163
String
m_uri;
164
bool
m_uriWildcard;
165
String
m_localName;
166
bool
m_localNameWildcard;
167
TypeIdentifier_t
m_contentType;
168
};
169
170
#ifdef WIN32
171
template
class
ZORBA_DLL_PUBLIC
zorba::SmartPtr<TypeIdentifier>
;
172
#endif
173
174
175
}
/* namespace zorba */
176
177
namespace
std {
178
179
ZORBA_DLL_PUBLIC ostream&
operator<<
(ostream& o,
const
zorba::TypeIdentifier
&
ti
);
180
ZORBA_DLL_PUBLIC ostream&
operator<<
(ostream& o,
const
zorba::TypeIdentifier_t
ti
);
181
182
}
183
184
#endif
/* ZORBA_TYPES_TYPEIDENT_H */
185
/* vim:set et sw=2 ts=2: */
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus