| 201 | |
| 202 | |
| 203 | TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) |
| 204 | { |
| 205 | assert( node->parent == 0 || node->parent == this ); |
| 206 | assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); |
| 207 | |
| 208 | if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT ) |
| 209 | { |
| 210 | delete node; |
| 211 | if ( GetDocument() ) |
| 212 | GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); |
| 213 | return 0; |
| 214 | } |
| 215 | |
| 216 | node->parent = this; |
| 217 | |
| 218 | node->prev = lastChild; |
| 219 | node->next = 0; |
| 220 | |
| 221 | if ( lastChild ) |
| 222 | lastChild->next = node; |
| 223 | else |
| 224 | firstChild = node; // it was an empty list. |
| 225 | |
| 226 | lastChild = node; |
| 227 | return node; |
| 228 | } |
| 229 | |
| 230 | |
| 231 | TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) |
no test coverage detected