RegistryEntry Class Reference

Represents an entry in the registry consisting of a key, subkeys, and some values. More...

#include <registry.h>

Inheritance diagram for RegistryEntry:

ClassRegistryEntry VersionIndependentProgID WizOpRegistryEntry List of all members.

Public Member Functions

virtual ~RegistryEntry ()
virtual BOOL GetValue (const StringBase &ValueName, StringBase *const pValue)
 Returns a value with the given name under this registry key.
virtual BOOL GetEmbeddedEntry (const StringBase &Name, RegistryEntry *const pEntry) const
 Returns a "subkey" of the given entry.

Protected Member Functions

 RegistryEntry (HKEY hKey=0)
 RegistryEntry (const RegistryEntry &)

Protected Attributes

HKEY m_hKey

Detailed Description

Represents an entry in the registry consisting of a key, subkeys, and some values.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: It can't be instantiated, but derived classes should provide implementation to initialize the HKEY held herein.

See Also: ClassRegistryEntry

Definition at line 276 of file registry.h.


Constructor & Destructor Documentation

RegistryEntry::~RegistryEntry  )  [inline, virtual]
 

Definition at line 387 of file registry.h.

00388 {
00389     CloseRegKey(m_hKey);
00390 }

RegistryEntry::RegistryEntry HKEY  hKey = 0  )  [inline, protected]
 

Definition at line 285 of file registry.h.

00285 : m_hKey(hKey)  {}

RegistryEntry::RegistryEntry const RegistryEntry  )  [inline, protected]
 

Definition at line 392 of file registry.h.

00393 {   
00394     TRACE( _T("RegistryEntry - Copy constructor not implemented\n"));
00395 }


Member Function Documentation

BOOL RegistryEntry::GetEmbeddedEntry const StringBase Name,
RegistryEntry *const   pEntry
const [virtual]
 

Returns a "subkey" of the given entry.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
Name,: The name of the subkey value (not Null String) [INPUTS]
pEntry,: A pointer to the registry entry of the given Name. [OUTPUTS]

Definition at line 1414 of file registry.cpp.

01415 {
01416     pEntry->m_hKey = OpenRegKey(m_hKey, Name);
01417 
01418     return (pEntry->m_hKey != NULL);
01419 }

BOOL RegistryEntry::GetValue const StringBase ValueName,
StringBase *const   pValue
[virtual]
 

Returns a value with the given name under this registry key.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
ValueName,: The name of the subkey value (Null String will work) [INPUTS]
pValue,: The data associated with the given name [OUTPUTS]
Returns:
TRUE if the value was found, FALSE if not
Notes: Only works for the local registry no matter what

Definition at line 1439 of file registry.cpp.

01440 {
01441     ERROR2IF(pValue == NULL, FALSE, "NULL Args");
01442 
01443     DWORD dwType = REG_SZ, dwSize = pValue->MaxLength();
01444 
01445     return (::RegQueryValueEx(m_hKey, ValueName, NULL, &dwType, (LPBYTE)((LPTSTR)*pValue), &dwSize) == 
01446             ERROR_SUCCESS) && dwType == REG_SZ && dwSize <= DWORD(pValue->MaxLength());
01447 }


Member Data Documentation

HKEY RegistryEntry::m_hKey [protected]
 

Definition at line 290 of file registry.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:25 2007 for Camelot by  doxygen 1.4.4