00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _XQILLA_07637_HPP
00015 #define _XQILLA_07637_HPP
00016
00017 #include <xqilla/framework/XQillaExport.hpp>
00018
00019 #include <xercesc/framework/MemoryManager.hpp>
00020 #include <xercesc/util/PlatformUtils.hpp>
00021 #include <xercesc/util/XMemory.hpp>
00022
00023 class DynamicContext;
00024 class XQQuery;
00025 class XPath2MemoryManager;
00026 class XQillaConfiguration;
00027
00028 XERCES_CPP_NAMESPACE_BEGIN
00029 class InputSource;
00030 class XMLBuffer;
00031 XERCES_CPP_NAMESPACE_END
00032
00040 class XQILLA_API XQilla : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
00041 {
00042 public:
00044 enum Flags {
00045 NO_STATIC_RESOLUTION = 0x1,
00046 NO_ADOPT_CONTEXT = 0x2
00047 };
00048
00050 enum Language {
00051 XQUERY = 0x00,
00052 XPATH2 = 0x01,
00053 FULLTEXT = 0x02,
00054 UPDATE = 0x04,
00055
00056 XQUERY_FULLTEXT = (XQUERY | FULLTEXT),
00057 XPATH2_FULLTEXT = (XPATH2 | FULLTEXT),
00058 XQUERY_UPDATE = (XQUERY | UPDATE),
00059 XQUERY_FULLTEXT_UPDATE = (XQUERY | FULLTEXT | UPDATE)
00060 };
00061
00068 XQilla(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr = 0);
00069
00074 ~XQilla();
00075
00077
00078
00095 static XQQuery* parse(const XMLCh* query,
00096 DynamicContext* context = 0,
00097 const XMLCh* queryFile = NULL,
00098 unsigned int flags = 0,
00099 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00100 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00101
00116 static XQQuery* parse(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc,
00117 DynamicContext* context = 0,
00118 unsigned int flags = 0,
00119 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00120 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00121
00136 static XQQuery* parseFromURI(const XMLCh* queryFile,
00137 DynamicContext* context = 0,
00138 unsigned int flags = 0,
00139 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00140 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00141
00143
00145
00146
00152 static DynamicContext *createContext(Language language = XQUERY,
00153 XQillaConfiguration *conf = 0,
00154 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00155 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager);
00156
00158
00159 private:
00160 static bool readQuery(const XMLCh* queryFile,
00161 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr,
00162 XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00163 static bool readQuery(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource& querySrc,
00164 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr,
00165 XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer& queryText);
00166 };
00167
00168 #endif