ddc
Classes | Typedefs | Enumerations | Functions | Variables
TinyXPath Namespace Reference

Classes

class  action_item
 
class  action_store
 
class  byte_stream
 
class  error_not_yet
 
class  execution_error
 Exceptions. More...
 
class  expression_result
 Class holding the result of an expression (e_expression_type) More...
 
class  lex_token
 
class  node_set
 Node set class. A node set is an unordered collection of node. More...
 
class  ptr_and_flag
 Internal utility class for the node set sorting. More...
 
class  result_and_next
 xpath_stack element. Derives from expression_result, and also contains a pointer to the next element on the stack More...
 
class  syntax_error
 Exception class for a syntax error. More...
 
class  syntax_overflow
 Exception class for an overflow in syntax decoding. More...
 
class  token_list
 
class  token_redef
 
class  token_syntax_decoder
 
class  xpath_processor
 XPath execution class. More...
 
class  xpath_stack
 
class  xpath_stream
 

Typedefs

typedef unsigned char _byte_
 

Enumerations

enum  lexico {
  lex_null, lex_none, lex_space, lex_digit,
  lex_bchar, lex_extend, lex_slash, lex_at,
  lex_dot, lex_minus, lex_under, lex_colon,
  lex_scolon, lex_2_quote, lex_1_quote, lex_dollar,
  lex_oparen, lex_cparen, lex_star, lex_plus,
  lex_comma, lex_lt, lex_gt, lex_equal,
  lex_obrack, lex_cbrack, lex_orchar, lex_exclam,
  lex_ncname, lex_number, lex_literal, lex_2_colon,
  lex_2_slash, lex_2_dot, lex_not_equal, lex_lt_equal,
  lex_gt_equal, lex_start_keyword, lex_or = lex_start_keyword, lex_and,
  lex_mod, lex_div, lex_start_axis_name, lex_ancestor = lex_start_axis_name,
  lex_ancestor_or_self, lex_attribute, lex_child, lex_descendant,
  lex_descendant_or_self, lex_following, lex_following_sibling, lex_namespace,
  lex_parent, lex_preceding, lex_preceding_sibling, lex_self,
  lex_end_axis_name = lex_self, lex_processing_instruction, lex_comment, lex_node,
  lex_text, lex_end_keyword = lex_text
}
 Lexical XPath elements. More...
 
enum  xpath_construct {
  xpath_unknown = 0, xpath_location_path = 1, xpath_absolute_location_path = 2, xpath_relative_location_path = 3,
  xpath_step = 4, xpath_axis_specifier = 5, xpath_axis_name = 6, xpath_node_test = 7,
  xpath_predicate = 8, xpath_predicate_expr = 9, xpath_abbreviated_absolute_location_path = 10, xpath_abbrieviated_step = 12,
  xpath_abbreviated_axis_specifier = 13, xpath_expr = 14, xpath_primary_expr = 15, xpath_function_call = 16,
  xpath_argument = 17, xpath_union_expr = 18, xpath_path_expr = 19, xpath_filter_expr = 20,
  xpath_or_expr = 21, xpath_and_expr = 22, xpath_equality_expr = 23, xpath_relational_expr = 24,
  xpath_additive_expr = 25, xpath_multiplicative_expr = 26, xpath_unary_expr = 27, xpath_multiply_operator = 34,
  xpath_variable_reference = 36, xpath_name_test = 37, xpath_xml_q_name = 206, xpath_xml_prefix = 207,
  xpath_xml_local_part = 208
}
 XPath constructions. The ordinals are rules of XPath or XML definitions in w3c. More...
 
enum  xpath_sub {
  xpath_absolute_location_path_slash_rel, xpath_absolute_location_path_slash, xpath_absolute_location_path_abbrev, xpath_relative_location_path_rel_step,
  xpath_relative_location_path_rel_double_slash_step, xpath_relative_location_path_step, xpath_step_abbrev, xpath_step_full,
  xpath_primary_expr_variable, xpath_primary_expr_paren_expr, xpath_primary_expr_literal, xpath_primary_expr_number,
  xpath_primary_expr_function_call, xpath_name_test_star, xpath_name_test_ncname, xpath_name_test_qname,
  xpath_xml_q_name_colon, xpath_xml_q_name_simple, xpath_axis_specifier_at, xpath_axis_specifier_axis_name,
  xpath_axis_specifier_empty, xpath_path_expr_location_path, xpath_path_expr_filter, xpath_path_expr_slash,
  xpath_path_expr_2_slash, xpath_filter_expr_primary, xpath_filter_expr_predicate, xpath_location_path_rel,
  xpath_location_path_abs, xpath_node_test_reserved_keyword, xpath_node_test_pi, xpath_node_test_pi_lit,
  xpath_node_test_name_test, xpath_equality_expr_equal, xpath_equality_expr_not_equal, xpath_equality_expr_simple,
  xpath_union_expr_simple, xpath_union_expr_union, xpath_additive_expr_simple, xpath_additive_expr_plus,
  xpath_additive_expr_minus, xpath_additive_expr_more_plus, xpath_additive_expr_more_minus, xpath_or_expr_simple,
  xpath_or_expr_or, xpath_and_expr_simple, xpath_and_expr_and, xpath_relational_expr_simple,
  xpath_relational_expr_lt, xpath_relational_expr_gt, xpath_relational_expr_lte, xpath_relational_expr_gte,
  xpath_unary_expr_simple, xpath_unary_expr_minus, xpath_multiplicative_expr_simple, xpath_multiplicative_expr_star,
  xpath_multiplicative_expr_div, xpath_multiplicative_expr_mod, dummy
}
 
enum  e_expression_type {
  e_bool, e_string, e_int, e_double,
  e_node_set, e_invalid
}
 Expression types. More...
 

Functions

const char * cp_disp_class_lex (lexico lex_in)
 Dump a lexical element. More...
 
lexico lex_get_class (_byte_ b_in)
 Get the lexical class of an XPath expression byte. More...
 
bool o_is_axis_name (lexico lex_test)
 Check if a lexical element can be an axis name. More...
 
lexico lex_test_id (const _byte_ *bp_str, unsigned u_size, lexico lex_next)
 
TiXmlString S_remove_lead_trail (const char *cp_in)
 Removes all leading and trailing white spaces. More...
 
void v_assign_int_to_string (TiXmlString &S_string, int i_val)
 Assign an integer to a string. More...
 
void v_assign_double_to_string (TiXmlString &S_string, double d_val)
 
int i_compare_ptr_and_flag (const void *vp_1, const void *vp_2)
 Internal utility function for node set sorting. More...
 
int i_xml_cardinality (const TiXmlElement *XEp_elem, bool o_by_name)
 Cardinality in the terms of XPath counts from 1 for the first element. More...
 
int i_xml_family_size (const TiXmlElement *XEp_elem)
 Family size : Nb of sibling elements (including ourselves) More...
 
int i_xpath_int (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute an integer XPath expression, without an error check. More...
 
double d_xpath_double (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute a double XPath expression, without an error check. More...
 
bool o_xpath_bool (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute a bool XPath expression, without an error check. More...
 
TiXmlString S_xpath_string (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute a string XPath expression, without an error check. More...
 
TiXmlNodeXNp_xpath_node (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute a node XPath expression, without an error check. More...
 
TiXmlAttributeXAp_xpath_attribute (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr)
 Static function to compute an attribute XPath expression, without an error check. More...
 
bool o_xpath_int (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, int &i_res)
 Static function to compute an integer XPath expression, with an error check. More...
 
bool o_xpath_double (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, double &d_res)
 Static function to compute a double XPath expression, without an error check. More...
 
bool o_xpath_bool (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, bool &o_res)
 Static function to compute a bool XPath expression, without an error check. More...
 
bool o_xpath_string (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, TiXmlString &S_res)
 Static function to compute a string XPath expression, without an error check. More...
 
bool o_xpath_node (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, const TiXmlNode *&XNp_node)
 Static function to compute a node XPath expression, without an error check. More...
 
bool o_xpath_attribute (const TiXmlNode *XNp_source_tree, const char *cp_xpath_expr, const TiXmlAttribute *&XAp_attrib)
 Static function to compute an attribute XPath expression, without an error check. More...
 

Variables

const int i_alloc_size = 100
 Allocation unit. More...
 
static lexico lex_char_map [256]
 Mapping of all the byte values into elementary lexical items. More...
 

Typedef Documentation

◆ _byte_

typedef unsigned char TinyXPath::_byte_

Enumeration Type Documentation

◆ lexico

Lexical XPath elements.

Enumerator
lex_null 
lex_none 
lex_space 
lex_digit 
lex_bchar 
lex_extend 
lex_slash 
lex_at 
lex_dot 
lex_minus 
lex_under 
lex_colon 
lex_scolon 
lex_2_quote 
lex_1_quote 
lex_dollar 
lex_oparen 
lex_cparen 
lex_star 
lex_plus 
lex_comma 
lex_lt 
lex_gt 
lex_equal 
lex_obrack 
lex_cbrack 
lex_orchar 
lex_exclam 
lex_ncname 
lex_number 
lex_literal 
lex_2_colon 
lex_2_slash 
lex_2_dot 
lex_not_equal 
lex_lt_equal 
lex_gt_equal 
lex_start_keyword 
lex_or 
lex_and 
lex_mod 
lex_div 
lex_start_axis_name 
lex_ancestor 
lex_ancestor_or_self 
lex_attribute 
lex_child 
lex_descendant 
lex_descendant_or_self 
lex_following 
lex_following_sibling 
lex_namespace 
lex_parent 
lex_preceding 
lex_preceding_sibling 
lex_self 
lex_end_axis_name 
lex_processing_instruction 
lex_comment 
lex_node 
lex_text 
lex_end_keyword 

◆ xpath_construct

XPath constructions. The ordinals are rules of XPath or XML definitions in w3c.

Enumerator
xpath_unknown 
xpath_location_path 
xpath_absolute_location_path 
xpath_relative_location_path 
xpath_step 
xpath_axis_specifier 
xpath_axis_name 
xpath_node_test 
xpath_predicate 
xpath_predicate_expr 
xpath_abbreviated_absolute_location_path 
xpath_abbrieviated_step 
xpath_abbreviated_axis_specifier 
xpath_expr 
xpath_primary_expr 
xpath_function_call 
xpath_argument 
xpath_union_expr 
xpath_path_expr 
xpath_filter_expr 
xpath_or_expr 
xpath_and_expr 
xpath_equality_expr 
xpath_relational_expr 
xpath_additive_expr 
xpath_multiplicative_expr 
xpath_unary_expr 
xpath_multiply_operator 
xpath_variable_reference 
xpath_name_test 
xpath_xml_q_name 
xpath_xml_prefix 
xpath_xml_local_part 

◆ xpath_sub

Enumerator
xpath_absolute_location_path_slash_rel 
xpath_absolute_location_path_slash 
xpath_absolute_location_path_abbrev 
xpath_relative_location_path_rel_step 
xpath_relative_location_path_rel_double_slash_step 
xpath_relative_location_path_step 
xpath_step_abbrev 
xpath_step_full 
xpath_primary_expr_variable 
xpath_primary_expr_paren_expr 
xpath_primary_expr_literal 
xpath_primary_expr_number 
xpath_primary_expr_function_call 
xpath_name_test_star 
xpath_name_test_ncname 
xpath_name_test_qname 
xpath_xml_q_name_colon 
xpath_xml_q_name_simple 
xpath_axis_specifier_at 
xpath_axis_specifier_axis_name 
xpath_axis_specifier_empty 
xpath_path_expr_location_path 
xpath_path_expr_filter 
xpath_path_expr_slash 
xpath_path_expr_2_slash 
xpath_filter_expr_primary 
xpath_filter_expr_predicate 
xpath_location_path_rel 
xpath_location_path_abs 
xpath_node_test_reserved_keyword 
xpath_node_test_pi 
xpath_node_test_pi_lit 
xpath_node_test_name_test 
xpath_equality_expr_equal 
xpath_equality_expr_not_equal 
xpath_equality_expr_simple 
xpath_union_expr_simple 
xpath_union_expr_union 
xpath_additive_expr_simple 
xpath_additive_expr_plus 
xpath_additive_expr_minus 
xpath_additive_expr_more_plus 
xpath_additive_expr_more_minus 
xpath_or_expr_simple 
xpath_or_expr_or 
xpath_and_expr_simple 
xpath_and_expr_and 
xpath_relational_expr_simple 
xpath_relational_expr_lt 
xpath_relational_expr_gt 
xpath_relational_expr_lte 
xpath_relational_expr_gte 
xpath_unary_expr_simple 
xpath_unary_expr_minus 
xpath_multiplicative_expr_simple 
xpath_multiplicative_expr_star 
xpath_multiplicative_expr_div 
xpath_multiplicative_expr_mod 
dummy 

◆ e_expression_type

Expression types.

Enumerator
e_bool 
e_string 
e_int 
e_double 
e_node_set 
e_invalid 

Function Documentation

◆ cp_disp_class_lex()

const char * TinyXPath::cp_disp_class_lex ( lexico  lex_in)

◆ lex_get_class()

lexico TinyXPath::lex_get_class ( _byte_  b_in)

Get the lexical class of an XPath expression byte.

Referenced by v_assign_double_to_string(), and TinyXPath::xpath_stream::v_lexico_decode().

Here is the caller graph for this function:

◆ o_is_axis_name()

bool TinyXPath::o_is_axis_name ( lexico  lex_test)

Check if a lexical element can be an axis name.

References lex_end_axis_name, and lex_start_axis_name.

Referenced by TinyXPath::token_syntax_decoder::o_recognize().

Here is the caller graph for this function:

◆ lex_test_id()

lexico TinyXPath::lex_test_id ( const _byte_ bp_str,
unsigned  u_size,
lexico  lex_next 
)

Check if an ID maps an existing keyword
Returns the new lexical element or lex_ncname if not found

References cp_disp_class_lex(), lex_end_keyword, lex_ncname, lex_oparen, lex_start_keyword, and lex_text.

Referenced by TinyXPath::xpath_stream::v_lexico_decode().

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

◆ S_remove_lead_trail()

TiXmlString TinyXPath::S_remove_lead_trail ( const char *  cp_in)

Removes all leading and trailing white spaces.

References TIXML_STRING.

Referenced by TinyXPath::xpath_processor::v_function_normalize_space().

Here is the caller graph for this function:

◆ v_assign_int_to_string()

void TinyXPath::v_assign_int_to_string ( TiXmlString S_string,
int  i_val 
)

Assign an integer to a string.

Referenced by TinyXPath::expression_result::S_get_string().

Here is the caller graph for this function:

◆ v_assign_double_to_string()

void TinyXPath::v_assign_double_to_string ( TiXmlString S_string,
double  d_val 
)

◆ i_compare_ptr_and_flag()

int TinyXPath::i_compare_ptr_and_flag ( const void *  vp_1,
const void *  vp_2 
)

Internal utility function for node set sorting.

Parameters
vp_1Ptr to first element to compare
vp_2Ptr to second element to compare

Referenced by TinyXPath::node_set::v_document_sort().

Here is the caller graph for this function:

◆ i_xml_cardinality()

int TinyXPath::i_xml_cardinality ( const TiXmlElement XEp_elem,
bool  o_by_name 
)

Cardinality in the terms of XPath counts from 1 for the first element.

Parameters
XEp_elemBase element. Must not be null
o_by_nametrue if we ask for the cardinality for our name only

References TIXML_STRING.

Referenced by TinyXPath::xpath_processor::o_check_predicate(), and TinyXPath::xpath_processor::v_function_position().

Here is the caller graph for this function:

◆ i_xml_family_size()

int TinyXPath::i_xml_family_size ( const TiXmlElement XEp_elem)

Family size : Nb of sibling elements (including ourselves)

Parameters
XEp_elemBase element. Must not be null

Referenced by TinyXPath::xpath_processor::v_function_last().

Here is the caller graph for this function:

◆ i_xpath_int()

int TinyXPath::i_xpath_int ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute an integer XPath expression, without an error check.

Referenced by main().

Here is the caller graph for this function:

◆ d_xpath_double()

double TinyXPath::d_xpath_double ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute a double XPath expression, without an error check.

◆ o_xpath_bool() [1/2]

bool TinyXPath::o_xpath_bool ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute a bool XPath expression, without an error check.

◆ S_xpath_string()

TiXmlString TinyXPath::S_xpath_string ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute a string XPath expression, without an error check.

Referenced by main(), and v_test_one_string_tiny().

Here is the caller graph for this function:

◆ XNp_xpath_node()

TiXmlNode * TinyXPath::XNp_xpath_node ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute a node XPath expression, without an error check.

Referenced by CBiblIndex::GetTextAreaElements().

Here is the caller graph for this function:

◆ XAp_xpath_attribute()

TiXmlAttribute * TinyXPath::XAp_xpath_attribute ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr 
)

Static function to compute an attribute XPath expression, without an error check.

◆ o_xpath_int()

bool TinyXPath::o_xpath_int ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
int &  i_res 
)

Static function to compute an integer XPath expression, with an error check.

References TinyXPath::xpath_processor::e_no_error.

◆ o_xpath_double()

bool TinyXPath::o_xpath_double ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
double &  d_res 
)

Static function to compute a double XPath expression, without an error check.

References TinyXPath::xpath_processor::e_no_error.

Referenced by main().

Here is the caller graph for this function:

◆ o_xpath_bool() [2/2]

bool TinyXPath::o_xpath_bool ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
bool &  o_res 
)

Static function to compute a bool XPath expression, without an error check.

References TinyXPath::xpath_processor::e_no_error.

◆ o_xpath_string()

bool TinyXPath::o_xpath_string ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
TiXmlString S_res 
)

Static function to compute a string XPath expression, without an error check.

References TinyXPath::xpath_processor::e_no_error.

◆ o_xpath_node()

bool TinyXPath::o_xpath_node ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
const TiXmlNode *&  XNp_node 
)

Static function to compute a node XPath expression, without an error check.

References TinyXPath::xpath_processor::e_no_error.

◆ o_xpath_attribute()

bool TinyXPath::o_xpath_attribute ( const TiXmlNode XNp_source_tree,
const char *  cp_xpath_expr,
const TiXmlAttribute *&  XAp_attrib 
)

Static function to compute an attribute XPath expression, without an error check.

References TinyXPath::xpath_processor::e_no_error.

Variable Documentation

◆ i_alloc_size

const int TinyXPath::i_alloc_size = 100

Allocation unit.

Referenced by TinyXPath::action_store::v_add().

◆ lex_char_map

lexico TinyXPath::lex_char_map[256]
static

Mapping of all the byte values into elementary lexical items.