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

Poco::Util::IniFileConfiguration Class Reference

#include <IniFileConfiguration.h>

Inheritance diagram for Poco::Util::IniFileConfiguration:

Poco::Util::AbstractConfiguration Poco::RefCountedObject

List of all members.

Detailed Description

This implementation of a Configuration reads properties from a legacy Windows initialization (.ini) file.

The file syntax is implemented as follows.


The name of a property is composed of the section key and the value key, separated by a period (<section key>="">.


Property names are not case sensitive. Leading and trailing whitespace is removed from both keys and values.

Setting properties is not supported. An attempt to set a property results in a NotImplementedException being thrown.

Definition at line 53 of file IniFileConfiguration.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.
 IniFileConfiguration (const std::string &path)
 IniFileConfiguration (std::istream &istr)
 Creates an empty IniFileConfiguration.
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
void load (const std::string &path)
void load (std::istream &istr)
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
void enumerate (const std::string &key, Keys &range) const
bool getRaw (const std::string &key, std::string &value) const
void setRaw (const std::string &key, const std::string &value)

Static Protected Member Functions

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

Private Types

typedef std::map< std::string,
std::string, ICompare > 

Private Member Functions

void parseLine (std::istream &istr)

Private Attributes

IStringMap _map
std::string _sectionKey


struct  ICompare

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

Generated by  Doxygen 1.6.0   Back to index