# Poco::Util

# class WinRegistryConfiguration

Library: Util
Package: Windows
Header: Poco/Util/WinRegistryConfiguration.h

## Description

An implementation of AbstractConfiguration that stores configuration data in the Windows registry.

Removing key is not supported. An attempt to remove a key results in a NotImplementedException being thrown.

## Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

## Member Summary

Member Functions: convertToRegFormat, enumerate, getRaw, 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

### WinRegistryConfiguration

WinRegistryConfiguration(
const std::string & rootPath,
REGSAM extraSam = 0
);

Creates the WinRegistryConfiguration. The rootPath must start with one of the root key names like HKEY_CLASSES_ROOT, e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. All further keys are relative to the root path and can be dot separated, e.g. the path MyService.ServiceName will be converted to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\ServiceName. The extraSam parameter will be passed along to WinRegistryKey, to control registry virtualization for example.

## Destructor

### ~WinRegistryConfiguration

~WinRegistryConfiguration() = default;

Destroys the WinRegistryConfiguration.

## Member Functions

### convertToRegFormat

std::string convertToRegFormat(
const std::string & key,
std::string & keyName
) const;

Takes a key in the format of A.B.C and converts it to registry format A\B\C, the last entry is the keyName, the rest is returned as path

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