> The XQuery Processor
#include <zorba/item.h>
Public Member Functions | |
| void | close () |
| Free all resources aquired by this Item. | |
| Item | getAtomizationValue () const |
| Get the atomization value of the Item. | |
| bool | getBooleanValue () const |
| Get the bool value of the boolean Item. | |
| Item | getEBV () const |
| Get the effective boolean value of the Item. | |
| String | getLocalName () const |
| Get the value of a QName's local name. | |
| String | getNamespace () const |
| Get the (optional) value of a QName's namespace. | |
| String | getPrefix () const |
| Get the (optional) value of a QName's prefix. | |
| String | getStringValue () const |
| Get the string value of the Item. | |
| Item | getType () const |
| Get the type of the Item. | |
| bool | isAtomic () const |
| Check if the Item is an atomic Item. | |
| bool | isNaN () const |
| Check if the value of the Item is not a number (NaN). | |
| bool | isNode () const |
| Check if the Item is a node Item. | |
| bool | isNull () const |
| Check if the Item is null. | |
| bool | isNumeric () const |
| Check if the Item is a numeric Item. | |
| bool | isPosOrNegInf () const |
| Check if the value of the Item is positive or negative infinity. | |
| Item (store::Item *item) | |
| Constructor that is used to construct Items in the Zorba engine itself. | |
| Item (const Item &other) | |
| Copy constructor. | |
| Item () | |
| Default constructor. | |
| const Item & | operator= (store::Item *rhs) |
| Assingment operator that is used in the Zorba engine itself. | |
| const Item & | operator= (const Item &rhs) |
| Assingment operator. | |
| void | serialize (std::ostream &) const |
| Serialize the Item using the XML output method. | |
| ~Item () | |
| Destructor. | |
Friends | |
| class | Unmarshaller |
This class is the Zorba representation of an Item as defined in the XQuery 1.0 and XPath 2.0 Data Model (XDM); see http://www.w3.org/TR/xpath-datamodel/.
Instances of the XDM are a sequence, i.e. an ordered collection of zero or more items. In the Zorba API, a sequence is represented by the ItemSequence class.
The Item class is the union of all XQuery node and atomic types. The class provides functions to access the information of an Item. Note that not all functions are defined on every Item kind. If a function is called on an Item that does not provide the called function, an XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE error is raised.
Instances of the Item class are always passed by copy. To check whether a given Item is valid isNull() can be called which returns true if the given Item is not valid and false otherwise. A new atomic Item can be created using the ItemFactory. A new node Item should be created by the result of a query.
context.cpp, datamanager.cpp, external_functions.cpp, serialization.cpp, and simple.cpp.
Definition at line 45 of file item.h.
| zorba::Item::Item | ( | ) |
Default constructor.
| zorba::Item::Item | ( | const Item & | other | ) |
Copy constructor.
| zorba::Item::Item | ( | store::Item * | item | ) |
Constructor that is used to construct Items in the Zorba engine itself.
This constructor is for internal use only.
| zorba::Item::~Item | ( | ) |
Destructor.
| void zorba::Item::close | ( | ) |
Free all resources aquired by this Item.
After calling close() on an Item the Item is invalidated, i.e. a subsequent call to isNull() will return true.
Note that calling this function is usually not necessary because close() is implicitly called by the destructor. Calling close() is only necessary if the resources aquired by an Item should be released before the Item goes out of scope, i.e. the destructor is called.
Also note that this function is available for all types of Items.
| Item zorba::Item::getAtomizationValue | ( | ) | const |
Get the atomization value of the Item.
The atomization value is the value that is returned by atomization (see http://www.w3.org/TR/xquery/#id-atomization). Note that this function is available for all types of Items.
| ZorbaException | if an error occured. |
| bool zorba::Item::getBooleanValue | ( | ) | const |
Get the bool value of the boolean Item.
Note that this function is only available for Items of type boolean.
| ZorbaException | if an error occured, e.g. the Item is not of type boolean. |
| Item zorba::Item::getEBV | ( | ) | const |
Get the effective boolean value of the Item.
The effective boolean value is the result of applying the fn:boolean function on the Item (see http://www.w3.org/TR/xpath-functions/#func-boolean). Note that this function is available for all types of Items.
| ZorbaException | if an error occured. |
| String zorba::Item::getLocalName | ( | ) | const |
Get the value of a QName's local name.
Note that this function is only available for Items of type QName.
| ZorbaException | if an error occured, e.g. the Item is not a QName. |
| String zorba::Item::getNamespace | ( | ) | const |
Get the (optional) value of a QName's namespace.
Note that this function is only available for Items of type QName.
| ZorbaException | if an error occured, e.g. the Item is not a QName. |
| String zorba::Item::getPrefix | ( | ) | const |
Get the (optional) value of a QName's prefix.
Note that this function is only available for Items of type QName.
| ZorbaException | if an error occured, e.g. the Item is not a QName. |
| String zorba::Item::getStringValue | ( | ) | const |
Get the string value of the Item.
The string value is the string that is extracted by calling the fn:string function on the Item (see http://www.w3.org/TR/xpath-functions/#func-string). Note that this function is available for all types of Items.
| ZorbaException | if an error occured. |
| Item zorba::Item::getType | ( | ) | const |
Get the type of the Item.
See http://www.w3.org/TR/xpath-datamodel/#types. Note that this function is available for all types of Items.
| ZorbaException | if an error occured. |
| bool zorba::Item::isAtomic | ( | ) | const |
| bool zorba::Item::isNaN | ( | ) | const |
Check if the value of the Item is not a number (NaN).
Note that this function is only available for numeric Items (e.g. Double or Float).
| ZorbaException | if an error occured, e.g. the Item is not a numeric type. |
| bool zorba::Item::isNode | ( | ) | const |
| bool zorba::Item::isNull | ( | ) | const |
Check if the Item is null.
If this function returns true, the Item is not valid. Note that this function is available for all types of Items.
| bool zorba::Item::isNumeric | ( | ) | const |
| bool zorba::Item::isPosOrNegInf | ( | ) | const |
Check if the value of the Item is positive or negative infinity.
Note that this function is only available for numeric Items (e.g. Double or Float).
| ZorbaException | if an error occured, e.g. the Item is not a numeric type. |
| const Item& zorba::Item::operator= | ( | store::Item * | rhs | ) |
Assingment operator that is used in the Zorba engine itself.
This operator is for internal use only.
| void zorba::Item::serialize | ( | std::ostream & | ) | const |
Serialize the Item using the XML output method.
The function writes the result of serializing the Item as XML to the given output stream. Note that this function is available for all types of Items.
| ZorbaException | if an error occured. |