Zorba

#include </home/jenkins/.jenkins/ubuntu-remote-queue/jenkins-BuildZorbaUbuntu-462/source/zorba/swig/Zorba.h>

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.

Private Attributes

zorba::Zorba *

theZorba

Private Functions

Zorba(zorba::Zorba *aZorba)

Public 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()

Returns an XmlDataManager.

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)

Public Static Functions

Zorba

getInstance(const Store &)

Gets the singleton instance of the Zorba object.

Private Attributes

theZorba

zorba::Zorba * theZorba

Private Functions

Zorba

 Zorba(zorba::Zorba *aZorba)

Public Functions

compileQuery

XQuery 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

aStr the query string for the new XQuery object.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

aStr the query string for the new XQuery object.
aStaticContext the StaticContext that contains information used for compiling the query.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

aStr the query string for the new XQuery object.
aDiagnosticHandler the DiagnosticHandler to which errors should be reported.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

aStr the query string for the new XQuery object.
aStaticContext the StaticContext that contains information used for compiling the query.
aDiagnosticHandler the DiagnosticHandler to which errors should be reported.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

aStr the query string for the new XQuery object.
aCompilerHints the CompilerHints used to compile the query.
aDiagnosticHandler the DiagnosticHandler to which errors should be reported.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

stream the query stream, this object is an extension to stream data accross the API.

Returns

XQuery the newly created and compiled XQuery object.

compileQuery

XQuery 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

stream the query stream, this object is an extension to stream data accross the API.
aStaticContext the StaticContext that contains information used for compiling the query.

Returns

XQuery the newly created and compiled XQuery object.

createQuery

XQuery 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.

createStaticContext

StaticContext 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.

getItemFactory

ItemFactory getItemFactory()

Gets the singleton instance of the ItemFactory.

Returns

ItemFactory the singleton instance of the ItemFactory.

getMajorVersion

int getMajorVersion()

Get information about the used version of Zorba.

Returns

Version information about the used Zorba version.

getMinorVersion

int getMinorVersion()

Get information about the used version of Zorba.

Returns

Version information about the used Zorba version.

getPatchVersion

int getPatchVersion()

Get information about the used version of Zorba.

Returns

Version information about the used Zorba version.

getVersion

std::string getVersion()

Get information about the used version of Zorba.

Returns

Version information about the used Zorba version.

getXmlDataManager

XmlDataManager getXmlDataManager()

isXQueryXSupported

bool isXQueryXSupported()

Get a boolean value informing if XQueryX is supported.

Returns

A boolean value informing if XQueryX is supported.

shutdown

void 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.

Zorba

 Zorba()

Zorba

 Zorba(const Zorba &aZorba)

Public Static Functions

getInstance

Zorba getInstance(const Store &)

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