OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::Win::Reg::Key Class Reference

Wrapper class for a Registry key handle. More...

#include <reg.hpp>

Public Member Functions

 Key (HKEY key, const std::wstring &subkey, bool create=false)
 Construct a Key with an open handle for a subkey under key.
 
 Key (Key &key, const std::wstring &subkey, bool create=false)
 
 Key (const std::wstring &subkey, bool create=false)
 Construct a Key with an open handle for a subkey under HKLM.
 
 Key ()=default
 
 Key (Key &&rhs)
 
Keyoperator= (Key &&rhs)
 
 ~Key ()
 
bool defined () const
 Check for a valid key handle.
 
PHKEY ref ()
 Retrun a pointer to the Registry key handle.
 
HKEY operator() ()
 Return the Registry key handle.
 

Private Member Functions

 Key (const Key &)=delete
 
Keyoperator= (const Key &)=delete
 

Private Attributes

HKEY key_ = static_cast<HKEY>(INVALID_HANDLE_VALUE)
 

Detailed Description

Wrapper class for a Registry key handle.

Definition at line 44 of file reg.hpp.

Constructor & Destructor Documentation

◆ Key() [1/6]

openvpn::Win::Reg::Key::Key ( const Key )
privatedelete

◆ Key() [2/6]

openvpn::Win::Reg::Key::Key ( HKEY  key,
const std::wstring &  subkey,
bool  create = false 
)
inline

Construct a Key with an open handle for a subkey under key.

In case the subkey cannot be opened or created, the handle remains invalid.

Parameters
keythe key handle which the subkey is relative to
subkeythe subkey to open for the object
createwhether the subkey will be created if it doesn't exist

Definition at line 59 of file reg.hpp.

◆ Key() [3/6]

openvpn::Win::Reg::Key::Key ( Key key,
const std::wstring &  subkey,
bool  create = false 
)
inline

Definition at line 87 of file reg.hpp.

◆ Key() [4/6]

openvpn::Win::Reg::Key::Key ( const std::wstring &  subkey,
bool  create = false 
)
inline

Construct a Key with an open handle for a subkey under HKLM.

In case the subkey cannot be opened or created, the handle remains invalid.

Parameters
subkeythe subkey to open for the object
createwhether the subkey will be created if it doesn't exist

Definition at line 99 of file reg.hpp.

◆ Key() [5/6]

openvpn::Win::Reg::Key::Key ( )
default

◆ Key() [6/6]

openvpn::Win::Reg::Key::Key ( Key &&  rhs)
inline

Definition at line 106 of file reg.hpp.

◆ ~Key()

openvpn::Win::Reg::Key::~Key ( )
inline

Definition at line 122 of file reg.hpp.

Member Function Documentation

◆ defined()

bool openvpn::Win::Reg::Key::defined ( ) const
inline

Check for a valid key handle.

Returns
true if the handle is valid
false if the handle is invalid

Definition at line 136 of file reg.hpp.

Here is the caller graph for this function:

◆ operator()()

HKEY openvpn::Win::Reg::Key::operator() ( )
inline

Return the Registry key handle.

Returns
HKEY the key handle

Definition at line 155 of file reg.hpp.

◆ operator=() [1/2]

Key & openvpn::Win::Reg::Key::operator= ( const Key )
privatedelete

◆ operator=() [2/2]

Key & openvpn::Win::Reg::Key::operator= ( Key &&  rhs)
inline

Definition at line 115 of file reg.hpp.

◆ ref()

PHKEY openvpn::Win::Reg::Key::ref ( )
inline

Retrun a pointer to the Registry key handle.

Returns
PHKEY the Registry key handle pointer

Definition at line 146 of file reg.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ key_

HKEY openvpn::Win::Reg::Key::key_ = static_cast<HKEY>(INVALID_HANDLE_VALUE)
private

Definition at line 161 of file reg.hpp.


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