TypeIdentifier.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 
17 #ifndef API_TYPE_IDENTIFIER_H
18 #define API_TYPE_IDENTIFIER_H
19 
20 class IdentTypes {
21 public:
22  typedef enum {
34  } Kind;
35 
36  typedef enum {
41  } Quantifier;
42 };
43 
44 /** \brief Type identifiers
45  *
46  * The type identifiers provides a way to identify the type of an Item.
47  *
48  */
50 {
51  friend class StaticContext;
52 private:
53  zorba::TypeIdentifier_t theTypeIdentifier;
54  static zorba::IdentTypes::quantifier_t convertQuantifier(IdentTypes::Quantifier quantifier);
55 
56 public:
57  TypeIdentifier (const TypeIdentifier& aTypeIdentifier) : theTypeIdentifier(aTypeIdentifier.theTypeIdentifier) {}
58  TypeIdentifier (const zorba::TypeIdentifier_t& aZTypeIdentifier) : theTypeIdentifier(aZTypeIdentifier) {}
59 
62  const std::string getLocalName();
64  long getRefCount();
65  const std::string getUri();
66  bool isLocalNameWildcard();
67  bool isUriWildcard();
68 
69  static TypeIdentifier
71 
72  static TypeIdentifier
73  createAttributeType (const std::string &uri, bool uriWildcard, const std::string &localNameName, bool localNameWildcard, TypeIdentifier contentType, IdentTypes::Quantifier quantifier=IdentTypes::QUANT_ONE);
74 
75  static TypeIdentifier
77 
78  static TypeIdentifier
80 
81  static TypeIdentifier
82  createElementType (const std::string &uri, bool uriWildcard, const std::string &localName, bool localNameWildcard, TypeIdentifier contentType, IdentTypes::Quantifier quantifier=IdentTypes::QUANT_ONE);
83 
84  static TypeIdentifier
86 
87  static TypeIdentifier
89 
90  static TypeIdentifier
91  createNamedType (const std::string &uri, const std::string &localName, IdentTypes::Quantifier quantifier=IdentTypes::QUANT_ONE);
92 
93  static TypeIdentifier
95 
96  static TypeIdentifier
98 
99 }; // class TypeIdentifier
100 
101 
102 #endif
blog comments powered by Disqus