Public Member Functions | Static Public Member Functions | List of all members
Zorba Class Reference

The Zorba class is the single point of access to the Zorba engine. More...

Public Member Functions

XQuery compileQuery (const std::string &aStr)
 Creates and compiles an XQuery object.
XQuery compileQuery (const std::string &aStr, StaticContext &aStaticContext)
 Creates and compiles an XQuery object using a StaticContext.
XQuery compileQuery (const std::string &aStr, DiagnosticHandler *aDiagnosticHandler)
 Creates and compiles an XQuery object.
XQuery compileQuery (const std::string &aStr, StaticContext &aStaticContext, DiagnosticHandler *aDiagnosticHandler)
 Creates and compiles an XQuery object using a StaticContext.
XQuery compileQuery (const std::string &aStr, CompilerHints &aCompilerHints, DiagnosticHandler *aDiagnosticHandler)
 Creates and compiles an XQuery object using the given CompilerHints.
XQuery compileQuery (ZorbaIOStream &stream)
 Creates and compiles an XQuery object.
XQuery compileQuery (ZorbaIOStream &stream, StaticContext &aStaticContext)
 Creates and compiles an XQuery object using a StaticContext.
XQuery createQuery ()
 Creates an XQuery object.
StaticContext createStaticContext ()
 Creates a new StaticContext.
ItemFactory getItemFactory ()
 Gets the singleton instance of the ItemFactory.
int getMajorVersion ()
 Get information about the used version of Zorba.
int getMinorVersion ()
 Get information about the used version of Zorba.
int getPatchVersion ()
 Get information about the used version of Zorba.
std::string getVersion ()
 Get information about the used version of Zorba.
XmlDataManager getXmlDataManager ()
 Gets the singleton instance of the XmlDataManager object.
bool isXQueryXSupported ()
 Get a boolean value informing if XQueryX is supported.
void shutdown ()
 Releases all resources aquired by the Zorba XQuery Engine.
 Zorba ()
 Zorba (const Zorba &aZorba)

Static Public Member Functions

static Zorba getInstance (const Store &)
 Gets the singleton instance of the Zorba object.

Detailed Description

The Zorba class is the single point of access to the Zorba engine.

There exists one instance of the Zorba class per process. It can be used to (1) create and compile queries, (2) create static contexts, (3) provides access to the XmlDataManager, (4) provides access to the ItemFactory, and (5) provides access to the PropertiesGlobal.

Definition at line 28 of file Zorba.h.

Constructor & Destructor Documentation

Zorba::Zorba ( )
inline

Definition at line 34 of file Zorba.h.

Zorba::Zorba ( const Zorba aZorba)
inline

Definition at line 35 of file Zorba.h.

Member Function Documentation

XQuery Zorba::compileQuery ( const std::string &  aStr)

Creates and compiles an XQuery object.

This methods creates an XQuery object and compiles the query string passed to this method.

Parameters
aStrthe query string for the new XQuery object.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( const std::string &  aStr,
StaticContext aStaticContext 
)

Creates and compiles an XQuery object using a StaticContext.

This methods creates an XQuery object and compiles the query string passed to this method. Compilation is done using the information contained in the StaticContext that is passed as parameter.

Parameters
aStrthe query string for the new XQuery object.
aStaticContextthe StaticContext that contains information used for compiling the query.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( const std::string &  aStr,
DiagnosticHandler aDiagnosticHandler 
)

Creates and compiles an XQuery object.

This methods creates an XQuery object and compiles the query string passed to this method.

Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors.

Parameters
aStrthe query string for the new XQuery object.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( const std::string &  aStr,
StaticContext aStaticContext,
DiagnosticHandler aDiagnosticHandler 
)

Creates and compiles an XQuery object using a StaticContext.

This methods creates an XQuery object and compiles the query string passed to this method. Compilation is done using the information contained in the StaticContext that is passed as parameter.

Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors.

Parameters
aStrthe query string for the new XQuery object.
aStaticContextthe StaticContext that contains information used for compiling the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( const std::string &  aStr,
CompilerHints &  aCompilerHints,
DiagnosticHandler aDiagnosticHandler 
)

Creates and compiles an XQuery object using the given CompilerHints.

This methods creates an XQuery object and compiles the query string passed to this method. Compilation and optimization is done with respect to the given CompilerHints.

Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors.

Parameters
aStrthe query string for the new XQuery object.
aCompilerHintsthe CompilerHints used to compile the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( ZorbaIOStream stream)

Creates and compiles an XQuery object.

This methods creates an XQuery object and compiles the query string passed to this method.

Parameters
streamthe query stream, this object is an extension to stream data accross the API.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::compileQuery ( ZorbaIOStream stream,
StaticContext aStaticContext 
)

Creates and compiles an XQuery object using a StaticContext.

This methods creates an XQuery object and compiles the query string passed to this method. Compilation is done using the information contained in the StaticContext that is passed as parameter.

Parameters
streamthe query stream, this object is an extension to stream data accross the API.
aStaticContextthe StaticContext that contains information used for compiling the query.
Returns
XQuery the newly created and compiled XQuery object.
XQuery Zorba::createQuery ( )

Creates an XQuery object.

This methods creates an XQuery object without implicitliy assigning it a query. An object returned by this method can be compiled (see compileQuery).

Returns
XQuery the newly created XQuery object.
StaticContext Zorba::createStaticContext ( )

Creates a new StaticContext.

The method returns a StaticContext object that can be used for compiling a query. Instances of the StaticContext class are returned as a smart pointer.

Returns
StaticContext_t a new StaticContext object.
static Zorba Zorba::getInstance ( const Store )
static

Gets the singleton instance of the Zorba object.

The Zorba object provides factory methods for creating and/or compiling XQuery objects, creating StaticContext objects, and accessing components as, for example, the ItemFactory or the XmlDataManager.

The first time this function is called, the Zorba Engine is initialized. Thereby, it initializes all the libraries that are used in the system, i.e. ICU, libxml2, xerces, and libcurl.

Returns
Zorba the singleton Zorba object
ItemFactory Zorba::getItemFactory ( )

Gets the singleton instance of the ItemFactory.

Returns
ItemFactory the singleton instance of the ItemFactory.
int Zorba::getMajorVersion ( )

Get information about the used version of Zorba.

Returns
Version information about the used Zorba version.
int Zorba::getMinorVersion ( )

Get information about the used version of Zorba.

Returns
Version information about the used Zorba version.
int Zorba::getPatchVersion ( )

Get information about the used version of Zorba.

Returns
Version information about the used Zorba version.
std::string Zorba::getVersion ( )

Get information about the used version of Zorba.

Returns
Version information about the used Zorba version.
XmlDataManager Zorba::getXmlDataManager ( )

Gets the singleton instance of the XmlDataManager object.

Returns
XmlDataManager the singleton instance of the XmlDataManager.
bool Zorba::isXQueryXSupported ( )

Get a boolean value informing if XQueryX is supported.

Returns
A boolean value informing if XQueryX is supported.
void Zorba::shutdown ( )

Releases all resources aquired by the Zorba XQuery Engine.

Also releases resources aquired by the libraries used (i.e. icu, libxml2, xerces, libcurl).

Before calling shutdown, all xquery objects, items, contexts, ... have to be closed or gone out of scope; otherwise this call may fail.

After shutdown has been called, any calls to zorba are invalid.

getInstance may be used to reinitialize the engine.


The documentation for this class was generated from the following file:
blog comments powered by Disqus