00001 /* 00002 www.sourceforge.net/projects/tinyxpath 00003 Copyright (c) 2002-2004 Yves Berquin (yvesb@users.sourceforge.net) 00004 00005 This software is provided 'as-is', without any express or implied 00006 warranty. In no event will the authors be held liable for any 00007 damages arising from the use of this software. 00008 00009 Permission is granted to anyone to use this software for any 00010 purpose, including commercial applications, and to alter it and 00011 redistribute it freely, subject to the following restrictions: 00012 00013 1. The origin of this software must not be misrepresented; you must 00014 not claim that you wrote the original software. If you use this 00015 software in a product, an acknowledgment in the product documentation 00016 would be appreciated but is not required. 00017 00018 2. Altered source versions must be plainly marked as such, and 00019 must not be misrepresented as being the original software. 00020 00021 3. This notice may not be removed or altered from any source 00022 distribution. 00023 */ 00024 00030 #ifndef __XPATH_STACK_H 00031 #define __XPATH_STACK_H 00032 00033 #include "tinyxpath_conf.h" 00034 #include "xpath_expression.h" 00035 #include "xpath_stream.h" 00036 00037 namespace TinyXPath 00038 { 00039 00040 class result_and_next; 00041 00044 class xpath_stack 00045 { 00046 public : 00047 xpath_stack (); 00048 ~ xpath_stack (); 00049 void v_push (expression_result er_res); 00050 void v_push_int (int i_elem, const char * cp_comment = NULL); 00051 void v_push_bool (bool o_in); 00052 void v_push_string (TIXML_STRING S_in); 00053 void v_push_double (double d_elem); 00054 void v_push_node_set (node_set * nsp_ptr); 00055 00056 expression_result * erp_top (); 00057 int i_top_int (); 00058 00059 void v_pop (unsigned u_nb = 1); 00060 int i_pop_int (); 00061 TIXML_STRING S_pop_string (); 00062 bool o_pop_bool (); 00063 node_set ns_pop_node_set (); 00065 unsigned u_get_size () {return u_size;} 00066 expression_result * erp_previous (unsigned u_nb); 00067 #ifdef TINYXPATH_DEBUG 00068 void v_dump (); 00069 #endif 00070 protected : 00072 result_and_next * rnp_first; 00074 unsigned u_size; 00075 void v_pop_one (); 00076 } ; 00077 00078 } 00079 00080 #endif