mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 20:59:45 +01:00
XML: complete merge from 1.4.2
This commit is contained in:
@@ -79,6 +79,12 @@ bool AbstractConfiguration::hasOption(const std::string& key) const
|
||||
return hasProperty(key);
|
||||
}
|
||||
|
||||
|
||||
bool AbstractConfiguration::has(const std::string& key) const
|
||||
{
|
||||
return hasProperty(key);
|
||||
}
|
||||
|
||||
|
||||
std::string AbstractConfiguration::getString(const std::string& key) const
|
||||
{
|
||||
@@ -202,33 +208,25 @@ bool AbstractConfiguration::getBool(const std::string& key, bool defaultValue) c
|
||||
|
||||
void AbstractConfiguration::setString(const std::string& key, const std::string& value)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
setRaw(key, value);
|
||||
setRawWithEvent(key, value);
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::setInt(const std::string& key, int value)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
setRaw(key, NumberFormatter::format(value));
|
||||
setRawWithEvent(key, NumberFormatter::format(value));
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::setDouble(const std::string& key, double value)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
setRaw(key, NumberFormatter::format(value));
|
||||
setRawWithEvent(key, NumberFormatter::format(value));
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::setBool(const std::string& key, bool value)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
setRaw(key, value ? "true" : "false");
|
||||
setRawWithEvent(key, value ? "true" : "false");
|
||||
}
|
||||
|
||||
|
||||
@@ -292,6 +290,24 @@ std::string AbstractConfiguration::expand(const std::string& value) const
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::remove(const std::string& key)
|
||||
{
|
||||
propertyRemoving(this, key);
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
removeRaw(key);
|
||||
}
|
||||
propertyRemoved(this, key);
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::removeRaw(const std::string& key)
|
||||
{
|
||||
throw Poco::NotImplementedException("removeRaw()");
|
||||
}
|
||||
|
||||
|
||||
std::string AbstractConfiguration::internalExpand(const std::string& value) const
|
||||
{
|
||||
AutoCounter counter(_depth);
|
||||
@@ -367,4 +383,17 @@ bool AbstractConfiguration::parseBool(const std::string& value)
|
||||
}
|
||||
|
||||
|
||||
void AbstractConfiguration::setRawWithEvent(const std::string& key, std::string value)
|
||||
{
|
||||
KeyValue kv(key, value);
|
||||
propertyChanging(this, kv);
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
setRaw(key, value);
|
||||
}
|
||||
propertyChanged(this, kv);
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Util
|
||||
|
||||
Reference in New Issue
Block a user