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 };
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