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

Method append

Tools/EditorFramework/pugixml.cpp:7585–7606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7583 }
7584
7585 void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc)
7586 {
7587 size_t size_ = static_cast<size_t>(_end - _begin);
7588 size_t capacity = static_cast<size_t>(_eos - _begin);
7589 size_t count = static_cast<size_t>(end_ - begin_);
7590
7591 if (size_ + count > capacity)
7592 {
7593 // reallocate the old array or allocate a new one
7594 xpath_node* data = static_cast<xpath_node*>(
7595 alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node)));
7596 assert(data);
7597
7598 // finalize
7599 _begin = data;
7600 _end = data + size_;
7601 _eos = data + size_ + count;
7602 }
7603
7604 memcpy(_end, begin_, count * sizeof(xpath_node));
7605 _end += count;
7606 }
7607
7608 void sort_do()
7609 {

Callers 2

eval_node_setMethod · 0.45

Calls 1

reallocateMethod · 0.45

Tested by

no test coverage detected