fixed GH# 262

This commit is contained in:
Guenter Obiltschnig
2013-09-14 10:26:44 +02:00
parent a2aee92b74
commit cdbebdf487

View File

@@ -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));