mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 05:29:41 +01:00
fixed GH# 262
This commit is contained in:
@@ -161,8 +161,33 @@ int AbstractConfiguration::getInt(const std::string& key, int defaultValue) cons
|
||||
}
|
||||
|
||||
|
||||
unsigned AbstractConfiguration::getUInt(const std::string& key) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
|
||||
std::string value;
|
||||
if (getRaw(key, value))
|
||||
return NumberParser::parseUnsigned(internalExpand(value));
|
||||
else
|
||||
throw NotFoundException(key);
|
||||
}
|
||||
|
||||
|
||||
unsigned AbstractConfiguration::getUInt(const std::string& key, unsigned defaultValue) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
|
||||
std::string value;
|
||||
if (getRaw(key, value))
|
||||
return NumberParser::parseUnsigned(internalExpand(value));
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
Int64 AbstractConfiguration::getInt64(const std::string& key) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
@@ -175,18 +200,6 @@ Int64 AbstractConfiguration::getInt64(const std::string& key) const
|
||||
}
|
||||
|
||||
|
||||
UInt64 AbstractConfiguration::getUInt64(const std::string& key) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
|
||||
std::string value;
|
||||
if (getRaw(key, value))
|
||||
return NumberParser::parseUnsigned64(internalExpand(value));
|
||||
else
|
||||
throw NotFoundException(key);
|
||||
}
|
||||
|
||||
|
||||
Int64 AbstractConfiguration::getInt64(const std::string& key, Int64 defaultValue) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
@@ -199,6 +212,18 @@ Int64 AbstractConfiguration::getInt64(const std::string& key, Int64 defaultValue
|
||||
}
|
||||
|
||||
|
||||
UInt64 AbstractConfiguration::getUInt64(const std::string& key) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
|
||||
std::string value;
|
||||
if (getRaw(key, value))
|
||||
return NumberParser::parseUnsigned64(internalExpand(value));
|
||||
else
|
||||
throw NotFoundException(key);
|
||||
}
|
||||
|
||||
|
||||
UInt64 AbstractConfiguration::getUInt64(const std::string& key, UInt64 defaultValue) const
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
@@ -210,6 +235,7 @@ UInt64 AbstractConfiguration::getUInt64(const std::string& key, UInt64 defaultVa
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
#endif // defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
@@ -281,6 +307,7 @@ void AbstractConfiguration::setUInt(const std::string& key, unsigned int value)
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
void AbstractConfiguration::setInt64(const std::string& key, Int64 value)
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
@@ -296,8 +323,10 @@ void AbstractConfiguration::setUInt64(const std::string& key, UInt64 value)
|
||||
setRawWithEvent(key, NumberFormatter::format(value));
|
||||
}
|
||||
|
||||
|
||||
#endif // defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
void AbstractConfiguration::setDouble(const std::string& key, double value)
|
||||
{
|
||||
setRawWithEvent(key, NumberFormatter::format(value));
|
||||
|
||||
Reference in New Issue
Block a user