XMLConfiguration now supports modifying properties (contributed by Tom Tan)

This commit is contained in:
Guenter Obiltschnig
2008-02-16 21:02:14 +00:00
parent 78349bba1f
commit f716fdc5d6
3 changed files with 84 additions and 10 deletions

View File

@@ -9,7 +9,7 @@
//
// Definition of the XMLConfiguration class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
@@ -46,6 +46,7 @@
#include "Poco/DOM/AutoPtr.h"
#include "Poco/SAX/InputSource.h"
#include <istream>
#include <ostream>
namespace Poco {
@@ -87,8 +88,9 @@ class Util_API XMLConfiguration: public AbstractConfiguration
/// Enumerating attributes is not supported.
/// Calling keys("prop3.prop4") will return an empty range.
///
/// Setting properties is not supported. An attempt to set a property results
/// in a NotImplementedException being thrown.
/// Setting properties is supported, with the restriction that only
/// the value of existing properties can be changed.
/// There is currently no way to programmatically add properties.
{
public:
XMLConfiguration();
@@ -132,6 +134,14 @@ public:
/// Loads the XML document containing the configuration data
/// from the given XML node.
void save(std::ostream& ostr);
/// Writes the XML document containing the configuration data
/// to the given stream.
void save(const std::string& path);
/// Writes the XML document containing the configuration data
/// to the given file.
protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);