# Poco::Util

# class FilesystemConfiguration

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

## Description

An implementation of AbstractConfiguration that stores configuration data in a directory hierarchy in the filesystem.

Every period-separated part of a property name is represented as a directory in the filesystem, relative to the base directory. Values are stored in files named "data".

All changes to properties are immediately persisted in the filesystem.

For example, a configuration consisting of the properties

    logging.loggers.root.channel.class = ConsoleChannel
    logging.loggers.app.name = Application
    logging.loggers.app.channel = c1
    logging.formatters.f1.class = PatternFormatter
    logging.formatters.f1.pattern = [%p] %t

is stored in the filesystem as follows:

    logging/
            loggers/
                    root/
                         channel/
                                 class/
                                       data ("ConsoleChannel")
                    app/
                        name/
                             data ("Application")
                        channel/
                                data ("c1")
            formatters/
                       f1/
                          class/
                                data ("PatternFormatter")
                          pattern/
                                  data ("[%p] %t")

## Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

## Member Summary

Member Functions: clear, enumerate, getRaw, keyToPath, 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, operator =, 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

### FilesystemConfiguration

FilesystemConfiguration(
const std::string & path
);

Creates a FilesystemConfiguration using the given path. All directories are created as necessary.

## Destructor

### ~FilesystemConfiguration

~FilesystemConfiguration();

## Member Functions

### clear

void clear();

Clears the configuration by erasing the configuration directory and all its subdirectories and files.

### enumerate

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

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

### getRaw

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

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

### keyToPath

Poco::Path keyToPath(
const std::string & key
) const;

### removeRaw

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

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

### setRaw

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

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