| 7827 | } |
| 7828 | |
| 7829 | class xpath_node_set_raw |
| 7830 | { |
| 7831 | xpath_node_set::type_t _type; |
| 7832 | |
| 7833 | xpath_node* _begin; |
| 7834 | xpath_node* _end; |
| 7835 | xpath_node* _eos; |
| 7836 | |
| 7837 | public: |
| 7838 | xpath_node_set_raw(): _type(xpath_node_set::type_unsorted), _begin(0), _end(0), _eos(0) |
| 7839 | { |
| 7840 | } |
| 7841 | |
| 7842 | xpath_node* begin() const |
| 7843 | { |
| 7844 | return _begin; |
| 7845 | } |
| 7846 | |
| 7847 | xpath_node* end() const |
| 7848 | { |
| 7849 | return _end; |
| 7850 | } |
| 7851 | |
| 7852 | bool empty() const |
| 7853 | { |
| 7854 | return _begin == _end; |
| 7855 | } |
| 7856 | |
| 7857 | size_t size() const |
| 7858 | { |
| 7859 | return static_cast<size_t>(_end - _begin); |
| 7860 | } |
| 7861 | |
| 7862 | xpath_node first() const |
| 7863 | { |
| 7864 | return xpath_first(_begin, _end, _type); |
| 7865 | } |
| 7866 | |
| 7867 | void push_back_grow(const xpath_node& node, xpath_allocator* alloc); |
| 7868 | |
| 7869 | void push_back(const xpath_node& node, xpath_allocator* alloc) |
| 7870 | { |
| 7871 | if (_end != _eos) |
| 7872 | *_end++ = node; |
| 7873 | else |
| 7874 | push_back_grow(node, alloc); |
| 7875 | } |
| 7876 | |
| 7877 | void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc) |
| 7878 | { |
| 7879 | if (begin_ == end_) return; |
| 7880 | |
| 7881 | size_t size_ = static_cast<size_t>(_end - _begin); |
| 7882 | size_t capacity = static_cast<size_t>(_eos - _begin); |
| 7883 | size_t count = static_cast<size_t>(end_ - begin_); |
| 7884 | |
| 7885 | if (size_ + count > capacity) |
| 7886 | { |