From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/tafgroup.cpp | 224 ++++++++++++++++++++++++------------------------ 1 file changed, 112 insertions(+), 112 deletions(-) (limited to 'src/stable/tafgroup.cpp') diff --git a/src/stable/tafgroup.cpp b/src/stable/tafgroup.cpp index 27af09e..7e15b26 100644 --- a/src/stable/tafgroup.cpp +++ b/src/stable/tafgroup.cpp @@ -10,215 +10,215 @@ #include "bu/tafcomment.h" Bu::TafGroup::TafGroup( const TafGroup &rSrc ) : - TafNode( typeGroup ), - sName( rSrc.sName ) + TafNode( typeGroup ), + sName( rSrc.sName ) { - for( NodeList::const_iterator i = rSrc.lChildren.begin(); i; i++ ) - { - switch( (*i)->getType() ) - { - case typeGroup: - addChild( new TafGroup( *dynamic_cast(*i) ) ); - break; + for( NodeList::const_iterator i = rSrc.lChildren.begin(); i; i++ ) + { + switch( (*i)->getType() ) + { + case typeGroup: + addChild( new TafGroup( *dynamic_cast(*i) ) ); + break; - case typeProperty: - addChild( new TafProperty( *dynamic_cast(*i) ) ); - break; + case typeProperty: + addChild( new TafProperty( *dynamic_cast(*i) ) ); + break; - case typeComment: - addChild( new TafComment( *dynamic_cast(*i) ) ); - break; - } - } + case typeComment: + addChild( new TafComment( *dynamic_cast(*i) ) ); + break; + } + } } Bu::TafGroup::TafGroup( const Bu::String &sName ) : - TafNode( typeGroup ), - sName( sName ) + TafNode( typeGroup ), + sName( sName ) { } Bu::TafGroup::~TafGroup() { - for( NodeList::iterator i = lChildren.begin(); i != lChildren.end(); i++ ) - { - delete (*i); - } + for( NodeList::iterator i = lChildren.begin(); i != lChildren.end(); i++ ) + { + delete (*i); + } } const Bu::String &Bu::TafGroup::getName() const { - return sName; + return sName; } void Bu::TafGroup::setName( const Bu::String &sName ) { - this->sName = sName; + this->sName = sName; } Bu::TafNode *Bu::TafGroup::addChild( Bu::TafNode *pNode ) { - switch( pNode->getType() ) - { - case typeGroup: - addChild( (Bu::TafGroup *)pNode ); - break; + switch( pNode->getType() ) + { + case typeGroup: + addChild( (Bu::TafGroup *)pNode ); + break; - case typeProperty: - addChild( (Bu::TafProperty *)pNode ); - break; + case typeProperty: + addChild( (Bu::TafProperty *)pNode ); + break; - case typeComment: - addChild( (Bu::TafComment *)pNode ); - break; - } + case typeComment: + addChild( (Bu::TafComment *)pNode ); + break; + } - return pNode; + return pNode; } Bu::TafGroup *Bu::TafGroup::addChild( TafGroup *pNode ) { - TafGroup *pGroup = (TafGroup *)pNode; - if( !hChildren.has( pGroup->getName() ) ) - hChildren.insert( pGroup->getName(), GroupList() ); - hChildren.get( pGroup->getName() ).append( pGroup ); - lChildren.append( pNode ); - return pNode; + TafGroup *pGroup = (TafGroup *)pNode; + if( !hChildren.has( pGroup->getName() ) ) + hChildren.insert( pGroup->getName(), GroupList() ); + hChildren.get( pGroup->getName() ).append( pGroup ); + lChildren.append( pNode ); + return pNode; } Bu::TafProperty *Bu::TafGroup::addChild( TafProperty *pNode ) { - TafProperty *pProperty = (TafProperty *)pNode; - if( !hProp.has( pProperty->getName() ) ) - hProp.insert( pProperty->getName(), PropList() ); - hProp.get( pProperty->getName() ).append( pProperty->getValue() ); - lChildren.append( pNode ); - return pNode; + TafProperty *pProperty = (TafProperty *)pNode; + if( !hProp.has( pProperty->getName() ) ) + hProp.insert( pProperty->getName(), PropList() ); + hProp.get( pProperty->getName() ).append( pProperty->getValue() ); + lChildren.append( pNode ); + return pNode; } Bu::TafComment *Bu::TafGroup::addChild( TafComment *pNode ) { - lChildren.append( pNode ); - return pNode; + lChildren.append( pNode ); + return pNode; } Bu::TafGroup *Bu::TafGroup::addGroup( const Bu::String &sName ) { - return addChild( new TafGroup( sName ) ); + return addChild( new TafGroup( sName ) ); } Bu::TafProperty *Bu::TafGroup::addProperty( - const Bu::String &sName, const Bu::String &sValue ) + const Bu::String &sName, const Bu::String &sValue ) { - return addChild( new TafProperty( sName, sValue ) ); + return addChild( new TafProperty( sName, sValue ) ); } bool Bu::TafGroup::hasChild( const Bu::String &sName ) const { - return hChildren.has( sName ); + return hChildren.has( sName ); } const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::String &sName ) const { - try { - return hChildren.get( sName ); - } catch( Bu::HashException &e ) - { - throw Bu::TafException("No children of group \"%s\" match \"%s\".", - this->sName.getStr(), sName.getStr() ); - } + try { + return hChildren.get( sName ); + } catch( Bu::HashException &e ) + { + throw Bu::TafException("No children of group \"%s\" match \"%s\".", + this->sName.getStr(), sName.getStr() ); + } } const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const { - return lChildren; + return lChildren; } const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::String &sName ) const { - try { - return hChildren.get( sName ).first(); - } catch( Bu::HashException &e ) - { - throw Bu::TafException("No children of group \"%s\" match \"%s\".", - this->sName.getStr(), sName.getStr() ); - } + try { + return hChildren.get( sName ).first(); + } catch( Bu::HashException &e ) + { + throw Bu::TafException("No children of group \"%s\" match \"%s\".", + this->sName.getStr(), sName.getStr() ); + } } bool Bu::TafGroup::hasProperty( const Bu::String &sName ) const { - return hProp.has( sName ); + return hProp.has( sName ); } const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::String &sName ) const { - try { - return hProp.get( sName ); - } catch( Bu::HashException &e ) - { - throw Bu::TafException("No properties of group \"%s\" match \"%s\".", - this->sName.getStr(), sName.getStr() ); - } + try { + return hProp.get( sName ); + } catch( Bu::HashException &e ) + { + throw Bu::TafException("No properties of group \"%s\" match \"%s\".", + this->sName.getStr(), sName.getStr() ); + } } const Bu::String &Bu::TafGroup::getProperty( const Bu::String &sName ) const { - try { - return hProp.get( sName ).first(); - } catch( Bu::HashException &e ) - { - throw Bu::TafException("No properties of group \"%s\" match \"%s\".", - this->sName.getStr(), sName.getStr() ); - } + try { + return hProp.get( sName ).first(); + } catch( Bu::HashException &e ) + { + throw Bu::TafException("No properties of group \"%s\" match \"%s\".", + this->sName.getStr(), sName.getStr() ); + } } const Bu::String &Bu::TafGroup::getProperty( const Bu::String &sName, - const Bu::String &sDef ) const + const Bu::String &sDef ) const { - try - { - return hProp.get( sName ).first(); - } - catch( Bu::HashException &e ) - { - return sDef; - } + try + { + return hProp.get( sName ).first(); + } + catch( Bu::HashException &e ) + { + return sDef; + } } const Bu::TafGroup *Bu::TafGroup::getChildByPath( - const Bu::String &sPath ) const + const Bu::String &sPath ) const { - return getChildByPath( sPath.split('/') ); + return getChildByPath( sPath.split('/') ); } const Bu::TafGroup *Bu::TafGroup::getChildByPath( Bu::StrList lPath ) const { - const Bu::TafGroup *cur = this; + const Bu::TafGroup *cur = this; - for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ ) - { - cur = cur->getChild( *i ); - } + for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ ) + { + cur = cur->getChild( *i ); + } - return cur; + return cur; } const Bu::String &Bu::TafGroup::getByPath( const Bu::String &sPath ) const { - return getByPath( sPath.split('/') ); + return getByPath( sPath.split('/') ); } const Bu::String &Bu::TafGroup::getByPath( Bu::StrList lPath ) const { - const Bu::TafGroup *cur = this; + const Bu::TafGroup *cur = this; - for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ ) - { - if( !(i+1) ) - break; - cur = cur->getChild( *i ); - } + for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ ) + { + if( !(i+1) ) + break; + cur = cur->getChild( *i ); + } - return cur->getProperty( lPath.last() ); + return cur->getProperty( lPath.last() ); } -- cgit v1.2.3