v1.1.0
This commit is contained in:
parent
625a590fae
commit
9b71614762
1556 changed files with 70210 additions and 50502 deletions
|
@ -8,15 +8,11 @@
|
|||
*
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* $Id: XQQuery.hpp,v 1.16.2.1 2007/01/03 19:19:51 jpcs Exp $
|
||||
* $Id: XQQuery.hpp,v 1.18 2007/07/10 16:28:59 jpcs Exp $
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// XQQuery.h: interface for the XQQuery class.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFXQ_XQUERY_H__FAA9933A_2F10_49A4_93A2_857E2A8C48E3__INCLUDED_)
|
||||
#define AFXQ_XQUERY_H__FAA9933A_2F10_49A4_93A2_857E2A8C48E3__INCLUDED_
|
||||
#ifndef XQQUERY_HPP
|
||||
#define XQQUERY_HPP
|
||||
|
||||
#include <xqilla/framework/XQillaExport.hpp>
|
||||
#include <vector>
|
||||
|
@ -26,7 +22,6 @@
|
|||
#include <xqilla/runtime/ResultImpl.hpp>
|
||||
#include <xqilla/runtime/LazySequenceResult.hpp>
|
||||
#include <xqilla/context/StaticContext.hpp>
|
||||
#include <xqilla/simple-api/XQilla.hpp>
|
||||
|
||||
class DynamicContext;
|
||||
class XQUserFunction;
|
||||
|
@ -72,7 +67,8 @@ public:
|
|||
XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager) const;
|
||||
|
||||
/**
|
||||
* Executes the query using the given DynamicContext.
|
||||
* Executes the query using the given DynamicContext, returning
|
||||
* a lazy iterator over the results.
|
||||
*
|
||||
* @param context The DynamicContext to use to execute the
|
||||
* query. This contains runtime values for variables, the value
|
||||
|
@ -85,6 +81,18 @@ public:
|
|||
*/
|
||||
Result execute(DynamicContext* context) const;
|
||||
|
||||
/**
|
||||
* Executes the query using the given DynamicContext, sending
|
||||
* the output of the query to the given EventHandler.
|
||||
*
|
||||
* @param context The DynamicContext to use to execute the
|
||||
* query. This contains runtime values for variables, the value
|
||||
* of the context item, and other relevent information.
|
||||
*
|
||||
* @exception XQException If a runtime error occurs
|
||||
*/
|
||||
void execute(EventHandler *events, DynamicContext* context) const;
|
||||
|
||||
/**
|
||||
* Perform static resolution on the query. This operation is not
|
||||
* thread safe, and should only be performed once.
|
||||
|
@ -120,10 +128,10 @@ public:
|
|||
*/
|
||||
void staticTyping(StaticContext *context = 0);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
/** @name Query Information */
|
||||
// @{
|
||||
/** @name Query Information */
|
||||
// @{
|
||||
|
||||
/// Returns the expression that was parsed to create this XQQuery object.
|
||||
const XMLCh* getQueryText() const;
|
||||
|
@ -131,10 +139,10 @@ public:
|
|||
/// Returns the query plan as XML. This is designed for debug and informative purposes only.
|
||||
std::string getQueryPlan() const;
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
/** @name Getters and Setters */
|
||||
// @{
|
||||
/** @name Getters and Setters */
|
||||
// @{
|
||||
|
||||
/// Get the query body as an ASTNode
|
||||
ASTNode* getQueryBody() const;
|
||||
|
@ -161,10 +169,10 @@ public:
|
|||
|
||||
const DynamicContext *getStaticContext() const { return m_context; }
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
/** @name Module Methods */
|
||||
// @{
|
||||
/** @name Module Methods */
|
||||
// @{
|
||||
|
||||
/// Sets whether this query is a module or not
|
||||
void setIsLibraryModule(bool bIsModule=true);
|
||||
|
@ -175,10 +183,9 @@ public:
|
|||
/// Gets the module taget namespace for this query
|
||||
const XMLCh* getModuleTargetNamespace() const;
|
||||
/// Performs a module import from the given target namespace and locations
|
||||
void importModule(XQilla::Language language, const XMLCh* szUri,
|
||||
VectorOfStrings* locations, StaticContext* context);
|
||||
void importModule(const XMLCh* szUri, VectorOfStrings* locations, StaticContext* context, const LocationInfo *location);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
private:
|
||||
/// Top level lazy result iterator
|
||||
|
@ -196,19 +203,6 @@ private:
|
|||
bool _toDo;
|
||||
};
|
||||
|
||||
/// Top level debug lazy result iterator
|
||||
class DebugResult : public LazySequenceResult
|
||||
{
|
||||
public:
|
||||
DebugResult(const XQQuery *query, DynamicContext *context);
|
||||
|
||||
void getResult(Sequence &toFill, DynamicContext *context) const;
|
||||
std::string asString(DynamicContext *context, int indent) const;
|
||||
|
||||
private:
|
||||
const XQQuery *_query;
|
||||
};
|
||||
|
||||
private:
|
||||
/// Private constructor - Can be accessed by an XQilla object, as it is a friend.
|
||||
XQQuery(const XMLCh* queryText, DynamicContext *context, bool contextOwned = false,
|
||||
|
@ -218,6 +212,8 @@ private:
|
|||
XQQuery(const XQQuery &);
|
||||
XQQuery &operator=(const XQQuery &);
|
||||
|
||||
void executeProlog(DynamicContext *context) const;
|
||||
|
||||
private:
|
||||
/// The memory manager used to create this object
|
||||
XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* m_memMgr;
|
||||
|
@ -238,8 +234,7 @@ private:
|
|||
ImportedModules m_importedModules;
|
||||
|
||||
friend class QueryResult;
|
||||
friend class DebugResult;
|
||||
friend class XQilla;
|
||||
};
|
||||
|
||||
#endif // !defined(AFXQ_XQUERY_H__FAA9933A_2F10_49A4_93A2_857E2A8C48E3__INCLUDED_)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue