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
store_consts.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_STORE_STORE_CONSTS_H
17
#define ZORBA_STORE_STORE_CONSTS_H
18
19
#include <iostream>
20
#include <string>
21
#include <zorba/config.h>
22
23
namespace
zorba {
namespace
store {
24
25
/*******************************************************************************
26
!!! ATTENTION: The order of the enum values within SchemaTypeCode is important.
27
!!! DO NOT change this order!!!! DO NOT insert in the middle!!!!
28
********************************************************************************/
29
enum
SchemaTypeCode
30
{
31
XS_ANY_ATOMIC
= 0,
32
33
XS_STRING
= 1,
34
XS_NORMALIZED_STRING
= 2,
35
XS_TOKEN
= 3,
36
XS_LANGUAGE
= 4,
37
XS_NMTOKEN
= 5,
38
XS_NAME
= 6,
39
XS_NCNAME
= 7,
40
XS_ID
= 8,
41
XS_IDREF
= 9,
42
XS_ENTITY
= 10,
43
44
XS_UNTYPED_ATOMIC
= 11,
45
46
XS_DATETIME
= 12,
47
XS_DATE
= 13,
48
XS_TIME
= 14,
49
50
XS_DURATION
= 15,
51
XS_DT_DURATION
= 16,
52
XS_YM_DURATION
= 17,
53
54
XS_FLOAT
= 18,
55
XS_DOUBLE
= 19,
56
57
XS_DECIMAL
= 20,
58
XS_INTEGER
= 21,
59
XS_NON_POSITIVE_INTEGER
= 22,
60
XS_NEGATIVE_INTEGER
= 23,
61
XS_LONG
= 24,
62
XS_INT
= 25,
63
XS_SHORT
= 26,
64
XS_BYTE
= 27,
65
XS_NON_NEGATIVE_INTEGER
= 28,
66
XS_UNSIGNED_LONG
= 29,
67
XS_UNSIGNED_INT
= 30,
68
XS_UNSIGNED_SHORT
= 31,
69
XS_UNSIGNED_BYTE
= 32,
70
XS_POSITIVE_INTEGER
= 33,
71
72
XS_GYEAR_MONTH
= 34,
73
XS_GYEAR
= 35,
74
XS_GMONTH_DAY
= 36,
75
XS_GDAY
= 37,
76
XS_GMONTH
= 38,
77
78
XS_BOOLEAN
= 39,
79
80
XS_BASE64BINARY
= 40,
81
XS_HEXBINARY
= 41,
82
83
XS_ANY_URI
= 42,
84
85
XS_QNAME
= 43,
86
XS_NOTATION
= 44,
87
88
JS_NULL
= 45,
89
XS_DATETIME_STAMP
= 46,
90
91
XS_LAST
92
};
93
94
std::ostream&
operator<<
( std::ostream&,
SchemaTypeCode
);
95
96
97
class
ZORBA_DLL_PUBLIC
StoreConsts
98
{
99
public
:
100
101
enum
NsScoping
102
{
103
ALL_NAMESPACES
,
104
ONLY_LOCAL_NAMESPACES
,
105
ONLY_PARENT_NAMESPACES
106
};
107
108
enum
NodeKind
109
{
110
anyNode = 0,
111
documentNode = 1,
112
elementNode = 2,
113
attributeNode = 3,
114
textNode = 4,
115
piNode = 5,
116
commentNode = 6,
117
namespaceNode = 7
118
};
119
120
static
std::string
toString
(
NodeKind
k)
121
{
122
switch
(k)
123
{
124
case
anyNode:
125
return
"anyNode"
;
126
127
case
documentNode:
128
return
"documentNode"
;
129
130
case
elementNode:
131
return
"elementNode"
;
132
133
case
attributeNode:
134
return
"attributeNode"
;
135
136
case
textNode:
137
return
"textNode"
;
138
139
case
piNode:
140
return
"piNode"
;
141
142
case
commentNode:
143
return
"commentNode"
;
144
145
case
namespaceNode:
146
return
"namespaceNode"
;
147
148
default
:
149
return
"<unknown NodeKind>"
;
150
}
151
}
152
153
static
std::string
toSchemaString
(
NodeKind
k)
154
{
155
switch
(k)
156
{
157
case
anyNode:
158
return
"node"
;
159
160
case
documentNode:
161
return
"document-node"
;
162
163
case
elementNode:
164
return
"element"
;
165
166
case
attributeNode:
167
return
"attribute"
;
168
169
case
textNode:
170
return
"text"
;
171
172
case
piNode:
173
return
"processing-instruction"
;
174
175
case
commentNode:
176
return
"comment"
;
177
178
case
namespaceNode:
179
return
"namespace-node"
;
180
181
default
:
182
return
"<unknown NodeKind>"
;
183
}
184
}
185
186
187
/* ATTENTION: the ordering of the enum values is important. Do NOT change it! */
188
enum
JSONItemKind
189
{
190
jsonItem = 0,
191
jsonObject = 1,
192
jsonArray = 2
193
};
194
195
196
static
std::string
toString
(
JSONItemKind
k)
197
{
198
switch
(k)
199
{
200
case
jsonItem:
201
return
"json-item"
;
202
203
case
jsonObject:
204
return
"object"
;
205
206
case
jsonArray:
207
return
"array"
;
208
209
default
:
210
return
"<unknown JSONItemKind>"
;
211
}
212
}
213
};
214
215
}
// namespace store
216
}
// namespace zorba
217
#endif
218
/* vim:set et sw=2 ts=2: */
zorba::store::XS_BASE64BINARY
Definition:
store_consts.h:80
zorba::store::XS_DATE
Definition:
store_consts.h:47
zorba::store::XS_BYTE
Definition:
store_consts.h:64
zorba::store::StoreConsts::toSchemaString
static std::string toSchemaString(NodeKind k)
Definition:
store_consts.h:153
zorba::store::XS_ANY_URI
Definition:
store_consts.h:83
zorba::store::XS_NOTATION
Definition:
store_consts.h:86
zorba::store::XS_ID
Definition:
store_consts.h:40
zorba::store::XS_INTEGER
Definition:
store_consts.h:58
zorba::store::XS_HEXBINARY
Definition:
store_consts.h:81
zorba::store::XS_NAME
Definition:
store_consts.h:38
zorba::store::XS_GYEAR
Definition:
store_consts.h:73
zorba::store::XS_ENTITY
Definition:
store_consts.h:42
zorba::store::XS_DATETIME_STAMP
Definition:
store_consts.h:89
zorba::store::XS_NON_NEGATIVE_INTEGER
Definition:
store_consts.h:65
zorba::store::XS_GMONTH
Definition:
store_consts.h:76
zorba::store::XS_DOUBLE
Definition:
store_consts.h:55
zorba::store::XS_POSITIVE_INTEGER
Definition:
store_consts.h:70
zorba::store::XS_NEGATIVE_INTEGER
Definition:
store_consts.h:60
zorba::store::XS_GMONTH_DAY
Definition:
store_consts.h:74
zorba::store::XS_IDREF
Definition:
store_consts.h:41
zorba::store::XS_NORMALIZED_STRING
Definition:
store_consts.h:34
zorba::store::StoreConsts::ALL_NAMESPACES
Definition:
store_consts.h:103
zorba::store::XS_NON_POSITIVE_INTEGER
Definition:
store_consts.h:59
zorba::store::StoreConsts::JSONItemKind
JSONItemKind
Definition:
store_consts.h:188
zorba::store::XS_SHORT
Definition:
store_consts.h:63
zorba::store::StoreConsts::ONLY_LOCAL_NAMESPACES
Definition:
store_consts.h:104
zorba::store::operator<<
std::ostream & operator<<(std::ostream &, SchemaTypeCode)
zorba::store::XS_LANGUAGE
Definition:
store_consts.h:36
zorba::store::XS_NCNAME
Definition:
store_consts.h:39
zorba::store::XS_TIME
Definition:
store_consts.h:48
zorba::store::XS_DECIMAL
Definition:
store_consts.h:57
zorba::store::XS_ANY_ATOMIC
Definition:
store_consts.h:31
zorba::store::XS_TOKEN
Definition:
store_consts.h:35
zorba::store::XS_LAST
Definition:
store_consts.h:91
zorba::store::XS_LONG
Definition:
store_consts.h:61
zorba::store::XS_NMTOKEN
Definition:
store_consts.h:37
zorba::store::XS_QNAME
Definition:
store_consts.h:85
zorba::store::XS_UNTYPED_ATOMIC
Definition:
store_consts.h:44
zorba::store::XS_UNSIGNED_INT
Definition:
store_consts.h:67
zorba::store::XS_INT
Definition:
store_consts.h:62
zorba::store::XS_DT_DURATION
Definition:
store_consts.h:51
zorba::store::XS_UNSIGNED_SHORT
Definition:
store_consts.h:68
zorba::store::StoreConsts
Definition:
store_consts.h:97
zorba::store::XS_YM_DURATION
Definition:
store_consts.h:52
zorba::store::XS_UNSIGNED_BYTE
Definition:
store_consts.h:69
zorba::store::StoreConsts::NodeKind
NodeKind
Definition:
store_consts.h:108
zorba::store::SchemaTypeCode
SchemaTypeCode
Definition:
store_consts.h:29
zorba::store::XS_DATETIME
Definition:
store_consts.h:46
zorba::store::XS_DURATION
Definition:
store_consts.h:50
zorba::store::StoreConsts::toString
static std::string toString(NodeKind k)
Definition:
store_consts.h:120
zorba::store::StoreConsts::NsScoping
NsScoping
Definition:
store_consts.h:101
zorba::store::XS_BOOLEAN
Definition:
store_consts.h:78
zorba::store::XS_STRING
Definition:
store_consts.h:33
zorba::store::XS_GYEAR_MONTH
Definition:
store_consts.h:72
zorba::store::StoreConsts::toString
static std::string toString(JSONItemKind k)
Definition:
store_consts.h:196
zorba::store::XS_GDAY
Definition:
store_consts.h:75
zorba::store::XS_FLOAT
Definition:
store_consts.h:54
zorba::store::XS_UNSIGNED_LONG
Definition:
store_consts.h:66
zorba::store::JS_NULL
Definition:
store_consts.h:88