Debian Codegraph @

src/tinyxpath/xpath_stack.h

raw symbols SCIP
1 /*
2 www.sourceforge.net/projects/tinyxpath
3 Copyright (c) 2002-2004 Yves Berquin ([email protected])
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
25 /**
26 \file xpath_stack.h
27 \author Yves Berquin
28 */
29
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
42 /// The XPath execution stack
43 /// \n All elements are result_and_next elements
44 class xpath_stack
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
56 expression_result * erp_top ();
57 int i_top_int ();
58
59 void v_pop (unsigned u_nb = 1);
60 int i_pop_int ();
61 TIXML_STRING S_pop_string ();
62 bool o_pop_bool ();
63 node_set ns_pop_node_set ();
64 /// Return the stack's size
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 :
71 /// First element in the stack
72 result_and_next * rnp_first;
73 /// Stack size
74 unsigned u_size;
75 void v_pop_one ();
76 } ;
77
78 }
79
80 #endif