aboutsummaryrefslogtreecommitdiff
path: root/src/xmlnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlnode.cpp')
-rw-r--r--src/xmlnode.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/xmlnode.cpp b/src/xmlnode.cpp
index 8468047..b1ed9a9 100644
--- a/src/xmlnode.cpp
+++ b/src/xmlnode.cpp
@@ -181,7 +181,7 @@ const char *XmlNode::getProperty( const char *sName )
181 return tmp; 181 return tmp;
182} 182}
183 183
184bool XmlNode::deleteProperty( int nIndex ) 184void XmlNode::deleteProperty( int nIndex )
185{ 185{
186 hProperties.del( ((std::string *)lPropNames[nIndex])->c_str() ); 186 hProperties.del( ((std::string *)lPropNames[nIndex])->c_str() );
187 187
@@ -217,18 +217,13 @@ const char *XmlNode::getName()
217 return sName.c_str(); 217 return sName.c_str();
218} 218}
219 219
220bool XmlNode::deleteNode( int nIndex, const char *sReplacementText ) 220void XmlNode::deleteNode( int nIndex, const char *sReplacementText )
221{ 221{
222 XmlNode *xRet = detatchNode( nIndex, sReplacementText ); 222 XmlNode *xRet = detatchNode( nIndex, sReplacementText );
223 223
224 if( xRet == NULL ) 224 if( xRet != NULL )
225 {
226 return false;
227 }
228 else
229 { 225 {
230 delete xRet; 226 delete xRet;
231 return true;
232 } 227 }
233} 228}
234 229
@@ -317,16 +312,14 @@ XmlNode *XmlNode::detatchNode( int nIndex, const char *sReplacementText )
317 return xRet; 312 return xRet;
318} 313}
319 314
320bool XmlNode::replaceNode( int nIndex, XmlNode *pNewNode ) 315void XmlNode::replaceNode( int nIndex, XmlNode *pNewNode )
321{ 316{
322 if( nIndex < 0 || nIndex >= lChildren.getSize() ) 317 if( nIndex < 0 || nIndex >= lChildren.getSize() )
323 return false; 318 return; //TODO: throw an exception
324 319
325 delete (XmlNode *)lChildren[nIndex]; 320 delete (XmlNode *)lChildren[nIndex];
326 lChildren.setAt( nIndex, pNewNode ); 321 lChildren.setAt( nIndex, pNewNode );
327 pNewNode->pParent = this; 322 pNewNode->pParent = this;
328
329 return true;
330} 323}
331 324
332XmlNode *XmlNode::getCopy() 325XmlNode *XmlNode::getCopy()
@@ -388,7 +381,7 @@ XmlNode *XmlNode::getCopy()
388 return pNew; 381 return pNew;
389} 382}
390 383
391bool XmlNode::deleteNodeKeepChildren( int nIndex ) 384void XmlNode::deleteNodeKeepChildren( int nIndex )
392{ 385{
393 // This is a tricky one...we need to do some patching to keep things all 386 // This is a tricky one...we need to do some patching to keep things all
394 // even... 387 // even...
@@ -396,7 +389,7 @@ bool XmlNode::deleteNodeKeepChildren( int nIndex )
396 389
397 if( xRet == NULL ) 390 if( xRet == NULL )
398 { 391 {
399 return false; 392 return;
400 } 393 }
401 else 394 else
402 { 395 {
@@ -443,12 +436,10 @@ bool XmlNode::deleteNodeKeepChildren( int nIndex )
443 } 436 }
444 437
445 deleteNode( nIndex+nSize ); 438 deleteNode( nIndex+nSize );
446 return true;
447 } 439 }
448
449} 440}
450 441
451bool XmlNode::replaceNodeWithChildren( int nIndex, XmlNode *pNewNode ) 442void XmlNode::replaceNodeWithChildren( int nIndex, XmlNode *pNewNode )
452{ 443{
453} 444}
454 445