ddc
xpath_stack.h
Go to the documentation of this file.
1 /*
2 www.sourceforge.net/projects/tinyxpath
3 Copyright (c) 2002-2004 Yves Berquin (yvesb@users.sourceforge.net)
4 
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any
7 damages arising from the use of this software.
8 
9 Permission is granted to anyone to use this software for any
10 purpose, including commercial applications, and to alter it and
11 redistribute it freely, subject to the following restrictions:
12 
13 1. The origin of this software must not be misrepresented; you must
14 not claim that you wrote the original software. If you use this
15 software in a product, an acknowledgment in the product documentation
16 would be appreciated but is not required.
17 
18 2. Altered source versions must be plainly marked as such, and
19 must not be misrepresented as being the original software.
20 
21 3. This notice may not be removed or altered from any source
22 distribution.
23 */
24 
30 #ifndef __XPATH_STACK_H
31 #define __XPATH_STACK_H
32 
33 #include "tinyxpath_conf.h"
34 #include "xpath_expression.h"
35 #include "xpath_stream.h"
36 
37 namespace TinyXPath
38 {
39 
40 class result_and_next;
41 
45 {
46 public :
47  xpath_stack ();
48  ~ xpath_stack ();
49  void v_push (expression_result er_res);
50  void v_push_int (int i_elem, const char * cp_comment = NULL);
51  void v_push_bool (bool o_in);
52  void v_push_string (TIXML_STRING S_in);
53  void v_push_double (double d_elem);
54  void v_push_node_set (node_set * nsp_ptr);
55 
57  int i_top_int ();
58 
59  void v_pop (unsigned u_nb = 1);
60  int i_pop_int ();
62  bool o_pop_bool ();
65  unsigned u_get_size () {return u_size;}
66  expression_result * erp_previous (unsigned u_nb);
67  #ifdef TINYXPATH_DEBUG
68  void v_dump ();
69  #endif
70 protected :
74  unsigned u_size;
75  void v_pop_one ();
76 } ;
77 
78 }
79 
80 #endif
81 
82 /*--- emacs style variables ---
83  * Local Variables:
84  * mode: C++
85  * c-file-style: "ellemtel"
86  * c-basic-offset: 4
87  * tab-width: 8
88  * indent-tabs-mode: nil
89  * End:
90  */
xpath_stack element. Derives from expression_result, and also contains a pointer to the next element ...
Definition: xpath_stack.cpp:37
Definition: xpath_stack.h:44
TiXmlString S_pop_string()
Pops the top string from the stack.
Definition: xpath_stack.cpp:92
unsigned u_size
Stack size.
Definition: xpath_stack.h:74
int i_pop_int()
Pops the top integer from the stack.
Definition: xpath_stack.cpp:82
expression_result * erp_previous(unsigned u_nb)
Retrieve a previous expression from the stack.
Definition: xpath_stack.cpp:191
Definition: action_store.cpp:32
void v_push_double(double d_elem)
Push a double on the stack.
Definition: xpath_stack.cpp:151
result_and_next * rnp_first
First element in the stack.
Definition: xpath_stack.h:72
bool o_pop_bool()
Pops the top bool from the stack.
Definition: xpath_stack.cpp:102
Class holding the result of an expression (e_expression_type)
Definition: xpath_expression.h:45
void v_pop(unsigned u_nb=1)
Pop N element from the stack.
Definition: xpath_stack.cpp:223
void v_push_string(TiXmlString S_in)
Push a string on the stack.
Definition: xpath_stack.cpp:175
void v_push_bool(bool o_in)
Push a bool on the stack.
Definition: xpath_stack.cpp:167
int i_top_int()
Query the top integer.
Definition: xpath_stack.cpp:122
void v_pop_one()
Pop one element from the stack.
Definition: xpath_stack.cpp:208
node_set ns_pop_node_set()
Pops the top node_set from the stack.
Definition: xpath_stack.cpp:112
expression_result * erp_top()
Retrieve top expression from the stack.
Definition: xpath_stack.cpp:183
unsigned u_get_size()
Return the stack's size.
Definition: xpath_stack.h:65
Node set class. A node set is an unordered collection of node.
Definition: node_set.h:34
void v_push(expression_result er_res)
Push a new element on the stack.
Definition: xpath_stack.cpp:131
xpath_stack()
Constructor.
Definition: xpath_stack.cpp:68
void v_push_int(int i_elem, const char *cp_comment=NULL)
Push an integer on the stack.
Definition: xpath_stack.cpp:141
void v_push_node_set(node_set *nsp_ptr)
Push a node_set on the stack.
Definition: xpath_stack.cpp:159
#define TIXML_STRING
Definition: tinyxml.h:67