NCBI C++ ToolKit
|
Search Toolkit Book for xslt::xpath_object
The xslt::xpath_object class is used to store extension function arguments and return values. More...
#include <misc/xmlwrapp/xpath_object.hpp>
Public Types | |
typedef std::vector< xml::node > | type_node_source |
Source of nodes to construct xpath_object of the nodeset type. More... | |
Public Member Functions | |
xpath_object () | |
Create a new xslt::xpath_object object. More... | |
~xpath_object () | |
Destroy the object and clean up the memory. More... | |
xpath_object (const xpath_object &other) | |
Create a new xslt::xpath_object object using another as a template. More... | |
xpath_object & | operator= (const xpath_object &other) |
Create a copy of the xslt::xpath_object object. More... | |
xpath_object (xpath_object &&other) | |
Moving constructor. More... | |
xpath_object & | operator= (xpath_object &&other) |
Moving assignment. More... | |
xpath_object (const char *value) | |
Create a new xslt::xpath_object object of the string type. More... | |
xpath_object (bool value) | |
Create a new xslt::xpath_object object of the bool type. More... | |
xpath_object (int value) | |
Create a new xslt::xpath_object object of the integer type. More... | |
xpath_object (double value) | |
Create a new xslt::xpath_object object of the float type. More... | |
xpath_object (const xml::node &value) | |
Create a new xslt::xpath_object object of the node type. More... | |
xpath_object (const xml::node_set &value) | |
Create a new xslt::xpath_object of the nodeset type. More... | |
xpath_object (const type_node_source &value) | |
Create a new xslt::xpath_object of the nodeset type. More... | |
std::string | get_as_string (void) const |
Provide the object value as a string. More... | |
bool | get_as_bool (void) const |
Provide the object value as a boolean. More... | |
int | get_as_int (void) const |
Provide the object value as an integer. More... | |
double | get_as_float (void) const |
Provide the object value as a float. More... | |
xml::node & | get_as_node (void) const |
Provide the object value as a node. More... | |
xml::node_set | get_as_node_set (void) const |
Provide the object value as a node set. More... | |
xpath_object_type | get_type (void) const |
Provides the object type. More... | |
Private Member Functions | |
void * | get_object (void) const |
void | revoke_ownership (void) const |
void | set_from_xslt (void) const |
bool | get_from_xslt (void) const |
void | test_int_convertability (double val) const |
xpath_object (void *) | |
friend | void ::xslt_ext_func_cb (void *, int) |
Private Attributes | |
impl::xpath_obj_impl * | pimpl_ |
Friends | |
class | extension_function |
class | extension_element |
The xslt::xpath_object class is used to store extension function arguments and return values.
Definition at line 73 of file xpath_object.hpp.
typedef std::vector<xml::node> xslt::xpath_object::type_node_source |
Source of nodes to construct xpath_object of the nodeset type.
Definition at line 77 of file xpath_object.hpp.
xslt::xpath_object::xpath_object | ( | ) |
Create a new xslt::xpath_object object.
Definition at line 112 of file xpath_object.cpp.
References pimpl_.
xslt::xpath_object::~xpath_object | ( | ) |
Destroy the object and clean up the memory.
Definition at line 119 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::dec_ref(), NULL, and pimpl_.
xslt::xpath_object::xpath_object | ( | const xpath_object & | other | ) |
Create a new xslt::xpath_object object using another as a template.
The new object refers to the same xpath_object as the template one.
other | Another xslt::xpath_object object. |
Definition at line 125 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::inc_ref(), and pimpl_.
xslt::xpath_object::xpath_object | ( | xpath_object && | other | ) |
Moving constructor.
other | The other xpath object. |
Definition at line 141 of file xpath_object.cpp.
References NULL.
xslt::xpath_object::xpath_object | ( | const char * | value | ) |
Create a new xslt::xpath_object object of the string type.
value | String to be used as the xpath_object value. |
Definition at line 158 of file xpath_object.cpp.
References NULL, pimpl_, and rapidjson::value.
xslt::xpath_object::xpath_object | ( | bool | value | ) |
Create a new xslt::xpath_object object of the bool type.
value | Boolean to be used as the xpath_object value. |
Definition at line 180 of file xpath_object.cpp.
References NULL, pimpl_, and rapidjson::value.
xslt::xpath_object::xpath_object | ( | int | value | ) |
Create a new xslt::xpath_object object of the integer type.
value | Integer to be used as the xpath_object value. |
Definition at line 195 of file xpath_object.cpp.
References NULL, pimpl_, and rapidjson::value.
xslt::xpath_object::xpath_object | ( | double | value | ) |
Create a new xslt::xpath_object object of the float type.
value | Double to be used as the xpath_object value. |
Definition at line 210 of file xpath_object.cpp.
References NULL, pimpl_, and rapidjson::value.
Create a new xslt::xpath_object object of the node type.
value | xml::node to be used as the xpath_object value. |
Definition at line 225 of file xpath_object.cpp.
References xslt::init::get_allow_extension_functions_leak(), xml::node::get_node_data(), xslt::kCouldNotCopyNode, NULL, and pimpl_.
xslt::xpath_object::xpath_object | ( | const xml::node_set & | value | ) |
Create a new xslt::xpath_object of the nodeset type.
value | xml::node_set to be used as a source of nodes. |
Definition at line 262 of file xpath_object.cpp.
References xml::node_set::begin(), xml::node_set::end(), xslt::init::get_allow_extension_functions_leak(), xml::node::get_node_data(), xslt::kCouldNotCopyNode, xslt::kCouldNotCreateNodeSet, xslt::kCouldNotCreateXpathNodeSet, NULL, and pimpl_.
xslt::xpath_object::xpath_object | ( | const type_node_source & | value | ) |
Create a new xslt::xpath_object of the nodeset type.
value | container of nodes as a source of nodes. |
Definition at line 319 of file xpath_object.cpp.
References xslt::init::get_allow_extension_functions_leak(), xslt::kCouldNotCopyNode, xslt::kCouldNotCreateNodeSet, xslt::kCouldNotCreateXpathNodeSet, NULL, pimpl_, and rapidjson::value.
|
private |
Definition at line 560 of file xpath_object.cpp.
bool xslt::xpath_object::get_as_bool | ( | void | ) | const |
Provide the object value as a boolean.
It tries to make a conversion if needed.
Throws | xslt::exception in case of problems. |
Definition at line 398 of file xpath_object.cpp.
References copy(), xslt::kCannotCopyXpathObject, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, and pimpl_.
double xslt::xpath_object::get_as_float | ( | void | ) | const |
Provide the object value as a float.
It tries to make a conversion if needed.
Throws | xslt::exception in case of problems. |
Definition at line 449 of file xpath_object.cpp.
References copy(), xslt::kCannotCopyXpathObject, xslt::kConverToNumberFailed, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, and pimpl_.
int xslt::xpath_object::get_as_int | ( | void | ) | const |
Provide the object value as an integer.
It tries to make a conversion if needed.
Throws | xslt::exception in case of problems. |
Definition at line 419 of file xpath_object.cpp.
References copy(), xslt::kCannotCopyXpathObject, xslt::kConverToNumberFailed, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, pimpl_, and test_int_convertability().
xml::node & xslt::xpath_object::get_as_node | ( | void | ) | const |
Provide the object value as a node.
Throws | xslt::exception in case of problems. |
Definition at line 470 of file xpath_object.cpp.
References xml::node_set::begin(), xslt::kUnexpectedXpathObjectType, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, xml::node_set::pimpl_, pimpl_, and xml::impl::nset_impl::set_ownership().
xml::node_set xslt::xpath_object::get_as_node_set | ( | void | ) | const |
Provide the object value as a node set.
Throws | xslt::exception in case of problems. |
Definition at line 489 of file xpath_object.cpp.
References xslt::kUnexpectedXpathObjectType, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, xml::node_set::pimpl_, pimpl_, and xml::impl::nset_impl::set_ownership().
std::string xslt::xpath_object::get_as_string | ( | void | ) | const |
Provide the object value as a string.
It tries to make a conversion if needed.
Throws | xslt::exception in case of problems. |
Definition at line 377 of file xpath_object.cpp.
References copy(), xslt::kCannotCopyXpathObject, xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, pimpl_, and string.
|
private |
Definition at line 545 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::from_xslt_, and pimpl_.
Referenced by xslt::extension_function::set_return_value().
|
private |
Definition at line 530 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::obj_, and pimpl_.
Referenced by xslt::extension_function::set_return_value().
xpath_object_type xslt::xpath_object::get_type | ( | void | ) | const |
Provides the object type.
Throws | xslt::exception in case of problems. |
Definition at line 504 of file xpath_object.cpp.
References xslt::kUninitialisedObject, NULL, xslt::impl::xpath_obj_impl::obj_, pimpl_, xslt::type_boolean, xslt::type_nodeset, xslt::type_not_implemented, xslt::type_number, xslt::type_string, and xslt::type_undefined.
xpath_object & xslt::xpath_object::operator= | ( | const xpath_object & | other | ) |
Create a copy of the xslt::xpath_object object.
The copy refers to the same xpath_object as the given object.
other | Another xslt::xpath_object object. |
Definition at line 131 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::dec_ref(), xslt::impl::xpath_obj_impl::inc_ref(), and pimpl_.
xpath_object & xslt::xpath_object::operator= | ( | xpath_object && | other | ) |
Moving assignment.
other | The other xpath object. |
Definition at line 147 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::dec_ref(), NULL, and pimpl_.
|
private |
Definition at line 535 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::owner_, and pimpl_.
Referenced by xslt::extension_function::set_return_value().
|
private |
Definition at line 540 of file xpath_object.cpp.
References xslt::impl::xpath_obj_impl::from_xslt_, and pimpl_.
|
private |
Definition at line 550 of file xpath_object.cpp.
Referenced by get_as_int().
|
private |
|
friend |
Definition at line 240 of file xpath_object.hpp.
|
friend |
Definition at line 239 of file xpath_object.hpp.
|
private |
Definition at line 250 of file xpath_object.hpp.
Referenced by get_as_bool(), get_as_float(), get_as_int(), get_as_node(), get_as_node_set(), get_as_string(), get_from_xslt(), get_object(), get_type(), operator=(), revoke_ownership(), set_from_xslt(), xpath_object(), and ~xpath_object().