40 #ifndef _xmlwrapp_nodes_view_h_
41 #define _xmlwrapp_nodes_view_h_
45 #include "xmlwrapp/export.h"
54 class const_nodes_view;
60 class iter_advance_functor;
61 struct xpath_context_impl;
84 nodes_view() : data_begin_(0), advance_func_(0) {}
102 typedef int difference_type;
105 typedef std::forward_iterator_tag iterator_category;
107 iterator() : pimpl_(0), advance_func_(0) {}
119 explicit iterator(
void *data, impl::iter_advance_functor *advance_func);
120 void* get_raw_node()
const;
123 impl::nipimpl *pimpl_;
127 impl::iter_advance_functor *advance_func_;
131 friend bool XMLWRAPP_API operator==(
const iterator& lhs,
const iterator& rhs);
145 typedef int difference_type;
148 typedef std::forward_iterator_tag iterator_category;
164 explicit const_iterator(
void *data, impl::iter_advance_functor *advance_func);
165 void* get_raw_node()
const;
168 impl::nipimpl *pimpl_;
172 impl::iter_advance_functor *advance_func_;
195 bool empty()
const {
return !data_begin_; }
229 explicit nodes_view(
void *data_begin, impl::iter_advance_functor *advance_func)
230 : data_begin_(data_begin), advance_func_(advance_func) {}
235 impl::iter_advance_functor *advance_func_;
238 friend struct impl::xpath_context_impl;
280 bool empty()
const {
return !data_begin_; }
283 explicit const_nodes_view(
void *data_begin, impl::iter_advance_functor *advance_func)
284 : data_begin_(data_begin), advance_func_(advance_func) {}
289 impl::iter_advance_functor *advance_func_;
292 friend struct impl::xpath_context_impl;
297 inline bool operator==(
const nodes_view::iterator& lhs,
const nodes_view::iterator& rhs)
298 {
return lhs.get_raw_node() == rhs.get_raw_node(); }
299 inline bool operator!=(
const nodes_view::iterator& lhs,
const nodes_view::iterator& rhs)
300 {
return !(lhs == rhs); }
302 inline bool operator==(
const nodes_view::const_iterator& lhs,
const nodes_view::const_iterator& rhs)
303 {
return lhs.get_raw_node() == rhs.get_raw_node(); }
304 inline bool operator!=(
const nodes_view::const_iterator& lhs,
const nodes_view::const_iterator& rhs)
305 {
return !(lhs == rhs); }
309 #endif // _xmlwrapp_nodes_view_h_