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/settingsdriverregistry.cpp | 116 ++++++++++++++++---------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'src/unstable/settingsdriverregistry.cpp') diff --git a/src/unstable/settingsdriverregistry.cpp b/src/unstable/settingsdriverregistry.cpp index 89eda7b..983f48e 100644 --- a/src/unstable/settingsdriverregistry.cpp +++ b/src/unstable/settingsdriverregistry.cpp @@ -12,80 +12,80 @@ Bu::SettingsDriverRegistry::SettingsDriverRegistry() Bu::SettingsDriverRegistry::~SettingsDriverRegistry() { - RegCloseKey( *phKey ); + RegCloseKey( *phKey ); } void Bu::SettingsDriverRegistry::init( const Bu::UtfString &sCompany, const Bu::UtfString &sProduct ) { - Bu::UtfString us("Software\\"); - us += sCompany; - us += "\\"; - us += sProduct; - rphKey = new HKEY; - RegCreateKeyExA( HKEY_CURRENT_USER, us.get().getStr(), 0, NULL, 0, KEY_ALL_ACCESS, NULL, phKey, NULL ); + Bu::UtfString us("Software\\"); + us += sCompany; + us += "\\"; + us += sProduct; + rphKey = new HKEY; + RegCreateKeyExA( HKEY_CURRENT_USER, us.get().getStr(), 0, NULL, 0, KEY_ALL_ACCESS, NULL, phKey, NULL ); } void Bu::SettingsDriverRegistry::set( const Bu::UtfString &sKey, const Bu::UtfString &sValue ) { - Bu::StringList lPath = sKey.get().split('/'); - Bu::StringList::iterator i = lPath.begin(); - Bu::StringList::iterator in; + Bu::StringList lPath = sKey.get().split('/'); + Bu::StringList::iterator i = lPath.begin(); + Bu::StringList::iterator in; - Bu::String sPKey; - for(; i;) - { - in = i; - in++; - if( in ) - { - if( !sPKey.isEmpty() ) - sPKey += "\\"; - sPKey += *i; - } - i = in; - } + Bu::String sPKey; + for(; i;) + { + in = i; + in++; + if( in ) + { + if( !sPKey.isEmpty() ) + sPKey += "\\"; + sPKey += *i; + } + i = in; + } - HKEY key; - RegCreateKeyExA( *phKey, sPKey.getStr(), 0, NULL, 0, KEY_ALL_ACCESS, NULL, &key, NULL ); - Bu::String sTmp = sValue.get(); - RegSetValueExA( key, lPath.last().getStr(), 0, REG_SZ, (BYTE *)sTmp.getStr(), sTmp.getSize()+1 ); - RegCloseKey( key ); + HKEY key; + RegCreateKeyExA( *phKey, sPKey.getStr(), 0, NULL, 0, KEY_ALL_ACCESS, NULL, &key, NULL ); + Bu::String sTmp = sValue.get(); + RegSetValueExA( key, lPath.last().getStr(), 0, REG_SZ, (BYTE *)sTmp.getStr(), sTmp.getSize()+1 ); + RegCloseKey( key ); } Bu::UtfString Bu::SettingsDriverRegistry::get( const Bu::UtfString &sKey, const Bu::UtfString &sValue ) { - Bu::StringList lPath = sKey.get().split('/'); - Bu::StringList::iterator i = lPath.begin(); - Bu::StringList::iterator in; + Bu::StringList lPath = sKey.get().split('/'); + Bu::StringList::iterator i = lPath.begin(); + Bu::StringList::iterator in; - Bu::String sPKey; - for(; i;) - { - in = i; - in++; - if( in ) - { - if( !sPKey.isEmpty() ) - sPKey += "\\"; - sPKey += *i; - } - i = in; - } + Bu::String sPKey; + for(; i;) + { + in = i; + in++; + if( in ) + { + if( !sPKey.isEmpty() ) + sPKey += "\\"; + sPKey += *i; + } + i = in; + } - HKEY key; - if( RegOpenKeyExA( *phKey, sPKey.getStr(), 0, KEY_ALL_ACCESS, &key ) - != ERROR_SUCCESS ) - return sValue; - char buf[4096]; - DWORD iRet = 4096; - if( RegQueryValueEx( key, lPath.last().getStr(), NULL, NULL, (BYTE *)buf, &iRet ) != ERROR_SUCCESS ) - { - RegCloseKey( key ); - return sValue; - } - RegCloseKey( key ); - - return Bu::UtfString( Bu::String( buf, iRet ) ); + HKEY key; + if( RegOpenKeyExA( *phKey, sPKey.getStr(), 0, KEY_ALL_ACCESS, &key ) + != ERROR_SUCCESS ) + return sValue; + char buf[4096]; + DWORD iRet = 4096; + if( RegQueryValueEx( key, lPath.last().getStr(), NULL, NULL, (BYTE *)buf, &iRet ) != ERROR_SUCCESS ) + { + RegCloseKey( key ); + return sValue; + } + RegCloseKey( key ); + + return Bu::UtfString( Bu::String( buf, iRet ) ); } #endif -- cgit v1.2.3