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

# Poco::Util

# class ConfigurationView

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

## Description

This configuration implements a "view" into a sub-hierarchy of another configuration.

For example, given a configuration with the following properties:

    config.value1
    config.value2
    config.sub.value1
    config.sub.value2

and a ConfigurationView with the prefix "config", then the above properties will be available via the view as

    value1
    value2
    sub.value1
    sub.value2

A ConfigurationView is most useful in combination with a LayeredConfiguration.

If a property is not found in the view, it is searched in the original configuration. Given the above example configuration, the property named "config.value1" will still be found in the view.

The main reason for this is that placeholder expansion (${property}) still works as expected given a ConfigurationView.

## Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

## Member Summary

Member Functions: enumerate, getRaw, setRaw, translateKey

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

### ConfigurationView

ConfigurationView(
const std::string & prefix,
AbstractConfiguration * pConfig
);

Creates the ConfigurationView. The ConfigurationView does not take ownership of the passed configuration.

## Destructor

### ~ConfigurationView

~ConfigurationView();

## Member Functions

### 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()

### translateKey

std::string translateKey(
const std::string & key
) const;