| 184 | |
| 185 | |
| 186 | TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) |
| 187 | { |
| 188 | assert( node->parent == 0 || node->parent == this ); |
| 189 | assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); |
| 190 | |
| 191 | if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT ) |
| 192 | { |
| 193 | delete node; |
| 194 | if ( GetDocument() ) |
| 195 | GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); |
| 196 | return 0; |
| 197 | } |
| 198 | |
| 199 | node->parent = this; |
| 200 | |
| 201 | node->prev = lastChild; |
| 202 | node->next = 0; |
| 203 | |
| 204 | if ( lastChild ) |
| 205 | lastChild->next = node; |
| 206 | else |
| 207 | firstChild = node; // it was an empty list. |
| 208 | |
| 209 | lastChild = node; |
| 210 | return node; |
| 211 | } |
| 212 | |
| 213 | |
| 214 | TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) |
no test coverage detected