# Poco::Util

# class ConfigurationMapper

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

## Description

This configuration maps a property hierarchy into another hierarchy.

For example, given a configuration with the following properties:

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

and a ConfigurationView with fromPrefix == "config" and toPrefix == "root.conf", then the above properties will be available via the mapper as

    root.conf.value1
    root.conf.value2
    root.conf.sub.value1
    root.conf.sub.value2

FromPrefix can be empty, in which case, and given toPrefix == "root", the properties will be available as

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

This is equivalent to the functionality of the ConfigurationView class.

Similarly, toPrefix can also be empty. Given fromPrefix == "config" and toPrefix == "", the properties will be available as

    value1
    value2
    sub.value1
    sub.value2

If both fromPrefix and toPrefix are empty, no mapping is performed.

A ConfigurationMapper is most useful in combination with a LayeredConfiguration.

## Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

## Member Summary

Member Functions: enumerate, getRaw, operator =, removeRaw, setRaw, translateKey

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

### ConfigurationMapper

ConfigurationMapper(
const ConfigurationMapper & param563
) = delete;

### ConfigurationMapper

ConfigurationMapper(
const std::string & fromPrefix,
const std::string & toPrefix,
AbstractConfiguration::Ptr pConfig
);

Creates the ConfigurationMapper. The ConfigurationMapper retains (shared) ownership of the passed configuration.

## Destructor

### ~ConfigurationMapper

~ConfigurationMapper();

## Member Functions

### operator =

ConfigurationMapper & operator = (
const ConfigurationMapper & param564
) = delete;

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

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

### translateKey

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