> 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 <zorba/config.h> 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 * Note: This class is reference counted. When writing multi-threaded clients, 00031 * it is the responibility of the client code to synchronize assignments to the 00032 * SmartPtr holding this object. 00033 */ 00034 class ZORBA_EXTERN_DECL TypeIdentifier : public SmartObject { 00035 public: 00036 /** \brief Destructor 00037 */ 00038 ~TypeIdentifier(); 00039 00040 static 00041 TypeIdentifier_t 00042 createNamedType( 00043 const String& uri, 00044 const String& localName, 00045 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00046 ); 00047 00048 static 00049 TypeIdentifier_t 00050 createElementType( 00051 const String& uri, 00052 bool uriWildcard, 00053 const String& localName, 00054 bool localNameWildcard, 00055 TypeIdentifier_t contentType, 00056 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00057 ); 00058 00059 static 00060 TypeIdentifier_t 00061 createAttributeType( 00062 const String& uri, 00063 bool uriWildcard, 00064 const String& localNameName, 00065 bool localNameWildcard, 00066 TypeIdentifier_t contentType, 00067 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00068 ); 00069 00070 static 00071 TypeIdentifier_t 00072 createDocumentType( 00073 TypeIdentifier_t contentType, 00074 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00075 ); 00076 00077 static 00078 TypeIdentifier_t 00079 createPIType( 00080 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00081 ); 00082 00083 static 00084 TypeIdentifier_t 00085 createTextType( 00086 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00087 ); 00088 00089 static 00090 TypeIdentifier_t 00091 createCommentType( 00092 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00093 ); 00094 00095 static 00096 TypeIdentifier_t 00097 createAnyNodeType( 00098 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00099 ); 00100 00101 static 00102 TypeIdentifier_t 00103 createItemType( 00104 IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE 00105 ); 00106 00107 static 00108 TypeIdentifier_t 00109 createEmptyType(); 00110 00111 IdentTypes::kind_t 00112 getKind() const; 00113 00114 IdentTypes::quantifier_t 00115 getQuantifier() const; 00116 00117 const String& 00118 getUri() const; 00119 00120 bool 00121 isUriWildcard() const; 00122 00123 const String& 00124 getLocalName() const; 00125 00126 bool 00127 isLocalNameWildcard() const; 00128 00129 TypeIdentifier_t 00130 getContentType() const; 00131 00132 private: 00133 TypeIdentifier(); 00134 00135 IdentTypes::kind_t m_kind; 00136 IdentTypes::quantifier_t m_quantifier; 00137 String m_uri; 00138 bool m_uriWildcard; 00139 String m_localName; 00140 bool m_localNameWildcard; 00141 #ifdef WIN32 00142 template class ZORBA_EXTERN_DECL zorba::SmartPtr<TypeIdentifier>; 00143 #endif 00144 TypeIdentifier_t m_contentType; 00145 }; 00146 00147 } /* namespace zorba */ 00148 00149 #endif /* ZORBA_TYPES_TYPEIDENT_H */ 00150 /* vim:set ts=2 sw=2: */