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.

  • a line starting with a semicolon is treated as a comment and ignored
  • a line starting with a square bracket denotes a section key [<key>]
  • every other line denotes a property assignment in the form <value key> = <value>

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.

Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

Member Summary

Member Functions: enumerate, getRaw, load, removeRaw, setRaw

Inherited Functions: createLocalView, createView, duplicate, enableEvents, enumerate, eventsEnabled, expand, getBool, getDouble, getInt, getInt16, getInt32, getInt64, getRaw, getRawString, getString, getUInt, getUInt16, getUInt32, getUInt64, has, hasOption, hasProperty, keys, parseBool, parseInt, parseInt16, parseInt64, parseUInt, parseUInt16, parseUInt64, referenceCount, release, remove, removeRaw, setBool, setDouble, setInt, setInt16, setInt32, setInt64, setRaw, setRawWithEvent, setString, setUInt, setUInt16, setUInt32, setUInt64

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;

getRaw protected virtual

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

removeRaw protected virtual

void removeRaw(
    const std::string & key
);

setRaw protected virtual

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