OmniEvents
OmniEvents::RegistryKey Class Reference

Opens a windows registry key, and closed it upon destruction. More...

Public Member Functions

 RegistryKey (RegistryKey &right)
 Copy constructor, adopts ownership. More...
 
 RegistryKey (HKEY hkey, const char *subkey, REGSAM samDesired=KEY_QUERY_VALUE)
 Constructor, opens the key. More...
 
 ~RegistryKey ()
 Destructor, closes the key. More...
 
 operator bool () const
 
int setValueStr (const char *name, const char *data)
 
char * queryValueStr (const char *name, const int maxlen=2048) const
 

Private Member Functions

 RegistryKey ()
 No implementation. More...
 
 RegistryKey (HKEY hkey, bool open=true)
 

Private Attributes

HKEY _hkey
 
bool _open
 

Detailed Description

Opens a windows registry key, and closed it upon destruction.

Upon failure, it emits an error message and then quits. Why do I have to write this class myself??

Definition at line 86 of file daemon_windows.cc.

Constructor & Destructor Documentation

◆ RegistryKey() [1/4]

OmniEvents::RegistryKey::RegistryKey ( )
private

No implementation.

◆ RegistryKey() [2/4]

OmniEvents::RegistryKey::RegistryKey ( HKEY  hkey,
bool  open = true 
)
inlineprivate

Definition at line 92 of file daemon_windows.cc.

◆ RegistryKey() [3/4]

OmniEvents::RegistryKey::RegistryKey ( RegistryKey right)

Copy constructor, adopts ownership.

Definition at line 103 of file daemon_windows.cc.

References _open.

◆ RegistryKey() [4/4]

OmniEvents::RegistryKey::RegistryKey ( HKEY  hkey,
const char *  subkey,
REGSAM  samDesired = KEY_QUERY_VALUE 
)

Constructor, opens the key.

Definition at line 110 of file daemon_windows.cc.

References _hkey, and _open.

◆ ~RegistryKey()

OmniEvents::RegistryKey::~RegistryKey ( )

Destructor, closes the key.

Definition at line 123 of file daemon_windows.cc.

References _hkey, _open, HERE, and OmniEvents::Win::perror().

Member Function Documentation

◆ operator bool()

OmniEvents::RegistryKey::operator bool ( ) const
inline

Definition at line 97 of file daemon_windows.cc.

◆ queryValueStr()

char * OmniEvents::RegistryKey::queryValueStr ( const char *  name,
const int  maxlen = 2048 
) const

Definition at line 150 of file daemon_windows.cc.

References _hkey.

Referenced by OmniEvents::Service::readParameters().

◆ setValueStr()

int OmniEvents::RegistryKey::setValueStr ( const char *  name,
const char *  data 
)

Definition at line 136 of file daemon_windows.cc.

References _hkey.

Referenced by OmniEvents::Service::install(), and OmniEvents::Service::writeParameters().

Member Data Documentation

◆ _hkey

HKEY OmniEvents::RegistryKey::_hkey
private

Definition at line 88 of file daemon_windows.cc.

Referenced by queryValueStr(), RegistryKey(), setValueStr(), and ~RegistryKey().

◆ _open

bool OmniEvents::RegistryKey::_open
private

Definition at line 89 of file daemon_windows.cc.

Referenced by RegistryKey(), and ~RegistryKey().


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