Class Poco::Util::IniFileConfiguration
Author: Applied Informatics Software Engineering GmbH and Contributors
Date: 2009-11-24

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

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

~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

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

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

### getRaw

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

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

### setRaw

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

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