Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Util::AbstractConfiguration Class Reference

#include <AbstractConfiguration.h>

Inheritance diagram for Poco::Util::AbstractConfiguration:

Poco::RefCountedObject Poco::Util::ConfigurationMapper Poco::Util::ConfigurationView Poco::Util::FilesystemConfiguration Poco::Util::IniFileConfiguration Poco::Util::LayeredConfiguration Poco::Util::MapConfiguration Poco::Util::SystemConfiguration Poco::Util::WinRegistryConfiguration Poco::Util::XMLConfiguration

List of all members.


Detailed Description

AbstractConfiguration is an abstract base class for different kinds of configuration data, such as INI files, property files, XML configuration files or the Windows Registry.

Configuration property keys have a hierarchical format, consisting of names separated by periods. The exact interpretation of key names is up to the actual subclass implementation of AbstractConfiguration. Keys are case sensitive.

All public methods are synchronized, so the class is safe for multithreaded use. AbstractConfiguration implements reference counting based garbage collection.

Subclasses must override the getRaw(), setRaw() and enumerate() methods.

Definition at line 53 of file AbstractConfiguration.h.


Public Types

typedef std::vector< std::string > Keys

Public Member Functions

AbstractConfigurationcreateView (const std::string &prefix)
 Creates a non-mutable view (see ConfigurationView) into the configuration.
const AbstractConfigurationcreateView (const std::string &prefix) const
void duplicate () const
std::string expand (const std::string &value) const
 Creates a view (see ConfigurationView) into the configuration.
bool getBool (const std::string &key, bool defaultValue) const
bool getBool (const std::string &key) const
double getDouble (const std::string &key, double defaultValue) const
double getDouble (const std::string &key) const
int getInt (const std::string &key, int defaultValue) const
int getInt (const std::string &key) const
std::string getRawString (const std::string &key, const std::string &defaultValue) const
std::string getRawString (const std::string &key) const
std::string getString (const std::string &key, const std::string &defaultValue) const
std::string getString (const std::string &key) const
bool hasOption (const std::string &key) const
 Returns true iff the property with the given key exists.
bool hasProperty (const std::string &key) const
 Creates the AbstractConfiguration.
void keys (const std::string &key, Keys &range) const
 Returns in range the names of all keys at root level.
void keys (Keys &range) const
int referenceCount () const
void release () const
 Increments the object's reference count.
void setBool (const std::string &key, bool value)
void setDouble (const std::string &key, double value)
void setInt (const std::string &key, int value)
void setString (const std::string &key, const std::string &value)

Protected Member Functions

virtual void enumerate (const std::string &key, Keys &range) const =0
virtual bool getRaw (const std::string &key, std::string &value) const =0
virtual void setRaw (const std::string &key, const std::string &value)=0

Static Protected Member Functions

static bool parseBool (const std::string &value)
static int parseInt (const std::string &value)

Private Member Functions

 AbstractConfiguration (const AbstractConfiguration &)
std::string internalExpand (const std::string &value) const
AbstractConfigurationoperator= (const AbstractConfiguration &)
std::string uncheckedExpand (const std::string &value) const

Private Attributes

int _depth
Poco::FastMutex _mutex

Friends

class ConfigurationMapper
class ConfigurationView
class LayeredConfiguration

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index