Appends a new child node. The appended child becomes the last child. \param child Node to append.
| 1095 | //! The appended child becomes the last child. |
| 1096 | //! \param child Node to append. |
| 1097 | void append_node(xml_node<Ch> *child) |
| 1098 | { |
| 1099 | assert(child && !child->parent() && child->type() != node_document); |
| 1100 | if (first_node()) |
| 1101 | { |
| 1102 | child->m_prev_sibling = m_last_node; |
| 1103 | m_last_node->m_next_sibling = child; |
| 1104 | } |
| 1105 | else |
| 1106 | { |
| 1107 | child->m_prev_sibling = 0; |
| 1108 | m_first_node = child; |
| 1109 | } |
| 1110 | m_last_node = child; |
| 1111 | child->m_parent = this; |
| 1112 | child->m_next_sibling = 0; |
| 1113 | } |
| 1114 | |
| 1115 | //! Inserts a new child node at specified place inside the node. |
| 1116 | //! All children after and including the specified node are moved one position back. |
no test coverage detected