| 4667 | } |
| 4668 | |
| 4669 | PUGI__FN xml_attribute xml_node::prepend_attribute(const char_t* name_) |
| 4670 | { |
| 4671 | if (type() != node_element && type() != node_declaration) |
| 4672 | return xml_attribute(); |
| 4673 | |
| 4674 | xml_attribute a(impl::allocate_attribute(impl::get_allocator(_root))); |
| 4675 | if (!a) |
| 4676 | return xml_attribute(); |
| 4677 | |
| 4678 | a.set_name(name_); |
| 4679 | |
| 4680 | xml_attribute_struct* head = _root->first_attribute; |
| 4681 | |
| 4682 | if (head) |
| 4683 | { |
| 4684 | a._attr->prev_attribute_c = head->prev_attribute_c; |
| 4685 | head->prev_attribute_c = a._attr; |
| 4686 | } |
| 4687 | else |
| 4688 | a._attr->prev_attribute_c = a._attr; |
| 4689 | |
| 4690 | a._attr->next_attribute = head; |
| 4691 | _root->first_attribute = a._attr; |
| 4692 | |
| 4693 | return a; |
| 4694 | } |
| 4695 | |
| 4696 | PUGI__FN xml_attribute xml_node::insert_attribute_before(const char_t* name_, const xml_attribute& attr) |
| 4697 | { |
nothing calls this directly
no test coverage detected