XML: complete merge from 1.4.2

This commit is contained in:
Marian Krivos
2011-09-14 14:55:17 +00:00
parent 16ff8caf6b
commit 7e5c3a13d6
80 changed files with 9847 additions and 2282 deletions

View File

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