Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

W32DLib::Registry Class Reference

The Registry class. More...

#include <w32dlib/registry.h>

List of all members.

Public Member Functions

 Registry (HKEY root, const char *path, bool permanent)
 Opens the supplied registry key read/write.
 Registry (HKEY root, const char *path)
 Opens the supplied registry key read only.
virtual ~Registry ()
 Destructor.
bool IsOpen ()
 Sees whether the key was opened.
bool Read (const char *name, bool &val)
 Reads a boolean value from the registry.
bool Read (const char *name, unsigned &val)
 Reads an integer value from the registry.
bool Read (const char *name, std::string &val)
 Reads a string value from the registry.
bool Write (const char *name, bool val)
 Writes a boolean value to the registry.
bool Write (const char *name, unsigned val)
 Writes an integer value to the registry.
bool Write (const char *name, const char *val)
 Writes a string value to the registry.
bool Write (const char *name, const std::string &val)
 Writes a string value to the registry.


Detailed Description

The Registry class.

Gives basic registry access.


Constructor & Destructor Documentation

W32DLib::Registry::Registry HKEY  root,
const char *  path,
bool  permanent
 

Opens the supplied registry key read/write.

Parameters:
root The root of the key (use Windows HKEY_xxx constants).
path The path to the key.
permanent If false then the key is created volatile (ie. not saved to disk). This is ignored by Windows for Win9X.

W32DLib::Registry::Registry HKEY  root,
const char *  path
 

Opens the supplied registry key read only.

Parameters:
root The root of the key (use Windows HKEY_xxx constants).
path The path to the key.

virtual W32DLib::Registry::~Registry  )  [virtual]
 

Destructor.

This closes the registry key.


Member Function Documentation

bool W32DLib::Registry::IsOpen  ) 
 

Sees whether the key was opened.

Returns:
True if the key was created/opened OK.

bool W32DLib::Registry::Read const char *  name,
std::string &  val
 

Reads a string value from the registry.

Parameters:
name The name of the value.
val A reference to a place to store the result.
Returns:
True if the value could be read.

bool W32DLib::Registry::Read const char *  name,
unsigned &  val
 

Reads an integer value from the registry.

Parameters:
name The name of the value.
val A reference to a place to store the result.
Returns:
True if the value could be read.

bool W32DLib::Registry::Read const char *  name,
bool &  val
 

Reads a boolean value from the registry.

Booleans are implemented as a DWORD entry with a value 1 or 0.

Parameters:
name The name of the value.
val A reference to a place to store the result.
Returns:
True if the value could be read.

bool W32DLib::Registry::Write const char *  name,
const std::string &  val
 

Writes a string value to the registry.

Parameters:
name The name of the value.
val The value.
Returns:
True if the value was written.

bool W32DLib::Registry::Write const char *  name,
const char *  val
 

Writes a string value to the registry.

Parameters:
name The name of the value.
val The value.
Returns:
True if the value was written.

bool W32DLib::Registry::Write const char *  name,
unsigned  val
 

Writes an integer value to the registry.

Parameters:
name The name of the value.
val The value.
Returns:
True if the value was written.

bool W32DLib::Registry::Write const char *  name,
bool  val
 

Writes a boolean value to the registry.

Booleans are implemented as a DWORD entry with a value 1 or 0.

Parameters:
name The name of the value.
val The value.
Returns:
True if the value could be read.


The documentation for this class was generated from the following file:
Generated on Fri May 6 01:22:33 2005 for W32DLib by  doxygen 1.4.1