diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 20:26:23 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 20:26:23 +0000 |
| commit | 8fbf5fda24392d2a2ee19d6f40699a5de29da662 (patch) | |
| tree | ac79c447bc4897d8cc350068504f184fdb8e4cfa /src/xmlnode.cpp | |
| parent | 2bb05378f31311c353d43688fa753822ab9a6461 (diff) | |
| download | libbu++-8fbf5fda24392d2a2ee19d6f40699a5de29da662.tar.gz libbu++-8fbf5fda24392d2a2ee19d6f40699a5de29da662.tar.bz2 libbu++-8fbf5fda24392d2a2ee19d6f40699a5de29da662.tar.xz libbu++-8fbf5fda24392d2a2ee19d6f40699a5de29da662.zip | |
Everything in libbu++ now passes -Wall, this should have been done a long time
ago.
Diffstat (limited to '')
| -rw-r--r-- | src/xmlnode.cpp | 25 |
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 | ||
| 184 | bool XmlNode::deleteProperty( int nIndex ) | 184 | void 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 | ||
| 220 | bool XmlNode::deleteNode( int nIndex, const char *sReplacementText ) | 220 | void 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 | ||
| 320 | bool XmlNode::replaceNode( int nIndex, XmlNode *pNewNode ) | 315 | void 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 | ||
| 332 | XmlNode *XmlNode::getCopy() | 325 | XmlNode *XmlNode::getCopy() |
| @@ -388,7 +381,7 @@ XmlNode *XmlNode::getCopy() | |||
| 388 | return pNew; | 381 | return pNew; |
| 389 | } | 382 | } |
| 390 | 383 | ||
| 391 | bool XmlNode::deleteNodeKeepChildren( int nIndex ) | 384 | void 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 | ||
| 451 | bool XmlNode::replaceNodeWithChildren( int nIndex, XmlNode *pNewNode ) | 442 | void XmlNode::replaceNodeWithChildren( int nIndex, XmlNode *pNewNode ) |
| 452 | { | 443 | { |
| 453 | } | 444 | } |
| 454 | 445 | ||
