Poco::Util

class IniFileConfiguration

Library: Util
Package: Configuration
Header: Poco/Util/IniFileConfiguration.h

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>.<value 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.

Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

Member Summary

Member Functions: enumerate, getRaw, load, setRaw

Inherited Functions: createView, duplicate, enumerate, expand, getBool, getDouble, getInt, getRaw, getRawString, getString, hasOption, hasProperty, keys, parseBool, parseInt, referenceCount, release, setBool, setDouble, setInt, setRaw, setString

Constructors

IniFileConfiguration

IniFileConfiguration();

Creates an empty IniFileConfiguration.

IniFileConfiguration

IniFileConfiguration(
    std::istream & istr
);

Creates an IniFileConfiguration and loads the configuration data from the given stream, which must be in initialization file format.

IniFileConfiguration

IniFileConfiguration(
    const std::string & path
);

Creates an IniFileConfiguration and loads the configuration data from the given file, which must be in initialization file format.

Destructor

~IniFileConfiguration protected virtual

~IniFileConfiguration();

Member Functions

load

void load(
    std::istream & istr
);

Loads the configuration data from the given stream, which must be in initialization file format.

load

void load(
    const std::string & path
);

Loads the configuration data from the given file, which must be in initialization file format.

enumerate protected virtual

void enumerate(
    const std::string & key,
    Keys & range
) const;

See also: Poco::Util::AbstractConfiguration::enumerate()

getRaw protected virtual

bool getRaw(
    const std::string & key,
    std::string & value
) const;

See also: Poco::Util::AbstractConfiguration::getRaw()

setRaw protected virtual

void setRaw(
    const std::string & key,
    const std::string & value
);

See also: Poco::Util::AbstractConfiguration::setRaw()