mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
				synced 2025-10-30 18:17:50 +00:00 
			
		
		
		
	latest sources from main repository
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| // | ||||
| // WinRegistryConfiguration.cpp | ||||
| // | ||||
| // $Id: //poco/Main/Util/src/WinRegistryConfiguration.cpp#6 $ | ||||
| // $Id: //poco/Main/Util/src/WinRegistryConfiguration.cpp#7 $ | ||||
| // | ||||
| // Library: Util | ||||
| // Package: Windows | ||||
| @@ -63,25 +63,27 @@ bool WinRegistryConfiguration::getRaw(const std::string& key, std::string& value | ||||
| 	std::string keyName; | ||||
| 	std::string fullPath = _rootPath + ConvertToRegFormat(key, keyName); | ||||
| 	WinRegistryKey aKey(fullPath); | ||||
| 	WinRegistryKey::Type type = aKey.type(keyName); | ||||
| 	bool ret = true; | ||||
|  | ||||
| 	switch(type) | ||||
| 	bool exists = aKey.exists(keyName); | ||||
| 	if (exists) | ||||
| 	{ | ||||
| 	case WinRegistryKey::REGT_STRING: | ||||
| 		value = aKey.getString(keyName); | ||||
| 		break; | ||||
| 	case WinRegistryKey::REGT_STRING_EXPAND: | ||||
| 		value = aKey.getStringExpand(keyName); | ||||
| 		break; | ||||
| 	case WinRegistryKey::REGT_DWORD: | ||||
| 		value = Poco::NumberFormatter::format(aKey.getInt(keyName)); | ||||
| 		break; | ||||
| 	default: | ||||
| 		ret = false; | ||||
| 	} | ||||
| 		WinRegistryKey::Type type = aKey.type(keyName); | ||||
|  | ||||
| 	return ret; | ||||
| 		switch (type) | ||||
| 		{ | ||||
| 		case WinRegistryKey::REGT_STRING: | ||||
| 			value = aKey.getString(keyName); | ||||
| 			break; | ||||
| 		case WinRegistryKey::REGT_STRING_EXPAND: | ||||
| 			value = aKey.getStringExpand(keyName); | ||||
| 			break; | ||||
| 		case WinRegistryKey::REGT_DWORD: | ||||
| 			value = Poco::NumberFormatter::format(aKey.getInt(keyName)); | ||||
| 			break; | ||||
| 		default: | ||||
| 			exists = false; | ||||
| 		} | ||||
| 	} | ||||
| 	return exists; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| // | ||||
| // WinConfigurationTest.cpp | ||||
| // | ||||
| // $Id: //poco/Main/Util/testsuite/src/WinConfigurationTest.cpp#5 $ | ||||
| // $Id: //poco/Main/Util/testsuite/src/WinConfigurationTest.cpp#6 $ | ||||
| // | ||||
| // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. | ||||
| // and Contributors. | ||||
| @@ -64,6 +64,9 @@ void WinConfigurationTest::testConfiguration() | ||||
| 	assert (reg->getString("name2") == "value2"); | ||||
| 	assert (reg->hasProperty("name1")); | ||||
| 	assert (reg->hasProperty("name2")); | ||||
| 	 | ||||
| 	std::string dfl = reg->getString("nonexistent", "default"); | ||||
| 	assert (dfl == "default"); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Guenter Obiltschnig
					Guenter Obiltschnig