MCPcopy Create free account
hub / github.com/MyGUI/mygui / xpath_node_set_raw

Class xpath_node_set_raw

Tools/EditorFramework/pugixml.cpp:7520–7637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7518}
7519
7520class xpath_node_set_raw
7521{
7522 xpath_node_set::type_t _type;
7523
7524 xpath_node* _begin;
7525 xpath_node* _end;
7526 xpath_node* _eos;
7527
7528public:
7529 xpath_node_set_raw() :
7530 _type(xpath_node_set::type_unsorted),
7531 _begin(0),
7532 _end(0),
7533 _eos(0)
7534 {
7535 }
7536
7537 xpath_node* begin() const
7538 {
7539 return _begin;
7540 }
7541
7542 xpath_node* end() const
7543 {
7544 return _end;
7545 }
7546
7547 bool empty() const
7548 {
7549 return _begin == _end;
7550 }
7551
7552 size_t size() const
7553 {
7554 return static_cast<size_t>(_end - _begin);
7555 }
7556
7557 xpath_node first() const
7558 {
7559 return xpath_first(_begin, _end, _type);
7560 }
7561
7562 void push_back(const xpath_node& node, xpath_allocator* alloc)
7563 {
7564 if (_end == _eos)
7565 {
7566 size_t capacity = static_cast<size_t>(_eos - _begin);
7567
7568 // get new capacity (1.5x rule)
7569 size_t new_capacity = capacity + capacity / 2 + 1;
7570
7571 // reallocate the old array or allocate a new one
7572 xpath_node* data = static_cast<xpath_node*>(
7573 alloc->reallocate(_begin, capacity * sizeof(xpath_node), new_capacity * sizeof(xpath_node)));
7574 assert(data);
7575
7576 // finalize
7577 _begin = data;

Callers 1

eval_node_setMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected