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. More... | |
XQuery | compileQuery (const std::string &aStr, StaticContext &aStaticContext) |
Creates and compiles an XQuery object using a StaticContext. More... | |
XQuery | compileQuery (const std::string &aStr, DiagnosticHandler *aDiagnosticHandler) |
Creates and compiles an XQuery object. More... | |
XQuery | compileQuery (const std::string &aStr, StaticContext &aStaticContext, DiagnosticHandler *aDiagnosticHandler) |
Creates and compiles an XQuery object using a StaticContext. More... | |
XQuery | compileQuery (const std::string &aStr, CompilerHints &aCompilerHints, DiagnosticHandler *aDiagnosticHandler) |
Creates and compiles an XQuery object using the given CompilerHints. More... | |
XQuery | compileQuery (ZorbaIOStream &stream) |
Creates and compiles an XQuery object. More... | |
XQuery | compileQuery (ZorbaIOStream &stream, StaticContext &aStaticContext) |
Creates and compiles an XQuery object using a StaticContext. More... | |
XQuery | createQuery () |
Creates an XQuery object. More... | |
StaticContext | createStaticContext () |
Creates a new StaticContext. More... | |
ItemFactory | getItemFactory () |
Gets the singleton instance of the ItemFactory. More... | |
int | getMajorVersion () |
Get information about the used version of Zorba. More... | |
int | getMinorVersion () |
Get information about the used version of Zorba. More... | |
int | getPatchVersion () |
Get information about the used version of Zorba. More... | |
std::string | getVersion () |
Get information about the used version of Zorba. More... | |
XmlDataManager | getXmlDataManager () |
Gets the singleton instance of the XmlDataManager object. More... | |
bool | isXQueryXSupported () |
Get a boolean value informing if XQueryX is supported. More... | |
void | shutdown () |
Releases all resources aquired by the Zorba XQuery Engine. More... | |
Zorba () | |
Zorba (const Zorba &aZorba) | |
Static Public Member Functions | |
static Zorba | getInstance (const Store &) |
Gets the singleton instance of the Zorba object. More... | |
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.
XQuery Zorba::compileQuery | ( | const std::string & | aStr) |
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.
aStr | the query string for the new XQuery object. |
aStaticContext | the StaticContext that contains information used for compiling the query. |
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.
aStr | the query string for the new XQuery object. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
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.
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. |
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.
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. |
XQuery Zorba::compileQuery | ( | ZorbaIOStream & | stream) |
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.
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. |
XQuery Zorba::createQuery | ( | ) |
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.
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.
ItemFactory Zorba::getItemFactory | ( | ) |
Gets the singleton instance of the ItemFactory.
int Zorba::getMajorVersion | ( | ) |
Get information about the used version of Zorba.
int Zorba::getMinorVersion | ( | ) |
Get information about the used version of Zorba.
int Zorba::getPatchVersion | ( | ) |
Get information about the used version of Zorba.
std::string Zorba::getVersion | ( | ) |
Get information about the used version of Zorba.
XmlDataManager Zorba::getXmlDataManager | ( | ) |
Gets the singleton instance of the XmlDataManager object.
bool Zorba::isXQueryXSupported | ( | ) |
Get 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.