mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-01 17:25:03 +02:00
latest sources from main repository
This commit is contained in:
parent
9913f74f8d
commit
cfca5df1b6
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// WinRegistryConfiguration.cpp
|
// WinRegistryConfiguration.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Util/src/WinRegistryConfiguration.cpp#6 $
|
// $Id: //poco/Main/Util/src/WinRegistryConfiguration.cpp#7 $
|
||||||
//
|
//
|
||||||
// Library: Util
|
// Library: Util
|
||||||
// Package: Windows
|
// Package: Windows
|
||||||
@ -63,8 +63,10 @@ bool WinRegistryConfiguration::getRaw(const std::string& key, std::string& value
|
|||||||
std::string keyName;
|
std::string keyName;
|
||||||
std::string fullPath = _rootPath + ConvertToRegFormat(key, keyName);
|
std::string fullPath = _rootPath + ConvertToRegFormat(key, keyName);
|
||||||
WinRegistryKey aKey(fullPath);
|
WinRegistryKey aKey(fullPath);
|
||||||
|
bool exists = aKey.exists(keyName);
|
||||||
|
if (exists)
|
||||||
|
{
|
||||||
WinRegistryKey::Type type = aKey.type(keyName);
|
WinRegistryKey::Type type = aKey.type(keyName);
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -78,10 +80,10 @@ bool WinRegistryConfiguration::getRaw(const std::string& key, std::string& value
|
|||||||
value = Poco::NumberFormatter::format(aKey.getInt(keyName));
|
value = Poco::NumberFormatter::format(aKey.getInt(keyName));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = false;
|
exists = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// WinConfigurationTest.cpp
|
// 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.
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
@ -64,6 +64,9 @@ void WinConfigurationTest::testConfiguration()
|
|||||||
assert (reg->getString("name2") == "value2");
|
assert (reg->getString("name2") == "value2");
|
||||||
assert (reg->hasProperty("name1"));
|
assert (reg->hasProperty("name1"));
|
||||||
assert (reg->hasProperty("name2"));
|
assert (reg->hasProperty("name2"));
|
||||||
|
|
||||||
|
std::string dfl = reg->getString("nonexistent", "default");
|
||||||
|
assert (dfl == "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user