00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 DEBUG_QUERY = 0x4,
00056 NO_OPTIMIZATION = 0x8
00057 };
00058
00060 enum Language {
00061 XQUERY = 0x00,
00062 XPATH2 = 0x01,
00063 FULLTEXT = 0x02,
00064 UPDATE = 0x04,
00065 EXTENSIONS = 0x08,
00066 XSLT2 = 0x10,
00067
00068 XQUERY_FULLTEXT = (XQUERY | FULLTEXT),
00069 XPATH2_FULLTEXT = (XPATH2 | FULLTEXT),
00070 XQUERY_UPDATE = (XQUERY | UPDATE),
00071 XQUERY_FULLTEXT_UPDATE = (XQUERY | FULLTEXT | UPDATE),
00072 XSLT2_FULLTEXT = (XSLT2 | FULLTEXT)
00073 };
00074
00081 XQilla(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr = 0);
00082
00087 ~XQilla();
00088
00090
00091
00108 static XQQuery* parse(const XMLCh* query,
00109 DynamicContext* context = 0,
00110 const XMLCh* queryFile = NULL,
00111 unsigned int flags = 0,
00112 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00113 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00114
00129 static XQQuery* parse(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc,
00130 DynamicContext* context = 0,
00131 unsigned int flags = 0,
00132 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00133 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00134
00149 static XQQuery* parseFromURI(const XMLCh* queryFile,
00150 DynamicContext* context = 0,
00151 unsigned int flags = 0,
00152 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00153 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00154
00156
00158
00159
00165 static DynamicContext *createContext(Language language = XQUERY,
00166 XQillaConfiguration *conf = 0,
00167 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00168 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00169
00171
00172 private:
00173 static bool readQuery(const XMLCh* queryFile,
00174 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr,
00175 XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00176 static bool readQuery(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc,
00177 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr,
00178 XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00179 };
00180
00181 #endif