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

## Inheritance

Direct Base Classes: AbstractConfiguration

All Base Classes: Poco::RefCountedObject, AbstractConfiguration

## Member Summary

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

### WinRegistryConfiguration

WinRegistryConfiguration(
const std::string & rootPath
);

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 relativ to the root path and can be dot seperated, e.g. the path MyService.ServiceName will be converted to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\ServiceName.

## Destructor

### ~WinRegistryConfiguration

~WinRegistryConfiguration();

Destroys the WinRegistryConfiguration.

## Member Functions

### enumerate

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

Returns in range the names of all subkeys under the given key. If an empty key is passed, all root level keys are returned.

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

### getRaw

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

If the property with the given key exists, stores the property's value in value and returns true. Otherwise, returns false.

Must be overridden by subclasses.

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

### setRaw

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

Sets the property with the given key to the given value. An already existing value for the key is overwritten.

Must be overridden by subclasses.

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

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