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 #include "stdafx.h"
17 
18 #include "context/static_context_consts.h"
19 
20 
21 namespace zorba {
22 namespace StaticContextConsts {
23 
operator <<(std::ostream & o,xquery_version_t v)24 std::ostream& operator<<( std::ostream &o, xquery_version_t v ) {
25   switch ( v ) {
26     case xquery_version_1_0:
27       return o << "1.0";
28     case xquery_version_3_0:
29       return o << "3.0";
30     default:
31       return o << "unknown";
32   }
33 }
34 
toString(declaration_property_t prop)35 std::string toString(declaration_property_t prop)
36 {
37   switch (prop)
38   {
39   case StaticContextConsts::decl_mutable:
40     return "mutable";
41 
42   case StaticContextConsts::decl_queue:
43     return "queue";
44 
45   case StaticContextConsts::decl_append_only:
46     return "append_only";
47 
48   case StaticContextConsts::decl_const:
49     return "const";
50 
51   case StaticContextConsts::decl_ordered:
52     return "ordered";
53 
54   case StaticContextConsts::decl_unordered:
55     return "unordered";
56 
57   case StaticContextConsts::decl_value_equality:
58     return "valiue_equality";
59 
60   case StaticContextConsts::decl_value_range:
61     return "value_range";
62 
63   case StaticContextConsts::decl_unique:
64     return "unique";
65 
66   case StaticContextConsts::decl_non_unique:
67     return "non_unique";
68 
69   case StaticContextConsts::decl_manual:
70     return "manual";
71 
72   case StaticContextConsts::decl_automatic:
73     return "automatic";
74 
75   default:
76     return "??";
77   }
78 
79 }
80 
81 } // namespace StaticContextConsts
82 } // namespace zorba
83 /* vim:set et sw=2 ts=2: */
84