Download Source Code

CRKey Class Reference

Contains a list of registry values for a single key. More...

#include <RKey.h>

Inheritance diagram for CRKey:

Inheritance graph
[legend]
Collaboration diagram for CRKey:

Collaboration graph
[legend]
List of all members.

Public Member Functions

LPREGVALUE AddFile (LPCTSTR pName, LPCTSTR pFilename)
 Reads the contents of a file in as a variable.
BOOL DeleteValue (LPCTSTR pValue)
 Deletes the named value from the list.
BOOL EncodeUrl (CPipe *pPipe, DWORD dwEncoding=1, char chSepNameVal= '=', char chSepValues= '&')
 Encodes the variables as a URL GET string.
BOOL EncodeHttpHeaders (CPipe *pPipe)
 Encodes the variables as HTTP request headers.
BOOL IsSet (LPCTSTR pName)
 Non-zero if specified value exists.
BOOL RestoreWindowPos (HWND hWnd, LPCTSTR pName, BOOL bSize=TRUE, BOOL bPosition=TRUE)
 Restores a window position from a value.
BOOL SaveWindowPos (HWND hWnd, LPCTSTR pName)
 Saves the window position into a value.
void * GetValuePtr (LPCTSTR pName)
 Returns a pointer to the specifed value data.
DWORD GetValueSize (LPCTSTR pName)
 Returns the number of bytes in the value.
BOOL Copy (CCfgFile *pCfg, LPCTSTR pGroup)
 Copies the specified group from the CCfgFile class.
BOOL Update (CRKey *pRk)
 Adds values in specified key that are missing from this key.
BOOL Copy (CRKey *pRk, BOOL bMerge=FALSE)
 Copies the values from one key.
BOOL Parse (LPCTSTR buf, DWORD size, char sep= ',')
 Parses a name-value pair and adds to the list.
BOOL Replace (LPCTSTR pSrc, LPCTSTR pDst)
 Replaces escape tokens in pDst with variable values.
BOOL Replace (CPipe *out, LPDWORD op, LPCTSTR in, DWORD dwin, LPCTSTR pBegin, LPCTSTR pEnd, LPSTR pBreak, CVar *params, LPDWORD pdwBreak, char sep= '&')
 Replaces escape tokens in pDst with variable values.
BOOL Replace (LPSTR out, LPDWORD op, DWORD dwout, LPCTSTR in, DWORD dwin, LPCTSTR pStop=NULL, LPSTR pBreak=NULL, LPDWORD pdwBreak=NULL)
BOOL Replace (LPSTR out, LPDWORD op, DWORD dwout, LPCTSTR in, DWORD dwin, LPCTSTR pStop, LPSTR pBreak, CRKey *params, LPDWORD pdwBreak)
DWORD Write (LPVOID dst, DWORD ptr, DWORD max, const void *src, DWORD size=0)
 Writes data to buffer.
BOOL UpdateData (BOOL bRead, LPCTSTR pName, LPDWORD pDw, DWORD dwDefault=0)
 Updates key or value location.
BOOL UpdateData (BOOL bRead, LPCTSTR pName, void *ptr, DWORD size, void *pDefault=NULL)
 Updates key or value location.
BOOL UpdateData (BOOL bRead, LPCTSTR pName, LPSTR pStr, DWORD size, LPCTSTR pDefault="")
 Updates key or value location.
BOOL Get (LPCTSTR pName, CRKey *pRk)
BOOL Set (LPCTSTR pName, CRKey *pRk)
LPREGVALUE Get (LPREGVALUE prv, LPDWORD pdw)
 Returns the DWORD representation of the named value.
LPREGVALUE Get (LPCTSTR pName, LPDWORD pdw)
 Returns the DWORD representation of the named value.
LPREGVALUE Get (LPREGVALUE prv, LPLONG pl)
 Returns the long representation of the named value.
LPREGVALUE Get (LPCTSTR pName, LPLONG pl)
 Returns the long representation of the named value.
LPREGVALUE Get (LPREGVALUE prv, double *pd)
 Returns the double representation of the named value.
LPREGVALUE Get (LPCTSTR pName, double *pd)
 Returns the double representation of the named value.
LPREGVALUE Get (LPREGVALUE prv, void *ptr, DWORD size)
 Returns the binary representation of the named value.
LPREGVALUE Get (LPCTSTR pName, void *ptr, DWORD size)
 Returns the binary representation of the named value.
LPREGVALUE Get (LPREGVALUE prv, LPSTR str, DWORD size)
 Returns the string representation of the named value.
LPREGVALUE Get (LPCTSTR pName, LPSTR str, DWORD size)
 Returns the string representation of the named value.
LPCTSTR GetSz (LPREGVALUE prv, LPCTSTR pDefault="")
 Returns a pointer to the string representation of value.
LPCTSTR GetSz (LPCTSTR pName, LPCTSTR pDefault="")
 Returns a pointer to the string representation of value.
DWORD GetDword (LPREGVALUE prv, DWORD dwDefault=0)
 Returns the DWORD representation of value.
DWORD GetDword (LPCTSTR pName, DWORD dwDefault=0)
 Returns the DWORD representation of value.
LONG GetLong (LPREGVALUE prv, LONG lDefault=0)
 Returns the long representation of value.
LONG GetLong (LPCTSTR pName, LONG lDefault=0)
 Returns the long representation of value.
double GetDouble (LPREGVALUE prv, double dDefault=0)
 Returns the double representation of value.
double GetDouble (LPCTSTR pName, double dDefault=0)
 Returns the double representation of value.
BOOL GetKeyFromName (LPCTSTR pName, PHKEY phKey, LPSTR pKey)
 Converts a string name of Windows registry root key to key handle.
BOOL GetKey (HKEY hKey, LPCTSTR pKey, BOOL bMerge=FALSE)
 Reads the specifed key fron the Windows registry.
LPREGVALUE Add (DWORD dwType, LPCTSTR pName, const void *pValue, DWORD dwValue, BOOL bFile=FALSE)
 Adds the specified binary value to the list.
LPREGVALUE Set (LPCTSTR pName, double dValue)
 Sets the double representation of a value.
LPREGVALUE Set (LPCTSTR pName, DWORD dwValue)
 Sets the DWORD representation of a value.
LPREGVALUE Set (LPCTSTR pName, LONG lValue)
 Sets the long representation of a value.
LPREGVALUE Set (LPCTSTR pName, int iValue)
 Sets the int representation of a value.
LPREGVALUE Set (LPCTSTR pName, short iValue)
 Sets the short representation of a value.
LPREGVALUE Set (LPCTSTR pName, UINT uValue)
 Sets the unsigned int representation of a value.
LPREGVALUE Set (LPCTSTR pName, LPCTSTR pValue)
 Sets the string representation of a value.
LPREGVALUE SetStr (LPCTSTR pName, LPCTSTR pValue, DWORD dwLen)
 Sets the string representation of a value.
LPREGVALUE Set (LPCTSTR pName, const void *pValue, DWORD dwValue)
 Sets the binary representation of a value.
virtual void DeleteObject (void *node)
 Provides custom destruction for REGVALUE structures.
virtual DWORD GetObjSize ()
 Returns the size of a REGVALUE structure.
BOOL SetName (LPCTSTR pName)
 Sets the name of this key.
LPCTSTR GetName ()
 Returns the name of the current key.
 CRKey ()
 Default constructor.
virtual ~CRKey ()
 Destructor.
void SetMinSize (DWORD min)
 Sets the minimum memory allocation size for a value.
BOOL ReadInline (LPCTSTR pStr)
 Reads name-value pairs from a HTTP GET URL style encoding.
BOOL ReadInline (LPBYTE buf, DWORD size, char sep= '&', BOOL bDeCanonicalize=TRUE)
 Reads name-value pairs from a HTTP GET URL style encoding.
BOOL ReadMIME (LPCTSTR pStr)
 Reads name-value pairs from a MIME or HTTP header style encoding.
BOOL ReadMIME (LPBYTE buf, DWORD size)
 Reads name-value pairs from a MIME or HTTP header style encoding.

Static Public Member Functions

static BOOL SetValue (HKEY hKey, LPCTSTR pKey, LPCTSTR pValue, LPVOID pData, DWORD dwSize, DWORD dwType=REG_SZ)
 Sets the value of the specified Windows registry key.
static DWORD GetValue (HKEY hKey, LPCTSTR pKey, LPCTSTR pValue, LPVOID pData, DWORD dwSize, LPDWORD pdwType=NULL)
 Returns the value of the specified Windows registry key.
static BOOL DeleteSubKeys (HKEY hRoot, LPCTSTR pKey)
 Deletes the sub keys of specified key in Windows Registry.
static BOOL DeleteKey (HKEY hKey, LPCTSTR pKey, BOOL bSubKeys=TRUE)
 Deletes the specified key.
static BOOL GetKeyName (HKEY hKey, LPCTSTR pKey, LPSTR pName)
 Returns a string describing the specified key.

Detailed Description

Contains a list of registry values for a single key.

This class implements a list of registry values for a single key. It also serves as a gereral purpose property bag for linear value heirarchies.


Member Function Documentation

LPREGVALUE CRKey::Add DWORD  dwType,
LPCTSTR  pName,
const void *  pValue,
DWORD  dwValue,
BOOL  bFile = FALSE
 

Adds the specified binary value to the list.

Parameters:
[in] dwType - Value type
[in] pName - Value name
[in] pValue - Value data
[in] dwValue - Number of bytes in pValue
[in] bFile - Non-zero if pValue is a filename
Returns:
Pointer to REGVALUE structure if success, otherwise NULL
See also:

LPREGVALUE CRKey::AddFile LPCTSTR  pName,
LPCTSTR  pFilename
[inline]
 

Reads the contents of a file in as a variable.

Parameters:
[in] pName - Value name
[in] pFilename - Filename to read
Returns:
Pointer to new REGVALUE object if success
See also:

BOOL CRKey::Copy CRKey pRk,
BOOL  bMerge = FALSE
 

Copies the values from one key.

Parameters:
[in] pRk - Source key
[in] bMerge - Non-zero to merge key values
Returns:
Non-zero if success
See also:

BOOL CRKey::Copy CCfgFile pCfg,
LPCTSTR  pGroup
 

Copies the specified group from the CCfgFile class.

Parameters:
[in] pCfg - CCfgFile class pointer
[in] pGroup - Name of group to copy.
This is for converting between the two value types.

Returns:
Non-zero if success
See also:

BOOL CRKey::DeleteKey HKEY  hKey,
LPCTSTR  pKey,
BOOL  bSubKeys = TRUE
[static]
 

Deletes the specified key.

Parameters:
[in] hKey - Handle to root key
[in] pKey - Key name
[in] bSubKeys - Non-zero to delete sub keys, if zero, only values are deleted.
Returns:
Non-zero if success
See also:

void CRKey::DeleteObject void *  node  )  [virtual]
 

Provides custom destruction for REGVALUE structures.

Parameters:
[in] node - Pointer to REGVALUE structure

Reimplemented from CHList.

BOOL CRKey::DeleteSubKeys HKEY  hRoot,
LPCTSTR  pKey
[static]
 

Deletes the sub keys of specified key in Windows Registry.

Parameters:
[in] hRoot - Key root
[in] pKey - Sub key name
Returns:
Non-zero if key is deleted
See also:

BOOL CRKey::DeleteValue LPCTSTR  pValue  ) 
 

Deletes the named value from the list.

Parameters:
[in] pValue - Value name
Returns:
Non-zero if value was deleted
See also:

BOOL CRKey::EncodeHttpHeaders CPipe pPipe  ) 
 

Encodes the variables as HTTP request headers.

Parameters:
[out] pPipe - CPipe object that receives the data
Returns:
Non-zero if success
See also:

BOOL CRKey::EncodeUrl CPipe pPipe,
DWORD  dwEncoding = 1,
char  chSepNameVal = '=',
char  chSepValues = '&'
 

Encodes the variables as a URL GET string.

Parameters:
[out] pPipe - CPipe object that receives the data
[in] dwEncoding - The type of url encoding to use
  • 0 = None
  • 1 = Normal URL
  • 2 = Double URL encoding
[in] chSepNameVal - The separator between the name and value tokens. Such as the = in name=value.
[in] chSepValues - The separator between the name and value pairs. Such as the & in name1=value1&name2=value2.
Returns:
Non-zero if success
See also:

LPREGVALUE CRKey::Get LPCTSTR  pName,
LPSTR  str,
DWORD  size
 

Returns the string representation of the named value.

Parameters:
[in] pName - Value name
[out] str - Receives the value
[in] size - Size of buffer in str
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPREGVALUE  prv,
LPSTR  str,
DWORD  size
 

Returns the string representation of the named value.

Parameters:
[in] prv - Pointer to reg value structure
[out] str - Receives the value
[in] size - Size of buffer in str
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPCTSTR  pName,
void *  ptr,
DWORD  size
 

Returns the binary representation of the named value.

Parameters:
[in] pName - Value name
[out] ptr - Receives the value
[in] size - Size of buffer in ptr
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPREGVALUE  prv,
void *  ptr,
DWORD  size
 

Returns the binary representation of the named value.

Parameters:
[in] prv - Pointer to reg value structure
[out] ptr - Receives the value
[in] size - Size of buffer in ptr
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPCTSTR  pName,
double *  pd
 

Returns the double representation of the named value.

Parameters:
[in] pName - Value name
[out] pd - Receives the value
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPREGVALUE  prv,
double *  pd
 

Returns the double representation of the named value.

Parameters:
[in] prv - Pointer to reg value structure
[out] pd - Receives the value
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPCTSTR  pName,
LPLONG  pl
[inline]
 

Returns the long representation of the named value.

Parameters:
[in] pName - Value name
[out] pl - Receives the value
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPREGVALUE  prv,
LPLONG  pl
[inline]
 

Returns the long representation of the named value.

Parameters:
[in] prv - Pointer to reg value structure
[out] pl - Receives the value
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPCTSTR  pName,
LPDWORD  pdw
 

Returns the DWORD representation of the named value.

Parameters:
[in] pName - Value name
[out] pdw - Receives the value
Returns:
Pointer to value key structure
See also:

LPREGVALUE CRKey::Get LPREGVALUE  prv,
LPDWORD  pdw
 

Returns the DWORD representation of the named value.

Parameters:
[in] prv - Pointer to reg value structure
[out] pdw - Receives the value
Returns:
Pointer in prv
See also:

BOOL CRKey::Get LPCTSTR  pName,
CRKey pRk
 

Parameters:
[in] pName - Variable name.
[out] pRk - Pointer to CRKey object that receives the de-serialized variables.
Returns:
Non-zero if success
See also:
Set()

double CRKey::GetDouble LPCTSTR  pName,
double  dDefault = 0
 

Returns the double representation of value.

Parameters:
[in] pName - Pointer to reg value structure
[in] dDefault - Default value
Returns:
Pointer to value or dDefault
See also:

double CRKey::GetDouble LPREGVALUE  prv,
double  dDefault = 0
 

Returns the double representation of value.

Parameters:
[in] prv - Pointer to reg value structure
[in] dDefault - Default value
Returns:
Pointer to value or dDefault
See also:

DWORD CRKey::GetDword LPCTSTR  pName,
DWORD  dwDefault = 0
 

Returns the DWORD representation of value.

Parameters:
[in] pName - Value name
[in] dwDefault - Default value
Returns:
Pointer to value or dwDefault
See also:

DWORD CRKey::GetDword LPREGVALUE  prv,
DWORD  dwDefault = 0
 

Returns the DWORD representation of value.

Parameters:
[in] prv - Pointer to reg value structure
[in] dwDefault - Default value
Returns:
Pointer to value or dwDefault
See also:

BOOL CRKey::GetKey HKEY  hKey,
LPCTSTR  pKey,
BOOL  bMerge = FALSE
 

Reads the specifed key fron the Windows registry.

Parameters:
[in] hKey - Handle to root key
[in] pKey - Pointer to key name
[in] bMerge - Non-zero to merge into current list
Returns:
Non-zero if success
See also:

BOOL CRKey::GetKeyFromName LPCTSTR  pName,
PHKEY  phKey,
LPSTR  pKey
 

Converts a string name of Windows registry root key to key handle.

Parameters:
[in] pName - Key name string
[out] phKey - Receives key handle
[out] pKey - Receives full key name
Returns:
Returns non-zero if success
See also:

BOOL CRKey::GetKeyName HKEY  hKey,
LPCTSTR  pKey,
LPSTR  pName
[static]
 

Returns a string describing the specified key.

Parameters:
[in] hKey - Root key
[in] pKey - Key path
[in] pName - Receives human readable name for key
hKey must specify a Windows registry root key

Returns:
Non-zero if success
See also:

LONG CRKey::GetLong LPCTSTR  pName,
LONG  lDefault = 0
[inline]
 

Returns the long representation of value.

Parameters:
[in] pName - Value name
[in] lDefault - Default value
Returns:
Pointer to value or lDefault
See also:

LONG CRKey::GetLong LPREGVALUE  prv,
LONG  lDefault = 0
[inline]
 

Returns the long representation of value.

Parameters:
[in] prv - Pointer to reg value structure
[in] lDefault - Default value
Returns:
Pointer to value or lDefault
See also:

LPCTSTR CRKey::GetName  )  [inline]
 

Returns the name of the current key.

Returns:
Pointer to buffer containing key name

virtual DWORD CRKey::GetObjSize  )  [inline, virtual]
 

Returns the size of a REGVALUE structure.

Returns:
Size of a REGVALUE structure in bytes

Reimplemented from CLList.

LPCTSTR CRKey::GetSz LPCTSTR  pName,
LPCTSTR  pDefault = ""
 

Returns a pointer to the string representation of value.

Parameters:
[in] pName - Value name
[in] pDefault - Default value
Returns:
Pointer to value or pDefault
See also:

LPCTSTR CRKey::GetSz LPREGVALUE  prv,
LPCTSTR  pDefault = ""
 

Returns a pointer to the string representation of value.

Parameters:
[in] prv - Pointer to reg value structure
[in] pDefault - Default value
Returns:
Pointer to value or pDefault
See also:

DWORD CRKey::GetValue HKEY  hKey,
LPCTSTR  pKey,
LPCTSTR  pValue,
LPVOID  pData,
DWORD  dwSize,
LPDWORD  pdwType = NULL
[static]
 

Returns the value of the specified Windows registry key.

Parameters:
[in] hKey - Key handle
[in] pKey - Key name
[in] pValue - Key value name
[in] pData - Receives value data
[in] dwSize - Size of buffer in pData
[in] pdwType - Receives value type
Returns:
Number of bytes copied to pData, zero if error
See also:

void * CRKey::GetValuePtr LPCTSTR  pName  ) 
 

Returns a pointer to the specifed value data.

Parameters:
[in] pName - Name of the value to return
Returns:
Pointer to value data
See also:

DWORD CRKey::GetValueSize LPCTSTR  pName  ) 
 

Returns the number of bytes in the value.

Parameters:
[in] pName - Value name
Returns:
Number of bytes in the value buffer
See also:

BOOL CRKey::IsSet LPCTSTR  pName  ) 
 

Non-zero if specified value exists.

Parameters:
[in] pName - Value name
Returns:
Non-zero if value exists
See also:

BOOL CRKey::Parse LPCTSTR  buf,
DWORD  size,
char  sep = ','
 

Parses a name-value pair and adds to the list.

Parameters:
[in] buf - Buffer to process
[in] size - Number of bytes in buf
[in] sep - name-value pair separator
Example:
        "name=value"
        "param1=100,param2=\"hello world\""

Returns:
Non-zero if success
See also:

BOOL CRKey::ReadInline LPBYTE  buf,
DWORD  size,
char  sep = '&',
BOOL  bDeCanonicalize = TRUE
 

Reads name-value pairs from a HTTP GET URL style encoding.

Parameters:
[in] buf - Buffer containing parameter string
[in] size - Number of bytes in buf
[in] sep - name-value pair separator, usually '&'
[in] bDeCanonicalize - Non-zero to decode escaped values
Returns:
See also:

BOOL CRKey::ReadInline LPCTSTR  pStr  )  [inline]
 

Reads name-value pairs from a HTTP GET URL style encoding.

Parameters:
[in] pStr - Parameters
Returns:
Non-zero if success
See also:

BOOL CRKey::ReadMIME LPBYTE  buf,
DWORD  size
 

Reads name-value pairs from a MIME or HTTP header style encoding.

Parameters:
[in] buf - Buffer containing values
[in] size - Number of bytes in buf
Returns:
Non-zero if success
See also:

BOOL CRKey::ReadMIME LPCTSTR  pStr  )  [inline]
 

Reads name-value pairs from a MIME or HTTP header style encoding.

Parameters:
[in] pStr - String containing values
Returns:
Non-zero if success
See also:

BOOL CRKey::Replace LPSTR  out,
LPDWORD  op,
DWORD  dwout,
LPCTSTR  in,
DWORD  dwin,
LPCTSTR  pStop,
LPSTR  pBreak,
CRKey params,
LPDWORD  pdwBreak
 

Parameters:
[out] out - Receives processed data
[out] op - Receives number of bytes written to out
[in] dwout - Size of buffer in out
[in] in - Input buffer
[in] dwin - Number of bytes in in
[in] pStop - Pointer to escape token start string
[in] pBreak - Pointer to escape token end string
[out] params - Receives break parameters
[out] pdwBreak - Receives break point offset
Returns:
See also:

BOOL CRKey::Replace LPSTR  out,
LPDWORD  op,
DWORD  dwout,
LPCTSTR  in,
DWORD  dwin,
LPCTSTR  pStop = NULL,
LPSTR  pBreak = NULL,
LPDWORD  pdwBreak = NULL
[inline]
 

Parameters:
[out] out - Receives processed data
[out] op - Receives number of bytes written to out
[in] dwout - Size of buffer in out
[in] in - Input buffer
[in] dwin - Number of bytes in in
[in] pStop - Pointer to escape token start string
[in] pBreak - Pointer to escape token end string
[out] pdwBreak - Receives break point offset
Returns:
Non-zero if success
See also:

BOOL CRKey::Replace CPipe out,
LPDWORD  op,
LPCTSTR  in,
DWORD  dwin,
LPCTSTR  pBegin,
LPCTSTR  pEnd,
LPSTR  pBreak,
CVar params,
LPDWORD  pdwBreak,
char  sep = '&'
 

Replaces escape tokens in pDst with variable values.

Parameters:
[out] out - Receives processed data
[out] op - Receives number of bytes written to out
[in] in - Input buffer
[in] dwin - Number of bytes in in
[in] pBegin - Pointer to escape token start string
[in] pEnd - Pointer to escape token end string
[out] pBreak - Receives break point token
[out] params - Receives break parameters
[out] pdwBreak - Receives break point offset
[in] sep - Parameter separator
Returns:
Non-zero if success
See also:

BOOL CRKey::Replace LPCTSTR  pSrc,
LPCTSTR  pDst
 

Replaces escape tokens in pDst with variable values.

Parameters:
[in] pSrc - Source buffer
[out] pDst - Receives processed data
Returns:
Non-zero if success
See also:

BOOL CRKey::RestoreWindowPos HWND  hWnd,
LPCTSTR  pName,
BOOL  bSize = TRUE,
BOOL  bPosition = TRUE
 

Restores a window position from a value.

Parameters:
[in] hWnd - Handle to window that is restored
[in] pName - Name of value containing data
[in] bSize - Non-zero to restore the window size
[in] bPosition - Non-zero to restore the window position
Returns:
Non-zero if success
See also:

BOOL CRKey::SaveWindowPos HWND  hWnd,
LPCTSTR  pName
 

Saves the window position into a value.

Parameters:
[in] hWnd - Handle to window
[in] pName - Name of the value
Returns:
Non-zero if window position is saved
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
const void *  pValue,
DWORD  dwValue
[inline]
 

Sets the binary representation of a value.

Parameters:
[in] pName - Value name
[in] pValue - New value
[in] dwValue - Size of value in pValue
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
LPCTSTR  pValue
[inline]
 

Sets the string representation of a value.

Parameters:
[in] pName - Value name
[in] pValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
UINT  uValue
[inline]
 

Sets the unsigned int representation of a value.

Parameters:
[in] pName - Value name
[in] uValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
short  iValue
[inline]
 

Sets the short representation of a value.

Parameters:
[in] pName - Value name
[in] iValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
int  iValue
[inline]
 

Sets the int representation of a value.

Parameters:
[in] pName - Value name
[in] iValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
LONG  lValue
[inline]
 

Sets the long representation of a value.

Parameters:
[in] pName - Value name
[in] lValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
DWORD  dwValue
[inline]
 

Sets the DWORD representation of a value.

Parameters:
[in] pName - Value name
[in] dwValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

LPREGVALUE CRKey::Set LPCTSTR  pName,
double  dValue
[inline]
 

Sets the double representation of a value.

Parameters:
[in] pName - Value name
[in] dValue - New value
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

BOOL CRKey::Set LPCTSTR  pName,
CRKey pRk
 

Parameters:
[in] pName - Variable name.
[in] pRk - Pointer to CRKey object that contains the variables to serialize and store.
Returns:
Non-zero if success
See also:
Get()

void CRKey::SetMinSize DWORD  min  )  [inline]
 

Sets the minimum memory allocation size for a value.

Parameters:
[in] min - Minimum allocation size in bytes

BOOL CRKey::SetName LPCTSTR  pName  ) 
 

Sets the name of this key.

Parameters:
[in] pName - Key name
Returns:
Non-zero if success
See also:

LPREGVALUE CRKey::SetStr LPCTSTR  pName,
LPCTSTR  pValue,
DWORD  dwLen
[inline]
 

Sets the string representation of a value.

Parameters:
[in] pName - Value name
[in] pValue - New value
[in] dwLen - Length of the string
Returns:
Pointer to REGVALUE strucure if success, otherwise NULL
See also:

BOOL CRKey::SetValue HKEY  hKey,
LPCTSTR  pKey,
LPCTSTR  pValue,
LPVOID  pData,
DWORD  dwSize,
DWORD  dwType = REG_SZ
[static]
 

Sets the value of the specified Windows registry key.

Parameters:
[in] hKey - Key handle
[in] pKey - Key name
[in] pValue - Key value name
[in] pData - New value data
[in] dwSize - Number of bytes in pData
[in] dwType - Value type
Returns:
Non-zero if success
See also:

BOOL CRKey::Update CRKey pRk  ) 
 

Adds values in specified key that are missing from this key.

Parameters:
[in] pRk - Key containing new values
Adds only values in pRk that are missing from this key.

Returns:
Non-zero if success
See also:

BOOL CRKey::UpdateData BOOL  bRead,
LPCTSTR  pName,
LPSTR  pStr,
DWORD  size,
LPCTSTR  pDefault = ""
[inline]
 

Updates key or value location.

Parameters:
[in] bRead - Non-zero to read value, zero to write value.
[in] pName - Value name
[in,out] pStr - Pointer to value buffer
[in] size - Size of buffer in pStr
[in] pDefault - Default value
Returns:
Non-zero if success
See also:

BOOL CRKey::UpdateData BOOL  bRead,
LPCTSTR  pName,
void *  ptr,
DWORD  size,
void *  pDefault = NULL
[inline]
 

Updates key or value location.

Parameters:
[in] bRead - Non-zero to read value, zero to write value.
[in] pName - Value name
[in,out] ptr - Pointer to value buffer
[in] size - Size of buffer in ptr
[in] pDefault - Pointer to default value
Returns:
Non-zero if success
See also:

BOOL CRKey::UpdateData BOOL  bRead,
LPCTSTR  pName,
LPDWORD  pDw,
DWORD  dwDefault = 0
[inline]
 

Updates key or value location.

Parameters:
[in] bRead - Non-zero to read value, zero to write value.
[in] pName - Value name
[in,out] pDw - Pointer to value buffer
[in] dwDefault - Default value
Returns:
Non-zero if success
See also:

DWORD CRKey::Write LPVOID  dst,
DWORD  ptr,
DWORD  max,
const void *  src,
DWORD  size = 0
 

Writes data to buffer.

Parameters:
[out] dst - Destination buffer
[in] ptr - Start offset in dst
[in] max - Size of buffer in dst
[in] src - Source buffer
[in] size - Number of bytes in src
Returns:
Offset of last byte in dst
See also:


The documentation for this class was generated from the following files:
  • inc/RKey.h
  • RKey.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL