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 <string>
20 #include <zorba/config.h>
21 
22 namespace zorba { namespace store {
23 
24 /*******************************************************************************
25  !!! ATTENTION: The order of thr enum values within SchemaTypeCode is important.
26  !!! DO NOT change this order!!!!
27 ********************************************************************************/
29 {
31 
32  XS_STRING = 1,
34  XS_TOKEN = 3,
37  XS_NAME = 6,
38  XS_NCNAME = 7,
39  XS_ID = 8,
40  XS_IDREF = 9,
41  XS_ENTITY = 10,
42 
44 
46  XS_DATE = 13,
47  XS_TIME = 14,
51 
52  XS_FLOAT = 18,
53  XS_DOUBLE = 19,
54 
55  XS_DECIMAL = 20,
56  XS_INTEGER = 21,
59  XS_LONG = 24,
60  XS_INT = 25,
61  XS_SHORT = 26,
62  XS_BYTE = 27,
69 
71  XS_GYEAR = 35,
73  XS_GDAY = 37,
74  XS_GMONTH = 38,
75 
76  XS_BOOLEAN = 39,
77 
80 
81  XS_ANY_URI = 42,
82 
83  XS_QNAME = 43,
85 
87 };
88 
89 class ZORBA_DLL_PUBLIC StoreConsts
90 {
91  public:
92 
93  enum NodeKind
94  {
95  anyNode = 0,
96  documentNode = 1,
97  elementNode = 2,
98  attributeNode = 3,
99  textNode = 4,
100  piNode = 5,
101  commentNode = 6
102  };
103 
104  enum NsScoping
105  {
108  ONLY_PARENT_NAMESPACES
109  };
110 
111  static std::string toString(NodeKind k)
112  {
113  switch(k) {
114  case anyNode:
115  return "anyNode";
116 
117  case documentNode:
118  return "documentNode";
119 
120  case elementNode:
121  return "elementNode";
122 
123  case attributeNode:
124  return "attributeNode";
125 
126  case textNode:
127  return "textNode";
128 
129  case piNode:
130  return "piNode";
131 
132  case commentNode:
133  return "commentNode";
134 
135  default:
136  return "<unknown NodeKind>";
137  }
138  }
139 };
140 
141 } // namespace store
142 } // namespace zorba
143 #endif
144 /* vim:set et sw=2 ts=2: */
blog comments powered by Disqus