TSDuck v3.46-4964
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsRegistry.h>

Collaboration diagram for ts::Registry:

Public Types

using Handle = system-specific

Static Public Member Functions

static bool CreateKey (const UString &key, bool is_volatile=false, Report &report=(ts::NullReport::Instance()))
static bool DeleteKey (const UString &key, Report &report=(ts::NullReport::Instance()))
static bool DeleteValue (const UString &key, const UString &value_name, Report &report=(ts::NullReport::Instance()))
static UString GetValue (const UString &key, const UString &value_name=UString(), Report &report=(ts::NullReport::Instance()))
static bool NotifyEnvironmentChange (Report &report=(ts::NullReport::Instance()))
static bool NotifySettingChange (Report &report=(ts::NullReport::Instance()))
static bool SetValue (const UString &key, const UString &value_name, const UString &value, bool expandable=false, Report &report=(ts::NullReport::Instance()))
static bool SetValue (const UString &key, const UString &value_name, uint32_t value, Report &report=(ts::NullReport::Instance()))
static bool SplitKey (const UString &key, Handle &root_key, UString &midkey, UString &final_key, Report &report=(ts::NullReport::Instance()))
static bool SplitKey (const UString &key, Handle &root_key, UString &subkey, Report &report=(ts::NullReport::Instance()))

Static Public Attributes

static const UString SystemEnvironmentKey
static const UString UserEnvironmentKey

Detailed Description

A class to encapsulate the access to the Windows registry.

Vocabulary :

  • Key : Node of the registry (kind of "directory").
  • Value_Name : Name of a value in a key.
  • Value : Value of the Value_Name.

This class is defined for all operating systems. So, it is possible to use it everywhere without complicated conditional compilation. However, all calls return an error on non-Windows systems.

Member Typedef Documentation

◆ Handle

using ts::Registry::Handle = system-specific

Handle to a registry key.

Member Function Documentation

◆ GetValue()

UString ts::Registry::GetValue ( const UString & key,
const UString & value_name = UString(),
Report & report = (ts::NullReport::Instance()) )
static

Get a value in a registry key as a string.

Parameters
[in]keyRegistry key.
[in]value_nameName of the value in key.
[in,out]reportWhere to report error.
Returns
An empty string if non-existent or error.

◆ SetValue() [1/2]

bool ts::Registry::SetValue ( const UString & key,
const UString & value_name,
const UString & value,
bool expandable = false,
Report & report = (ts::NullReport::Instance()) )
static

Set the value of a registry key.

Parameters
[in]keyRegistry key.
[in]value_nameName of the value in key.
[in]valueValue to set in value_name.
[in]expandableIf true, set the type to REG_EXPAND_SZ. Otherwise, set type to REG_SZ.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ SetValue() [2/2]

bool ts::Registry::SetValue ( const UString & key,
const UString & value_name,
uint32_t value,
Report & report = (ts::NullReport::Instance()) )
static

Set value of a registry key. Set the data type as REG_DWORD.

Parameters
[in]keyRegistry key.
[in]value_nameName of the value in key.
[in]valueValue to set in value_name. Set the data type as REG_DWORD.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ DeleteValue()

bool ts::Registry::DeleteValue ( const UString & key,
const UString & value_name,
Report & report = (ts::NullReport::Instance()) )
static

Delete a value of a registry key.

Parameters
[in]keyRegistry key.
[in]value_nameName of the value in key.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ CreateKey()

bool ts::Registry::CreateKey ( const UString & key,
bool is_volatile = false,
Report & report = (ts::NullReport::Instance()) )
static

Create a registry key.

Parameters
[in]keyRegistry key to create.
[in]is_volatileIf true, create a "volatile" registry key.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ DeleteKey()

bool ts::Registry::DeleteKey ( const UString & key,
Report & report = (ts::NullReport::Instance()) )
static

Delete a registry key.

Parameters
[in]keyRegistry key to delete.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ SplitKey() [1/2]

bool ts::Registry::SplitKey ( const UString & key,
Handle & root_key,
UString & subkey,
Report & report = (ts::NullReport::Instance()) )
static

Get the root key of a registry path.

Parameters
[in]keyRegistry key to split.
[out]root_keyHandle to the root key.
[out]subkeySubkey name.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ SplitKey() [2/2]

bool ts::Registry::SplitKey ( const UString & key,
Handle & root_key,
UString & midkey,
UString & final_key,
Report & report = (ts::NullReport::Instance()) )
static

Get the root key of a registry path.

Parameters
[in]keyRegistry key to split.
[out]root_keyHandle to the root key.
[out]midkeyMiddle key name (without root key and final component).
[out]final_keyFinal component of the key.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ NotifySettingChange()

bool ts::Registry::NotifySettingChange ( Report & report = (ts::NullReport::Instance()))
static

Notify all applications of a setting change.

Parameters
[in,out]reportWhere to report error.
Returns
True on success, false on error.

◆ NotifyEnvironmentChange()

bool ts::Registry::NotifyEnvironmentChange ( Report & report = (ts::NullReport::Instance()))
static

Notify all applications that the environment was modified.

Parameters
[in,out]reportWhere to report error.
Returns
True on success, false on error.

Member Data Documentation

◆ SystemEnvironmentKey

const UString ts::Registry::SystemEnvironmentKey
static

Name of the registry key containining the system-defined environment variables.

◆ UserEnvironmentKey

const UString ts::Registry::UserEnvironmentKey
static

Name of the registry key containining the user-defined environment variables.


The documentation for this class was generated from the following file: