SourceForge.net Logo

XQilla.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2008
00003  *     DecisionSoft Limited. All rights reserved.
00004  * Copyright (c) 2004-2008
00005  *     Oracle. All rights reserved.
00006  *
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  *
00011  *     http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  *
00019  * $Id: XQilla.hpp 475 2008-01-08 18:47:44Z jpcs $
00020  */
00021 
00022 #ifndef _XQILLA_07637_HPP
00023 #define _XQILLA_07637_HPP
00024 
00025 #include <xqilla/framework/XQillaExport.hpp>
00026 
00027 #include <xercesc/framework/MemoryManager.hpp>
00028 #include <xercesc/util/PlatformUtils.hpp>
00029 #include <xercesc/util/XMemory.hpp>
00030 
00031 class DynamicContext;
00032 class XQQuery;
00033 class XPath2MemoryManager;
00034 class XQillaConfiguration;
00035 
00036 XERCES_CPP_NAMESPACE_BEGIN
00037 class InputSource;
00038 class XMLBuffer;
00039 XERCES_CPP_NAMESPACE_END
00040 
00048 class XQILLA_API XQilla : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
00049 {
00050 public:
00052   enum Flags {
00053     NO_STATIC_RESOLUTION = 0x1, 
00054     NO_ADOPT_CONTEXT = 0x2 
00055   };
00056 
00058   enum Language {
00059     XQUERY   = 0x00,
00060     XPATH2   = 0x01,
00061     FULLTEXT = 0x02,
00062     UPDATE   = 0x04,
00063 
00064     XQUERY_FULLTEXT        = (XQUERY | FULLTEXT),
00065     XPATH2_FULLTEXT        = (XPATH2 | FULLTEXT),
00066     XQUERY_UPDATE          = (XQUERY | UPDATE),
00067     XQUERY_FULLTEXT_UPDATE = (XQUERY | FULLTEXT | UPDATE)
00068   };
00069                                                                                                                                                               
00076   XQilla(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr = 0);
00077 
00082   ~XQilla();
00083 
00085         // @{
00086 
00103   static XQQuery* parse(const XMLCh* query,
00104                         DynamicContext* context = 0,
00105                         const XMLCh* queryFile = NULL,
00106                         unsigned int flags = 0,
00107                         XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00108                         XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00109 
00124   static XQQuery* parse(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc,
00125                         DynamicContext* context = 0,
00126                         unsigned int flags = 0,
00127                         XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00128                         XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00129 
00144   static XQQuery* parseFromURI(const XMLCh* queryFile,
00145                                DynamicContext* context = 0,
00146                                unsigned int flags = 0,
00147                                XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00148                                XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00149 
00151 
00153   // @{
00154 
00160   static DynamicContext *createContext(Language language = XQUERY,
00161                                        XQillaConfiguration *conf = 0,
00162                                        XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00163                                        XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00164 
00166 
00167 private:
00168   static bool readQuery(const XMLCh* queryFile, 
00169                         XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr, 
00170                         XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00171   static bool readQuery(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc, 
00172                         XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr, 
00173                         XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00174 };
00175 
00176 #endif

Generated on Mon Apr 28 16:40:48 2008 for XQilla Simple API by  doxygen 1.5.1