ddc
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TinyXPath::xpath_processor Class Reference

XPath execution class. More...

#include <xpath_processor.h>

Inheritance diagram for TinyXPath::xpath_processor:
Inheritance graph
[legend]
Collaboration diagram for TinyXPath::xpath_processor:
Collaboration graph
[legend]

Public Types

enum  {
  e_no_error, e_error_syntax, e_error_overflow, e_error_execution,
  e_error_stack
}
 

Public Member Functions

 xpath_processor (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Constructor. More...
 
virtual ~ xpath_processor ()
 
expression_result er_compute_xpath ()
 Compute an XPath expression. More...
 
TiXmlString S_compute_xpath ()
 Compute an XPath expression and return the result as a string. More...
 
int i_compute_xpath ()
 Compute an XPath expression and return the result as an integer. More...
 
bool o_compute_xpath ()
 
double d_compute_xpath ()
 
unsigned u_compute_xpath_node_set ()
 
void v_get_xpath_base (unsigned u_order, const TiXmlBase *&XBp_res, bool &o_attribute)
 Get one of the XML nodes from the resulting node set. Can only be used after a call to u_compute_xpath_node_set. More...
 
TiXmlNodeXNp_get_xpath_node (unsigned u_order)
 Retrieves an XPath node from the node set. This assumes you know it's not an attribute. More...
 
TiXmlAttributeXAp_get_xpath_attribute (unsigned u_order)
 Retrieves an XPath attribute from the node set. This assumes you know it's an attribute. More...
 
- Public Member Functions inherited from TinyXPath::xpath_stream
 xpath_stream (const char *cp_in)
 constructor More...
 
virtual ~ xpath_stream ()
 destructor More...
 
void v_lexico_decode ()
 Decode the byte stream, and construct the lexical list. More...
 
void v_evaluate ()
 
- Public Member Functions inherited from TinyXPath::byte_stream
 byte_stream (const char *cp_in)
 constructor More...
 
 ~ byte_stream ()
 destructor More...
 
_byte_ b_top ()
 Returns the byte on top. More...
 
_byte_ b_pop ()
 Consumes one byte. More...
 
bool o_is_valid ()
 true if there are still some byte to consume More...
 
unsigned u_remain ()
 number of bytes still to consume More...
 
_byte_ b_forward (unsigned u_nb_char)
 peek a byte a little further down the stream More...
 
const _byte_bp_get_backward (unsigned u_amount)
 get a byte backward pointer to the stream More...
 

Public Attributes

enum TinyXPath::xpath_processor:: { ... }  e_error
 

Protected Member Functions

virtual void v_action (xpath_construct, unsigned, unsigned, const char *)
 Callback from the XPath decoder : a rule has to be applied. More...
 
virtual int i_get_action_counter ()
 Internal use. Retrieves the current action counter. More...
 
void v_execute_stack ()
 Internal use. Executes the XPath expression. The executions starts at the end of the as_action_store list. More...
 
void v_pop_one_action (xpath_construct &xc_action, unsigned &u_sub, unsigned &u_ref, TiXmlString &S_literal)
 Retrieves one quadruplet from the action placeholder. More...
 
void v_execute_one (xpath_construct xc_rule, bool o_skip_only)
 Executes one XPath rule. More...
 
void v_execute_absolute_path (unsigned u_action_position, bool o_with_rel, bool o_everywhere)
 Execute a full set of absolute/relative/relative/.. computation. More...
 
void v_execute_step (int &i_relative_action, bool o_skip_only)
 One step execution. More...
 
bool o_check_predicate (TiXmlElement *XEp_child, bool o_by_name)
 
void v_execute_function (TiXmlString &S_name, unsigned u_nb_arg, expression_result **erpp_arg)
 
void v_function_ceiling (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath ceiling function. More...
 
void v_function_concat (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath concat function. More...
 
void v_function_contains (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath contains function. More...
 
void v_function_count (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath count function. More...
 
void v_function_false (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath false function. More...
 
void v_function_floor (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath floor function. More...
 
void v_function_last (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath last function. More...
 
void v_function_name (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath name function. More...
 
void v_function_normalize_space (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath normalize-space function. More...
 
void v_function_not (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath not function. More...
 
void v_function_position (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath position function. More...
 
void v_function_starts_with (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath starts-with function. More...
 
void v_function_string_length (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath sttring-length function. More...
 
void v_function_substring (unsigned u_nb_arg, expression_result **erpp_arg)
 
void v_function_sum (unsigned u_nb_arg, expression_result **erpp_arg)
 
void v_function_text (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath text function. More...
 
void v_function_true (unsigned u_nb_arg, expression_result **erpp_arg)
 XPath true function. More...
 
void v_function_equal (expression_result **erpp_arg)
 
void v_function_not_equal (expression_result **erpp_arg)
 This function is for internal use : evaluation of a non-equality expression. More...
 
void v_function_equal_node_and_other (expression_result *erp_node, expression_result *erp_non)
 
void v_function_equal_2_node (expression_result *erp_node_set_, expression_result *erp_node_set_2)
 
void v_function_union (node_set &ns_1, node_set &ns_2)
 Union function. More...
 
void v_function_minus (expression_result **erpp_arg)
 XPath - function. More...
 
void v_function_plus (expression_result **erpp_arg)
 XPath + function. More...
 
void v_function_or (expression_result **erpp_arg)
 XPath or function. More...
 
void v_function_and (expression_result **erpp_arg)
 XPath and function. More...
 
void v_function_relational (expression_result **erpp_arg, unsigned u_sub)
 XPath relational comparison function. More...
 
void v_function_opposite ()
 
void v_function_mult (expression_result **erpp_arg, unsigned u_sub)
 XPath * function (arithmetic) More...
 
void v_order_tree ()
 
void v_order_recurs (TiXmlNode *Np_base, size_t &i_current)
 
void v_push_int (int i_val, const char *cp_comment="")
 
void v_push_string (TiXmlString S_val)
 
void v_push_bool (bool o_val)
 
void v_push_double (double d_val)
 
void v_push_node_set (node_set *nsp_val)
 
bool o_pop_bool ()
 
int i_pop_int ()
 
TiXmlString S_pop_string ()
 
node_set ns_pop_node_set ()
 
void v_set_context (TiXmlElement *XEp_in, bool o_by_name)
 Set the current context node for predicate evaluations. More...
 
const TiXmlElementXEp_get_context ()
 
void v_build_root ()
 
void v_remove_root ()
 

Protected Attributes

xpath_stack xs_stack
 
action_store as_action_store
 
TiXmlElementXEp_root
 Root, above the XML tree given as parameter to the xpath_processor object. More...
 
const TiXmlElementXEp_context
 Current context. More...
 
expression_result er_result
 The result of the XPath evaluation, for further node retrieving by v_get_xpath_base. More...
 
bool o_is_context_by_name
 
const TiXmlNodeXNp_caller_parent
 
const TiXmlNodeXNp_caller_prev
 
const TiXmlNodeXNp_caller_next
 
const TiXmlNodeXNp_base
 
- Protected Attributes inherited from TinyXPath::xpath_stream
token_syntax_decodertlp_list
 List of tokens. More...
 

Detailed Description

XPath execution class.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
e_no_error 
e_error_syntax 
e_error_overflow 
e_error_execution 
e_error_stack 

Constructor & Destructor Documentation

◆ xpath_processor()

xpath_processor::xpath_processor ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Constructor.

xpath_processor constructor

Parameters
XNp_source_treeSource XML tree
cp_xpath_exprXPath expression

References o_is_context_by_name, XEp_context, and XNp_base.

◆ ~ xpath_processor()

virtual TinyXPath::xpath_processor::~ xpath_processor ( )
inlinevirtual

References TIXML_STRING.

Member Function Documentation

◆ er_compute_xpath()

expression_result xpath_processor::er_compute_xpath ( )

Compute an XPath expression.

The executions stack need to contain 1 and only 1 element, otherwize it's not valid

References e_error, e_error_execution, e_error_overflow, e_error_stack, e_error_syntax, e_no_error, er_result, v_build_root(), TinyXPath::xpath_stream::v_evaluate(), v_execute_stack(), v_remove_root(), XEp_root, and xs_stack.

Referenced by d_compute_xpath(), i_compute_xpath(), o_compute_xpath(), S_compute_xpath(), and u_compute_xpath_node_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ S_compute_xpath()

TiXmlString xpath_processor::S_compute_xpath ( )

Compute an XPath expression and return the result as a string.

References er_compute_xpath(), and TIXML_STRING.

Here is the call graph for this function:

◆ i_compute_xpath()

int xpath_processor::i_compute_xpath ( )

Compute an XPath expression and return the result as an integer.

References er_compute_xpath().

Here is the call graph for this function:

◆ o_compute_xpath()

bool xpath_processor::o_compute_xpath ( )

References er_compute_xpath().

Here is the call graph for this function:

◆ d_compute_xpath()

double xpath_processor::d_compute_xpath ( )

References er_compute_xpath().

Here is the call graph for this function:

◆ u_compute_xpath_node_set()

unsigned xpath_processor::u_compute_xpath_node_set ( )

Compute an XPath expression, and return the number of nodes in the resulting node set.
Returns 0 if the result is not a node set

References TinyXPath::e_node_set, er_compute_xpath(), and er_result.

Here is the call graph for this function:

◆ v_get_xpath_base()

void xpath_processor::v_get_xpath_base ( unsigned  u_order,
const TiXmlBase *&  XBp_res,
bool &  o_attrib 
)

Get one of the XML nodes from the resulting node set. Can only be used after a call to u_compute_xpath_node_set.

Parameters
u_orderOrder of the node. Must be between 0 and the number of nodes - 1
XBp_resOutput node
o_attribTrue if the output node is an attribute, false if it's a TiXmlNode

References TinyXPath::e_node_set, and er_result.

Referenced by XAp_get_xpath_attribute(), and XNp_get_xpath_node().

Here is the caller graph for this function:

◆ XNp_get_xpath_node()

TiXmlNode * xpath_processor::XNp_get_xpath_node ( unsigned  u_order)

Retrieves an XPath node from the node set. This assumes you know it's not an attribute.

Parameters
u_orderOrder of the node. Must be between 0 and the number of nodes - 1

References v_get_xpath_base().

Here is the call graph for this function:

◆ XAp_get_xpath_attribute()

TiXmlAttribute * xpath_processor::XAp_get_xpath_attribute ( unsigned  u_order)

Retrieves an XPath attribute from the node set. This assumes you know it's an attribute.

Parameters
u_orderOrder of the node. Must be between 0 and the number of nodes - 1

References v_get_xpath_base().

Here is the call graph for this function:

◆ v_action()

void xpath_processor::v_action ( xpath_construct  xc_rule,
unsigned  u_sub,
unsigned  u_variable,
const char *  cp_literal 
)
protectedvirtual

Callback from the XPath decoder : a rule has to be applied.

Parameters
xc_ruleXPath Rule
u_subRule sub number
u_variableParameter, depends on the rule
cp_literalInput literal, depends on the rule

Implements TinyXPath::xpath_stream.

References as_action_store.

◆ i_get_action_counter()

int xpath_processor::i_get_action_counter ( )
protectedvirtual

Internal use. Retrieves the current action counter.

Implements TinyXPath::xpath_stream.

References as_action_store.

◆ v_execute_stack()

void xpath_processor::v_execute_stack ( )
protected

Internal use. Executes the XPath expression. The executions starts at the end of the as_action_store list.

References as_action_store, v_execute_one(), and TinyXPath::xpath_expr.

Referenced by er_compute_xpath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_pop_one_action()

void xpath_processor::v_pop_one_action ( xpath_construct xc_action,
unsigned &  u_sub,
unsigned &  u_ref,
TiXmlString S_literal 
)
protected

Retrieves one quadruplet from the action placeholder.

Parameters
xc_actionNext rule on placeholder
u_subSub rule
u_refRule optional parameter
S_literalRule optional string

References as_action_store.

Referenced by v_execute_one(), and v_execute_step().

Here is the caller graph for this function:

◆ v_execute_one()

void xpath_processor::v_execute_one ( xpath_construct  xc_rule,
bool  o_skip_only 
)
protected

Executes one XPath rule.

Compute each argument, and store them in a temporary list

Parameters
xc_ruleRule number
o_skip_onlyTrue if we only need to skip rules and not act on the data stack

References TinyXPath::e_node_set, i_pop_int(), ns_pop_node_set(), S_pop_string(), TIXML_STRING, v_execute_absolute_path(), v_execute_function(), v_execute_step(), v_function_and(), v_function_equal(), v_function_minus(), v_function_mult(), v_function_not_equal(), v_function_opposite(), v_function_or(), v_function_plus(), v_function_relational(), v_function_union(), v_pop_one_action(), v_push_double(), v_push_int(), v_push_string(), TinyXPath::xpath_absolute_location_path, TinyXPath::xpath_absolute_location_path_abbrev, TinyXPath::xpath_absolute_location_path_slash, TinyXPath::xpath_absolute_location_path_slash_rel, TinyXPath::xpath_additive_expr, TinyXPath::xpath_additive_expr_minus, TinyXPath::xpath_additive_expr_more_minus, TinyXPath::xpath_additive_expr_more_plus, TinyXPath::xpath_additive_expr_plus, TinyXPath::xpath_additive_expr_simple, TinyXPath::xpath_and_expr, TinyXPath::xpath_and_expr_and, TinyXPath::xpath_and_expr_simple, TinyXPath::xpath_argument, TinyXPath::xpath_axis_name, TinyXPath::xpath_axis_specifier, TinyXPath::xpath_axis_specifier_at, TinyXPath::xpath_axis_specifier_axis_name, TinyXPath::xpath_axis_specifier_empty, TinyXPath::xpath_equality_expr, TinyXPath::xpath_equality_expr_equal, TinyXPath::xpath_equality_expr_not_equal, TinyXPath::xpath_equality_expr_simple, TinyXPath::xpath_expr, TinyXPath::xpath_filter_expr, TinyXPath::xpath_filter_expr_predicate, TinyXPath::xpath_filter_expr_primary, TinyXPath::xpath_function_call, TinyXPath::xpath_location_path, TinyXPath::xpath_location_path_abs, TinyXPath::xpath_location_path_rel, TinyXPath::xpath_multiplicative_expr, TinyXPath::xpath_multiplicative_expr_div, TinyXPath::xpath_multiplicative_expr_mod, TinyXPath::xpath_multiplicative_expr_simple, TinyXPath::xpath_multiplicative_expr_star, TinyXPath::xpath_name_test, TinyXPath::xpath_name_test_ncname, TinyXPath::xpath_name_test_qname, TinyXPath::xpath_name_test_star, TinyXPath::xpath_node_test, TinyXPath::xpath_node_test_name_test, TinyXPath::xpath_node_test_pi, TinyXPath::xpath_node_test_pi_lit, TinyXPath::xpath_node_test_reserved_keyword, TinyXPath::xpath_or_expr, TinyXPath::xpath_or_expr_or, TinyXPath::xpath_or_expr_simple, TinyXPath::xpath_path_expr, TinyXPath::xpath_path_expr_2_slash, TinyXPath::xpath_path_expr_filter, TinyXPath::xpath_path_expr_location_path, TinyXPath::xpath_path_expr_slash, TinyXPath::xpath_predicate, TinyXPath::xpath_predicate_expr, TinyXPath::xpath_primary_expr, TinyXPath::xpath_primary_expr_function_call, TinyXPath::xpath_primary_expr_literal, TinyXPath::xpath_primary_expr_number, TinyXPath::xpath_primary_expr_paren_expr, TinyXPath::xpath_primary_expr_variable, TinyXPath::xpath_relational_expr, TinyXPath::xpath_relational_expr_gt, TinyXPath::xpath_relational_expr_gte, TinyXPath::xpath_relational_expr_lt, TinyXPath::xpath_relational_expr_lte, TinyXPath::xpath_relational_expr_simple, TinyXPath::xpath_relative_location_path, TinyXPath::xpath_relative_location_path_rel_double_slash_step, TinyXPath::xpath_relative_location_path_rel_step, TinyXPath::xpath_relative_location_path_step, TinyXPath::xpath_unary_expr, TinyXPath::xpath_unary_expr_minus, TinyXPath::xpath_unary_expr_simple, TinyXPath::xpath_union_expr, TinyXPath::xpath_union_expr_simple, TinyXPath::xpath_union_expr_union, TinyXPath::xpath_variable_reference, TinyXPath::xpath_xml_local_part, TinyXPath::xpath_xml_prefix, TinyXPath::xpath_xml_q_name, TinyXPath::xpath_xml_q_name_colon, TinyXPath::xpath_xml_q_name_simple, and xs_stack.

Referenced by o_check_predicate(), v_execute_stack(), and v_execute_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_execute_absolute_path()

void xpath_processor::v_execute_absolute_path ( unsigned  u_action_position,
bool  o_with_rel,
bool  o_everywhere 
)
protected

Execute a full set of absolute/relative/relative/.. computation.

Parameters
u_action_positionPosition of the placeholder after the rule
o_with_reltrue if there is some relative path
o_everywheretrue if it's a '//' path

References as_action_store, TIXML_STRING, v_execute_step(), and TinyXPath::xpath_relative_location_path.

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_execute_step()

void xpath_processor::v_execute_step ( int &  i_relative_action,
bool  o_skip_only 
)
protected

◆ o_check_predicate()

bool xpath_processor::o_check_predicate ( TiXmlElement XEp_child,
bool  o_by_name 
)
protected

Spec extract :
A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the context position and will be converted to false otherwise; if the result is not a number, then the result will be converted as if by a call to the boolean function. Thus a location path para[3] is equivalent to para[position()=3].

References TinyXPath::e_double, TinyXPath::e_int, TinyXPath::i_xml_cardinality(), v_execute_one(), v_set_context(), TinyXPath::xpath_predicate, and xs_stack.

Referenced by v_execute_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_execute_function()

void xpath_processor::v_execute_function ( TiXmlString S_name,
unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

Execute an XPath function. The arguments are in normal order in erpp_arg
Calls one of the following :

  • v_function_ceiling
  • v_function_concat
  • v_function_contains
  • v_function_count
  • v_function_false
  • v_function_floor
  • v_function_last
  • v_function_name
  • v_function_normalize_space
  • v_function_not
  • v_function_position
  • v_function_starts_with
  • v_function_string_length
  • v_function_substring
  • v_function_sum
  • v_function_true
Parameters
S_nameFunction name
u_nb_argNb of arguments
erpp_argArgument list

References v_function_ceiling(), v_function_concat(), v_function_contains(), v_function_count(), v_function_false(), v_function_floor(), v_function_last(), v_function_name(), v_function_normalize_space(), v_function_not(), v_function_position(), v_function_starts_with(), v_function_string_length(), v_function_substring(), v_function_sum(), v_function_text(), and v_function_true().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_ceiling()

void xpath_processor::v_function_ceiling ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath ceiling function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::e_bool, TinyXPath::e_double, TinyXPath::e_int, and v_push_int().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_concat()

void xpath_processor::v_function_concat ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath concat function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TIXML_STRING, and v_push_string().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_contains()

void xpath_processor::v_function_contains ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath contains function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TIXML_STRING, and v_push_bool().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_count()

void xpath_processor::v_function_count ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath count function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::e_node_set, and v_push_int().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_false()

void xpath_processor::v_function_false ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath false function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References v_push_bool().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_floor()

void xpath_processor::v_function_floor ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath floor function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::e_bool, TinyXPath::e_double, TinyXPath::e_int, and v_push_int().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_last()

void xpath_processor::v_function_last ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath last function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::i_xml_family_size(), v_push_int(), XEp_context, and XEp_get_context().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_name()

void xpath_processor::v_function_name ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath name function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::e_node_set, Name, TIXML_STRING, and v_push_string().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_normalize_space()

void xpath_processor::v_function_normalize_space ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath normalize-space function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::S_remove_lead_trail(), TIXML_STRING, and v_push_string().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_not()

void xpath_processor::v_function_not ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath not function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References v_push_bool().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_position()

void xpath_processor::v_function_position ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath position function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::i_xml_cardinality(), o_is_context_by_name, v_push_int(), XEp_context, and XEp_get_context().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_starts_with()

void xpath_processor::v_function_starts_with ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath starts-with function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TIXML_STRING, and v_push_bool().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_string_length()

void xpath_processor::v_function_string_length ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath sttring-length function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TIXML_STRING, and v_push_int().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_substring()

void xpath_processor::v_function_substring ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath substring function
Standard excerpt:
The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345",2) returns "2345".

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TIXML_STRING, and v_push_string().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_sum()

void xpath_processor::v_function_sum ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath sum function
Standard exerpt :
The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TinyXPath::e_node_set, v_push_double(), and v_push_int().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_text()

void xpath_processor::v_function_text ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath text function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References TiXmlNode::TEXT, TIXML_STRING, v_push_string(), XEp_context, and XEp_get_context().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_true()

void xpath_processor::v_function_true ( unsigned  u_nb_arg,
expression_result **  erpp_arg 
)
protected

XPath true function.

Parameters
u_nb_argNb of arguments
erpp_argArgument list

References v_push_bool().

Referenced by v_execute_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_equal()

void xpath_processor::v_function_equal ( expression_result **  erpp_arg)
protected

This function is for internal use : evaluation of an equality expression
Standard excerpt :
If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true.
If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true.
If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true.
If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.
When neither object to be compared is a node-set and the operator is = or !=, then the objects are compared by converting them to a common type as follows and then comparing them.

  • If at least one object to be compared is a boolean, then each object to be compared is converted to a boolean as if by applying the boolean function.
  • Otherwise, if at least one object to be compared is a number, then each object to be compared is converted to a number as if by applying the number function.
  • Otherwise, both objects to be compared are converted to strings as if by applying the string function. The = comparison will be true if and only if the objects are equal; the != comparison will be true if and only if the objects are not equal.
  • Numbers are compared for equality according to IEEE 754.
  • Two booleans are equal if either both are true or both are false.
  • Two strings are equal if and only if they consist of the same sequence of UCS characters.

References TinyXPath::e_bool, TinyXPath::e_double, TinyXPath::e_int, TinyXPath::e_node_set, v_function_equal_2_node(), v_function_equal_node_and_other(), and v_push_bool().

Referenced by v_execute_one(), and v_function_not_equal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_not_equal()

void xpath_processor::v_function_not_equal ( expression_result **  erpp_arg)
protected

This function is for internal use : evaluation of a non-equality expression.

References o_pop_bool(), v_function_equal(), and v_push_bool().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_equal_node_and_other()

void xpath_processor::v_function_equal_node_and_other ( expression_result erp_node_set,
expression_result erp_non 
)
protected

Utility function that evaluates the equality between a node set and a non-node set
Standard excerpt :
If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true.
If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true.
If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.

References TinyXPath::e_bool, TinyXPath::e_double, TinyXPath::e_int, TinyXPath::e_string, and v_push_bool().

Referenced by v_function_equal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_equal_2_node()

void xpath_processor::v_function_equal_2_node ( expression_result erp_node_set_,
expression_result erp_node_set_2 
)
protected
Todo:
: Implement this function. We don't compare 2 node sets yet

Referenced by v_function_equal().

Here is the caller graph for this function:

◆ v_function_union()

void xpath_processor::v_function_union ( node_set ns_1,
node_set ns_2 
)
protected

Union function.

References v_push_node_set().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_minus()

void xpath_processor::v_function_minus ( expression_result **  erpp_arg)
protected

XPath - function.

References TinyXPath::e_double, v_push_double(), and v_push_int().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_plus()

void xpath_processor::v_function_plus ( expression_result **  erpp_arg)
protected

XPath + function.

References TinyXPath::e_double, v_push_double(), and v_push_int().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_or()

void xpath_processor::v_function_or ( expression_result **  erpp_arg)
protected

XPath or function.

References v_push_bool().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_and()

void xpath_processor::v_function_and ( expression_result **  erpp_arg)
protected

XPath and function.

References v_push_bool().

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_relational()

void xpath_processor::v_function_relational ( expression_result **  erpp_arg,
unsigned  u_sub 
)
protected

XPath relational comparison function.

References TinyXPath::e_double, v_push_bool(), TinyXPath::xpath_relational_expr_gt, TinyXPath::xpath_relational_expr_gte, TinyXPath::xpath_relational_expr_lt, and TinyXPath::xpath_relational_expr_lte.

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_opposite()

void xpath_processor::v_function_opposite ( )
protected

This function, because it only operates on one argument retrieves it himself from the stack
It computes the mathematical opposite

References TinyXPath::e_double, v_push_double(), v_push_int(), and xs_stack.

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_function_mult()

void xpath_processor::v_function_mult ( expression_result **  erpp_arg,
unsigned  u_sub 
)
protected

XPath * function (arithmetic)

References TinyXPath::e_double, v_push_double(), v_push_int(), TinyXPath::xpath_multiplicative_expr_div, TinyXPath::xpath_multiplicative_expr_mod, and TinyXPath::xpath_multiplicative_expr_star.

Referenced by v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_order_tree()

void xpath_processor::v_order_tree ( )
protected

flag that says if the tree has been ordered already. This is a rather slow process, so we only do it if needed

Order the tree : assign an integer to all nodes based on the document order
Right now, tinyxml doesn't have a user value associated to attributes ... arrrgh. We order everything else, and will have to compute attributes order on demand

References v_order_recurs(), and XEp_root.

Referenced by v_build_root().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_order_recurs()

void xpath_processor::v_order_recurs ( TiXmlNode Np_base,
size_t &  i_current 
)
protected

Recursive ordering of an XML tree according to XPath's document order.
The result is stored as an integer in the void * pointer managed by TiXmlNode::SetUserData / TiXmlNode::GetUserData

Referenced by v_order_tree().

Here is the caller graph for this function:

◆ v_push_int()

void TinyXPath::xpath_processor::v_push_int ( int  i_val,
const char *  cp_comment = "" 
)
inlineprotected

◆ v_push_string()

void TinyXPath::xpath_processor::v_push_string ( TiXmlString  S_val)
inlineprotected

References v_push_string().

Referenced by v_execute_one(), v_function_concat(), v_function_name(), v_function_normalize_space(), v_function_substring(), v_function_text(), and v_push_string().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_push_bool()

void TinyXPath::xpath_processor::v_push_bool ( bool  o_val)
inlineprotected

◆ v_push_double()

void TinyXPath::xpath_processor::v_push_double ( double  d_val)
inlineprotected

References v_push_double().

Referenced by v_execute_one(), v_function_minus(), v_function_mult(), v_function_opposite(), v_function_plus(), v_function_sum(), and v_push_double().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_push_node_set()

void TinyXPath::xpath_processor::v_push_node_set ( node_set nsp_val)
inlineprotected

References v_push_node_set().

Referenced by v_execute_step(), v_function_union(), and v_push_node_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ o_pop_bool()

bool TinyXPath::xpath_processor::o_pop_bool ( )
inlineprotected

References o_pop_bool().

Referenced by o_pop_bool(), and v_function_not_equal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ i_pop_int()

int TinyXPath::xpath_processor::i_pop_int ( )
inlineprotected

References i_pop_int().

Referenced by i_pop_int(), v_execute_one(), and v_execute_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ S_pop_string()

TiXmlString TinyXPath::xpath_processor::S_pop_string ( )
inlineprotected

References S_pop_string().

Referenced by S_pop_string(), v_execute_one(), and v_execute_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ns_pop_node_set()

node_set TinyXPath::xpath_processor::ns_pop_node_set ( )
inlineprotected

References ns_pop_node_set().

Referenced by ns_pop_node_set(), and v_execute_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_set_context()

void xpath_processor::v_set_context ( TiXmlElement XEp_in,
bool  o_by_name 
)
protected

Set the current context node for predicate evaluations.

Parameters
XEp_inContext node
o_by_nametrue if the current node search is by name, false if it's a *

References o_is_context_by_name, and XEp_context.

Referenced by o_check_predicate().

Here is the caller graph for this function:

◆ XEp_get_context()

const TiXmlElement* TinyXPath::xpath_processor::XEp_get_context ( )
inlineprotected

Referenced by v_function_last(), v_function_position(), and v_function_text().

Here is the caller graph for this function:

◆ v_build_root()

void xpath_processor::v_build_root ( )
protected

References v_order_tree(), XEp_context, XEp_root, XNp_base, XNp_caller_next, XNp_caller_parent, and XNp_caller_prev.

Referenced by er_compute_xpath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_remove_root()

void xpath_processor::v_remove_root ( )
protected

Remove our fake root, and restore the original relationships of the node given to us as argument

References XEp_root, XNp_base, XNp_caller_next, XNp_caller_parent, and XNp_caller_prev.

Referenced by er_compute_xpath().

Here is the caller graph for this function:

Member Data Documentation

◆ e_error

enum { ... } TinyXPath::xpath_processor::e_error

Referenced by er_compute_xpath().

◆ xs_stack

xpath_stack TinyXPath::xpath_processor::xs_stack
protected

◆ as_action_store

action_store TinyXPath::xpath_processor::as_action_store
protected

◆ XEp_root

TiXmlElement* TinyXPath::xpath_processor::XEp_root
protected

Root, above the XML tree given as parameter to the xpath_processor object.

Referenced by er_compute_xpath(), v_build_root(), v_execute_step(), v_order_tree(), and v_remove_root().

◆ XEp_context

const TiXmlElement* TinyXPath::xpath_processor::XEp_context
protected

◆ er_result

expression_result TinyXPath::xpath_processor::er_result
protected

The result of the XPath evaluation, for further node retrieving by v_get_xpath_base.

Referenced by er_compute_xpath(), u_compute_xpath_node_set(), and v_get_xpath_base().

◆ o_is_context_by_name

bool TinyXPath::xpath_processor::o_is_context_by_name
protected

◆ XNp_caller_parent

const TiXmlNode* TinyXPath::xpath_processor::XNp_caller_parent
protected

Referenced by v_build_root(), and v_remove_root().

◆ XNp_caller_prev

const TiXmlNode* TinyXPath::xpath_processor::XNp_caller_prev
protected

Referenced by v_build_root(), and v_remove_root().

◆ XNp_caller_next

const TiXmlNode* TinyXPath::xpath_processor::XNp_caller_next
protected

Referenced by v_build_root(), and v_remove_root().

◆ XNp_base

const TiXmlNode* TinyXPath::xpath_processor::XNp_base
protected

The documentation for this class was generated from the following files: