> The XQuery Processor
00001 /* 00002 * Copyright 2006-2008 The FLWOR Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #ifndef ZORBA_TYPES_TYPEIDENT_H 00017 #define ZORBA_TYPES_TYPEIDENT_H 00018 00019 #include <boost/shared_ptr.hpp> 00020 #include <zorba/api_shared_types.h> 00021 #include <zorba/identtypes.h> 00022 #include <zorba/zorbastring.h> 00023 00024 namespace zorba { 00025 00026 /** \brief Type identifiers 00027 * 00028 * The type identifiers are not used, yet. 00029 */ 00030 class TypeIdentifier { 00031 public: 00032 /** \brief Destructor 00033 */ 00034 ~TypeIdentifier(); 00035 00036 static 00037 boost::shared_ptr<TypeIdentifier> 00038 createNamedType( 00039 const String& uri, 00040 const String& localName, 00041 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00042 ); 00043 00044 static 00045 boost::shared_ptr<TypeIdentifier> 00046 createElementType( 00047 const String& uri, 00048 bool uriWildcard, 00049 const String& localName, 00050 bool localNameWildcard, 00051 boost::shared_ptr<TypeIdentifier> contentType, 00052 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00053 ); 00054 00055 static 00056 boost::shared_ptr<TypeIdentifier> 00057 createAttributeType( 00058 const String& uri, 00059 bool uriWildcard, 00060 const String& localNameName, 00061 bool localNameWildcard, 00062 boost::shared_ptr<TypeIdentifier> contentType, 00063 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00064 ); 00065 00066 static 00067 boost::shared_ptr<TypeIdentifier> 00068 createDocumentType( 00069 boost::shared_ptr<TypeIdentifier> contentType, 00070 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00071 ); 00072 00073 static 00074 boost::shared_ptr<TypeIdentifier> 00075 createPIType( 00076 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00077 ); 00078 00079 static 00080 boost::shared_ptr<TypeIdentifier> 00081 createTextType( 00082 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00083 ); 00084 00085 static 00086 boost::shared_ptr<TypeIdentifier> 00087 createCommentType( 00088 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00089 ); 00090 00091 static 00092 boost::shared_ptr<TypeIdentifier> 00093 createAnyNodeType( 00094 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00095 ); 00096 00097 static 00098 boost::shared_ptr<TypeIdentifier> 00099 createItemType( 00100 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00101 ); 00102 00103 static 00104 boost::shared_ptr<TypeIdentifier> 00105 createEmptyType(); 00106 00107 IdentTypes::kind_t 00108 getKind() const; 00109 00110 IdentTypes::quantifier_t 00111 getQuantifier() const; 00112 00113 const String& 00114 getUri() const; 00115 00116 bool 00117 isUriWildcard() const; 00118 00119 const String& 00120 getLocalName() const; 00121 00122 bool 00123 isLocalNameWildcard() const; 00124 00125 boost::shared_ptr<TypeIdentifier> 00126 getContentType() const; 00127 00128 private: 00129 TypeIdentifier(); 00130 00131 IdentTypes::kind_t m_kind; 00132 IdentTypes::quantifier_t m_quantifier; 00133 String m_uri; 00134 bool m_uriWildcard; 00135 String m_localName; 00136 bool m_localNameWildcard; 00137 boost::shared_ptr<TypeIdentifier> m_contentType; 00138 }; 00139 00140 } /* namespace zorba */ 00141 00142 #endif /* ZORBA_TYPES_TYPEIDENT_H */ 00143 /* vim:set ts=2 sw=2: */