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/unstable/settingsdrivertaf.cpp | 148 ++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'src/unstable/settingsdrivertaf.cpp') diff --git a/src/unstable/settingsdrivertaf.cpp b/src/unstable/settingsdrivertaf.cpp index 8cbcbc5..3fd61b3 100644 --- a/src/unstable/settingsdrivertaf.cpp +++ b/src/unstable/settingsdrivertaf.cpp @@ -6,97 +6,97 @@ #include Bu::SettingsDriverTaf::SettingsDriverTaf() : - pRoot( NULL ) + pRoot( NULL ) { } Bu::SettingsDriverTaf::~SettingsDriverTaf() { - if( !pRoot ) - return; + if( !pRoot ) + return; - Bu::File fOut( sPath, Bu::File::WriteNew ); - Bu::TafWriter tw( fOut ); - tw.writeGroup( pRoot ); - delete pRoot; + Bu::File fOut( sPath, Bu::File::WriteNew ); + Bu::TafWriter tw( fOut ); + tw.writeGroup( pRoot ); + delete pRoot; } void Bu::SettingsDriverTaf::init( const Bu::UtfString &sCompany, - const Bu::UtfString &sProduct ) + const Bu::UtfString &sProduct ) { - Bu::UtfString us( getenv("HOME") ); - us += "/.config/"; - us += sCompany; - us += "/"; - us += sProduct; - sPath = us.get(); - try - { - Bu::File fIn( sPath, Bu::File::Read|Bu::File::Create ); - Bu::TafReader tr( fIn ); - pRoot = tr.readGroup(); - } - catch(...) - { - } - if( !pRoot ) - { - pRoot = new Bu::TafGroup( sProduct.get() ); - } + Bu::UtfString us( getenv("HOME") ); + us += "/.config/"; + us += sCompany; + us += "/"; + us += sProduct; + sPath = us.get(); + try + { + Bu::File fIn( sPath, Bu::File::Read|Bu::File::Create ); + Bu::TafReader tr( fIn ); + pRoot = tr.readGroup(); + } + catch(...) + { + } + if( !pRoot ) + { + pRoot = new Bu::TafGroup( sProduct.get() ); + } } void Bu::SettingsDriverTaf::set( const Bu::UtfString &sKey, - const Bu::UtfString &sValue ) + const Bu::UtfString &sValue ) { - Bu::StringList lPath = sKey.get().split('/'); - Bu::StringList::iterator i = lPath.begin(); - Bu::StringList::iterator in; - Bu::TafGroup *pGrp = pRoot; - for(; i;) - { - in = i; - in++; - if( in ) - { - if( pGrp->hasChild( *i ) ) - pGrp = (Bu::TafGroup *)pGrp->getChild( *i ); - else - pGrp = pGrp->addGroup( *i ); - } - else - { - pGrp->addProperty( *i, sValue.get() ); - } - i = in; - } + Bu::StringList lPath = sKey.get().split('/'); + Bu::StringList::iterator i = lPath.begin(); + Bu::StringList::iterator in; + Bu::TafGroup *pGrp = pRoot; + for(; i;) + { + in = i; + in++; + if( in ) + { + if( pGrp->hasChild( *i ) ) + pGrp = (Bu::TafGroup *)pGrp->getChild( *i ); + else + pGrp = pGrp->addGroup( *i ); + } + else + { + pGrp->addProperty( *i, sValue.get() ); + } + i = in; + } } Bu::UtfString Bu::SettingsDriverTaf::get( const Bu::UtfString &sKey, - const Bu::UtfString &sValue ) + const Bu::UtfString &sValue ) { - Bu::StringList lPath = sKey.get().split('/'); - Bu::StringList::iterator i = lPath.begin(); - Bu::StringList::iterator in; - Bu::TafGroup *pGrp = pRoot; - for(; i;) - { - in = i; - in++; - if( in ) - { - if( pGrp->hasChild( *i ) ) - pGrp = (Bu::TafGroup *)pGrp->getChild( *i ); - else - return sValue; - } - else - { - if( pGrp->hasProperty( *i ) ) - return pGrp->getProperty( *i ); - else - return sValue; - } - i = in; - } + Bu::StringList lPath = sKey.get().split('/'); + Bu::StringList::iterator i = lPath.begin(); + Bu::StringList::iterator in; + Bu::TafGroup *pGrp = pRoot; + for(; i;) + { + in = i; + in++; + if( in ) + { + if( pGrp->hasChild( *i ) ) + pGrp = (Bu::TafGroup *)pGrp->getChild( *i ); + else + return sValue; + } + else + { + if( pGrp->hasProperty( *i ) ) + return pGrp->getProperty( *i ); + else + return sValue; + } + i = in; + } } -- cgit v1.2.3