Download Source Code

CReg Class Reference

This class contains a list of registry objects. More...

#include <Reg.h>

Inheritance diagram for CReg:

Inheritance graph
[legend]
Collaboration diagram for CReg:

Collaboration graph
[legend]
List of all members.

Public Member Functions

BOOL ReadInline (LPCTSTR pStr)
 Decodes 2D URL encoded data.
BOOL ReadInline (LPBYTE pBuf, DWORD dwSize)
 Decodes 2D URL encoded data.
BOOL EncodeUrl (CPipe *pPipe, char chSepNameVal= '=', char chSepValues= '&')
 Encodes all data keys in 2D URL encoding.
BOOL EncodeUrl (CPipe *pPipe, LPCTSTR pKey, char chSepNameVal= '=', char chSepValues= '&')
 Encodes the specified key in URL format.
BOOL Copy (CReg *pReg, BOOL bMerge=FALSE)
 Copies the specified CReg object.
LPREGKEY FindWhere (LPCTSTR pName, DWORD dwValue)
 Searches for a key containing the specified value name and value.
LPREGKEY FindWhere (LPCTSTR pName, LPCTSTR pValue)
 Searches for a key containing the specified value name and value.
BOOL IsSet (LPCTSTR pKey, LPCTSTR pName)
 Returns non zero if the specified value exists.
BOOL RenameKey (LPCTSTR pOld, LPCTSTR pNew)
 Renames a key.
BOOL RestoreSettings (LPCTSTR pFile, LPCTSTR pBak=NULL, BOOL bSafety=FALSE)
 Restores settings from a registry file.
BOOL SaveSettings (LPCTSTR pFile, LPCTSTR pBak=NULL)
 Saves the registry values to a disk file.
BOOL Parse (LPCTSTR pStr, DWORD size, char sep= ',')
 Parses comma separated parameter value string.
BOOL RestoreWindowPos (HWND hWnd, LPCTSTR pGroup, LPCTSTR pName, BOOL bSize=TRUE, BOOL bPosition=TRUE)
 Restores a window position from a reg value.
BOOL SaveWindowPos (HWND hWnd, LPCTSTR pGroup, LPCTSTR pName)
 Saves the position of a window.
BOOL DeleteValue (LPCTSTR pKey, LPCTSTR pValue)
 Deletes the named value from the list.
HREGKEY Enum (LPCTSTR pKey, HREGKEY hRk)
 Enumerates keys with the same name.
BOOL SaveRegFile (CPipe *pipe, LPCTSTR pKey=NULL, LPCTSTR pHeader=NULL)
 Saves a registry formated file to a CPipe object.
CRKeyGetKey (LPCTSTR pKey)
 Returns a pointer to the specified key object.
CRKeyFindKey (LPCTSTR pKey)
 Returns a pointer to the specified key object.
BOOL WriteStr (CPipe *pipe, LPCTSTR pStr)
 Writes a string to the specified pipe.
BOOL SaveRegKey (CPipe *pipe, LPREGKEY pRk)
 Saves a key to the specified pipe.
BOOL SaveRegFile (CPipe &pipe, LPCTSTR pKey=NULL, LPCTSTR pHeader=NULL)
 Saves a registry formated file to the specified pipe.
BOOL SaveRegFile (LPCTSTR pFile, LPCTSTR pKey=NULL, LPCTSTR pHeader=NULL)
 Saves a registry formated file to the specified file.
DWORD ahtoul (LPCTSTR pBuffer, BYTE ucBytes)
 Converts an ASCII hex value to a binary value.
DWORD ConvertData (LPDWORD pdwType, LPBYTE pData, LPDWORD pdwData, LPBYTE buf, DWORD size)
 Converts data from string to component values.
LPREGKEY AddKey (LPCTSTR pKey)
 Adds the named key object to the list.
DWORD ProcessLine (LPBYTE buf, DWORD size)
 Processes a single line from a Windows registry formated buffer.
BOOL LoadRegFromMem (LPBYTE buf, DWORD size, BOOL bMerge=FALSE)
 Loads Windows registry file formated data from memory buffer.
BOOL LoadRegFile (LPCTSTR pFile, LPCTSTR pKey=NULL, BOOL bMerge=FALSE)
 Loads Windows registry file formated data from disk file.
virtual DWORD Save (LPCTSTR pFile)
 Saves a Windows Registry formated file to disk.
virtual DWORD Load (LPCTSTR pFile, BOOL bMerge=FALSE)
 Loads Windows registry file formated data from disk file.
virtual void Destroy ()
 Release all keys and resources.
virtual BOOL InitObject (void *node)
 Provides custom initialization for a key structure.
virtual void DeleteObject (void *node)
 Provides custom destruction for a key structure.
virtual DWORD GetObjSize ()
 Returns the size of a key structure.
double GetDouble (LPCTSTR pKey, LPCTSTR pName, double dDefault=0)
 Returns the double representation of a key value.
long GetLong (LPCTSTR pKey, LPCTSTR pName, long lDefault=0)
 Returns the long representation of a key value.
DWORD GetDword (LPCTSTR pKey, LPCTSTR pName, DWORD dwDefault=0)
 Returns the DWORD representation of a key value.
LPCTSTR GetSz (LPCTSTR pKey, LPCTSTR pName, LPCTSTR pDefault="")
 Returns the string representation of a key value.
BOOL Get (LPCTSTR pKey, LPCTSTR pName, LPSTR str, DWORD size)
 Returns the string representation of a key value.
BOOL Get (LPCTSTR pKey, LPCTSTR pName, LPDWORD pdw)
 Returns the DWORD representation of a key value.
BOOL Get (LPCTSTR pKey, LPCTSTR pName, LPVOID ptr, DWORD size)
 Returns the binary representation of a key value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, LPCTSTR str)
 Sets the string representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, DWORD dw)
 Sets the DWORD representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, double d)
 Sets the double representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, long l)
 Sets the long representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, int i)
 Sets the int representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, UINT u)
 Sets the unsigned int representation of the specified value.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, LPVOID ptr, DWORD size)
 Sets the binary representation of the specified value.
BOOL Get (LPCTSTR pKey, LPCTSTR pName, CReg *pReg)
 De-serializes data to the specified pReg object.
BOOL Set (LPCTSTR pKey, LPCTSTR pName, CReg *pReg)
 Serializes the CReg object and stores it.
BOOL Get (LPCTSTR pKey, LPCTSTR pName, CRKey *pRk)
BOOL Set (LPCTSTR pKey, LPCTSTR pName, CRKey *pRk)
DWORD GetValueSize (LPCTSTR pKey, LPCTSTR pName)
 Returns the size of the specified value.
void * GetValuePtr (LPCTSTR pKey, LPCTSTR pName)
 Returns a pointer to the value data.
BOOL GetKey (HKEY hKey, LPCTSTR pKey, DWORD dwSubkeys=MAXDWORD, BOOL bMerge=FALSE, LPCTSTR pKeyname=NULL)
 Copies the specified key from the Windows registry.
 CReg ()
 Default constructor.
virtual ~CReg ()
 Destructor.
void SetMinSize (DWORD min)
 Specifies the minimum size allocated for each key item.

Static Public Member Functions

static DWORD GetToken (LPBYTE pToken, DWORD dwTokenSize, LPBYTE buf, DWORD size, BYTE ucTerm)
 Extracts a token from a given string.
static DWORD SkipWhiteSpace (LPBYTE buf, DWORD size, DWORD i, BOOL bIncludeNewLine=FALSE)
 Skips the white space in buffer.
static DWORD SkipNonWhiteSpace (LPBYTE buf, DWORD size, DWORD i)
 Skips the white space in buffer.
static BOOL IsWhiteSpace (LPBYTE buf, BOOL bIncludeNewLine=FALSE)
 Returns non-zero if specified character is a white space character.
static BOOL IsWhiteSpace (BYTE ch, BOOL bIncludeNewLine=FALSE)
 Returns non-zero if specified character is a white space character.
static DWORD NextToken (LPBYTE buf, DWORD size, DWORD i)
 Returns the offset of the next token in specified buffer.
static DWORD NextLine (LPBYTE buf, DWORD size, DWORD i)
 Returns the offset of the next line in specified buffer.
static DWORD GetNonWhiteSpace (LPBYTE pToken, DWORD dwTokenSize, LPBYTE pBuf, DWORD dwSize, DWORD i)
 Returns the first non-white space token.
static CRKeyRegKeyFromHandle (HREGKEY hRegKey)
 Returns the CRKey object encapsulated in a key structure.

Detailed Description

This class contains a list of registry objects.

Encapsulates the functionality of the Windows registry. Also functions nicely as a general purpose property bag which can save / restore values to / from the Windows registry as well as disk file formats.


Member Function Documentation

LPREGKEY CReg::AddKey LPCTSTR  pKey  ) 
 

Adds the named key object to the list.

Parameters:
[in] pKey - Key name
Returns:
Pointer to newly created key object
See also:

DWORD CReg::ahtoul LPCTSTR  pBuffer,
BYTE  ucBytes
 

Converts an ASCII hex value to a binary value.

Parameters:
[in] pBuffer - Buffer containing ASCII hex value
[in] ucBytes - Number of bytes to convert from pBuffer.
Returns:
Binary value
See also:

DWORD CReg::ConvertData LPDWORD  pdwType,
LPBYTE  pData,
LPDWORD  pdwData,
LPBYTE  buf,
DWORD  size
 

Converts data from string to component values.

Parameters:
[out] pdwType - Receives the value type
[out] pData - Receives the value data
[out] pdwData - Receives number of bytes written to pData
[in] buf - Contains definition string
[in] size - Number of bytes in buf
Returns:
Index in buf of the end of the value
See also:

BOOL CReg::Copy CReg pReg,
BOOL  bMerge = FALSE
 

Copies the specified CReg object.

Parameters:
[in] pReg - Source CReg object
[in] bMerge - Non-zero to merge into current data
This function copies all keys in pReg into this object.

Returns:
Non-zero if success
See also:

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

Provides custom destruction for a key structure.

Parameters:
[in] node - Key structure pointer

Reimplemented from CHList.

BOOL CReg::DeleteValue LPCTSTR  pKey,
LPCTSTR  pValue
 

Deletes the named value from the list.

Parameters:
[in] pKey - Key name
[in] pValue - Value name
Returns:
Non-zero if success
See also:

BOOL CReg::EncodeUrl CPipe pPipe,
LPCTSTR  pKey,
char  chSepNameVal = '=',
char  chSepValues = '&'
 

Encodes the specified key in URL format.

Parameters:
[out] pPipe - Output buffer
[in] pKey - Name of key to encode
[in] chSepNameVal - Separator between name and value
[in] chSepValues - Separator between values
Returns:
Non-zero if success
See also:

BOOL CReg::EncodeUrl CPipe pPipe,
char  chSepNameVal = '=',
char  chSepValues = '&'
 

Encodes all data keys in 2D URL encoding.

Parameters:
[out] pPipe - Output buffer
[in] chSepNameVal - Separator between name and value
[in] chSepValues - Separator between values
Returns:
Non-zero if success
See also:

HREGKEY CReg::Enum LPCTSTR  pKey,
HREGKEY  hRk
 

Enumerates keys with the same name.

Parameters:
[in] pKey - Key name to find
[in] hRk - Handle to starting key or NULL to find first occurence.
This function can be used to enumerate through multiple keys with the same name

Returns:
Handle to reg structure or NULL if not found
See also:

CRKey * CReg::FindKey LPCTSTR  pKey  ) 
 

Returns a pointer to the specified key object.

Parameters:
[in] pKey - Name of key to find. Function returns NULL if not found.
Returns:
Pointer to key object or NULL if not found.
See also:

LPREGKEY CReg::FindWhere LPCTSTR  pName,
LPCTSTR  pValue
 

Searches for a key containing the specified value name and value.

Parameters:
[in] pName - Name to search for
[in] pValue - Value to search for
Returns:
Pointer to key or NULL if not found
See also:

LPREGKEY CReg::FindWhere LPCTSTR  pName,
DWORD  dwValue
 

Searches for a key containing the specified value name and value.

Parameters:
[in] pName - Name to search for
[in] dwValue - Value to search for
Returns:
Pointer to key or NULL if not found
See also:

BOOL CReg::Get LPCTSTR  pKey,
LPCTSTR  pName,
CRKey pRk
[inline]
 

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

BOOL CReg::Get LPCTSTR  pKey,
LPCTSTR  pName,
CReg pReg
 

De-serializes data to the specified pReg object.

Parameters:
[in] pKey - Key name.
[in] pName - Variable name.
[out] pReg - Pointer to CReg object.
Returns:
See also:

BOOL CReg::Get LPCTSTR  pKey,
LPCTSTR  pName,
LPVOID  ptr,
DWORD  size
[inline]
 

Returns the binary representation of a key value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] ptr - Buffer that receives the binary value
[in] size - Size of buffer in ptr
Returns:
Non-zero if success
See also:

BOOL CReg::Get LPCTSTR  pKey,
LPCTSTR  pName,
LPDWORD  pdw
[inline]
 

Returns the DWORD representation of a key value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[out] pdw - Buffer that receives the value
Returns:
Non-zero if success
See also:

BOOL CReg::Get LPCTSTR  pKey,
LPCTSTR  pName,
LPSTR  str,
DWORD  size
[inline]
 

Returns the string representation of a key value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[out] str - Buffer that receives the string value
[in] size - Size of buffer in str
Returns:
Non-zero if success
See also:

double CReg::GetDouble LPCTSTR  pKey,
LPCTSTR  pName,
double  dDefault = 0
[inline]
 

Returns the double representation of a key value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] dDefault - Default value
Returns:
Value or dDefault
See also:

DWORD CReg::GetDword LPCTSTR  pKey,
LPCTSTR  pName,
DWORD  dwDefault = 0
[inline]
 

Returns the DWORD representation of a key value.

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

BOOL CReg::GetKey HKEY  hKey,
LPCTSTR  pKey,
DWORD  dwSubkeys = MAXDWORD,
BOOL  bMerge = FALSE,
LPCTSTR  pKeyname = NULL
 

Copies the specified key from the Windows registry.

Parameters:
[in] hKey - Root registry key
[in] pKey - Sub key path
[in] dwSubkeys - Depth of sub keys to copy
[in] bMerge - Non-zero to merge
[in] pKeyname - Copied key name
Returns:
See also:

CRKey * CReg::GetKey LPCTSTR  pKey  ) 
 

Returns a pointer to the specified key object.

Parameters:
[in] pKey - Name of key to find. It is created if it is not found.
Returns:
Pointer to key object or NULL if error.
See also:

long CReg::GetLong LPCTSTR  pKey,
LPCTSTR  pName,
long  lDefault = 0
[inline]
 

Returns the long representation of a key value.

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

DWORD CReg::GetNonWhiteSpace LPBYTE  pToken,
DWORD  dwTokenSize,
LPBYTE  pBuf,
DWORD  dwSize,
DWORD  i
[static]
 

Returns the first non-white space token.

Parameters:
[out] pToken - Receives the token
[in] dwTokenSize - Size of buffer in pToken
[in] pBuf - Source buffer
[in] dwSize - Number of bytes in pBuf
[in] i - Starting offset in pBuf
Returns:
Offset in pBuf of the end of the found token
See also:

LPCTSTR CReg::GetSz LPCTSTR  pKey,
LPCTSTR  pName,
LPCTSTR  pDefault = ""
[inline]
 

Returns the string representation of a key value.

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

DWORD CReg::GetToken LPBYTE  pToken,
DWORD  dwTokenSize,
LPBYTE  buf,
DWORD  size,
BYTE  ucTerm
[static]
 

Extracts a token from a given string.

Parameters:
[in] pToken - Receives string token
[in] dwTokenSize - Number of bytes copied to pToken
[in] buf - Source string buffer
[in] size - Number of bytes in buf
[in] ucTerm - Token terminator
Returns:
Offset of the end of the token in buf
See also:

void* CReg::GetValuePtr LPCTSTR  pKey,
LPCTSTR  pName
[inline]
 

Returns a pointer to the value data.

Parameters:
[in] pKey - Key name
[in] pName - Value name
Returns:
Pointer to the specified value data, or NULL if error
See also:

DWORD CReg::GetValueSize LPCTSTR  pKey,
LPCTSTR  pName
[inline]
 

Returns the size of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
Returns:
Size of the specified value, or zero if error
See also:

BOOL CReg::InitObject void *  node  )  [virtual]
 

Provides custom initialization for a key structure.

Parameters:
[in] node - Pointer to key structure
Returns:
Non-zero if success
See also:

Reimplemented from CHList.

BOOL CReg::IsSet LPCTSTR  pKey,
LPCTSTR  pName
 

Returns non zero if the specified value exists.

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

BOOL CReg::IsWhiteSpace BYTE  ch,
BOOL  bIncludeNewLine = FALSE
[static]
 

Returns non-zero if specified character is a white space character.

Parameters:
[in] ch - Character to check
[in] bIncludeNewLine - Non-zero if new line characters should be considered white space.
Returns:
Non-zero if character is white space.
See also:

static BOOL CReg::IsWhiteSpace LPBYTE  buf,
BOOL  bIncludeNewLine = FALSE
[inline, static]
 

Returns non-zero if specified character is a white space character.

Parameters:
[in] buf - Pointer to character
[in] bIncludeNewLine - Non-zero if new line characters should be considered white space.
Returns:
Non-zero if character is white space.
See also:

DWORD CReg::Load LPCTSTR  pFile,
BOOL  bMerge = FALSE
[virtual]
 

Loads Windows registry file formated data from disk file.

Parameters:
[in] pFile - Filename
[in] bMerge - Non-zero to merge data into current list.
Returns:
Non-zero if success

See also:

Reimplemented from CLList.

BOOL CReg::LoadRegFile LPCTSTR  pFile,
LPCTSTR  pKey = NULL,
BOOL  bMerge = FALSE
 

Loads Windows registry file formated data from disk file.

Parameters:
[in] pFile - Filename
[in] pKey - Key to load. NULL for all keys
[in] bMerge - Non-zero to merge data into current list.
Returns:
Non-zero if success

See also:

BOOL CReg::LoadRegFromMem LPBYTE  buf,
DWORD  size,
BOOL  bMerge = FALSE
 

Loads Windows registry file formated data from memory buffer.

Parameters:
[in] buf - Buffer containing data
[in] size - Number of bytes in buf
[in] bMerge - Non-zero to merge data into current list.
Returns:
Non-zero if success
See also:

DWORD CReg::NextLine LPBYTE  buf,
DWORD  size,
DWORD  i
[static]
 

Returns the offset of the next line in specified buffer.

Parameters:
[in] buf - Buffer pointer
[in] size - Number of bytes in buf
[in] i - Starting offset in buf
Returns:
Offset of the start of next line in buf
See also:

DWORD CReg::NextToken LPBYTE  buf,
DWORD  size,
DWORD  i
[static]
 

Returns the offset of the next token in specified buffer.

Parameters:
[in] buf - Buffer pointer
[in] size - Number of bytes in buf
[in] i - Starting offset in buf
Returns:
Offset of token in buf
See also:

BOOL CReg::Parse LPCTSTR  pStr,
DWORD  size,
char  sep = ','
 

Parses comma separated parameter value string.

Parameters:
[in] pStr - Value string
[in] size - Number of bytes in pStr
[in] sep - Value separator
Example:
        "param1=100,param2=test,param3=\"hello world\""

Returns:
Non-zero if success
See also:

DWORD CReg::ProcessLine LPBYTE  buf,
DWORD  size
 

Processes a single line from a Windows registry formated buffer.

Parameters:
[in] buf - Pointer to line
[in] size - Number of bytes in buf
Processes a single line from buf then returns.

Returns:
Offset of end of line proccessed in buf
See also:

BOOL CReg::ReadInline LPBYTE  pBuf,
DWORD  dwSize
 

Decodes 2D URL encoded data.

Parameters:
[in] pBuf - Pointer to 2D URL string
[in] dwSize - Length of string
This function reverses the encoding by EncodeUrl()

Returns:
Non-zero if success
See also:
EncodeUrl()

BOOL CReg::ReadInline LPCTSTR  pStr  )  [inline]
 

Decodes 2D URL encoded data.

Parameters:
[in] pStr - Pointer to 2D URL string
This function reverses the encoding by EncodeUrl()

Returns:
Non-zero if success
See also:
EncodeUrl()

static CRKey* CReg::RegKeyFromHandle HREGKEY  hRegKey  )  [inline, static]
 

Returns the CRKey object encapsulated in a key structure.

Parameters:
[in] hRegKey - Handle to key structure
Returns:
CRKey pointer or NULL if error
See also:

BOOL CReg::RenameKey LPCTSTR  pOld,
LPCTSTR  pNew
 

Renames a key.

Parameters:
[in] pOld - Old name
[in] pNew - New name
Returns:
Non-zero if success
See also:

BOOL CReg::RestoreSettings LPCTSTR  pFile,
LPCTSTR  pBak = NULL,
BOOL  bSafety = FALSE
 

Restores settings from a registry file.

Parameters:
[in] pFile - Registry filename
[in] pBak - Optional backup file name
[in] bSafety - If non-zero a value will be set in the registry file to detect partial saves and use the backup file if this occurs.
The purpose of this function is to help reduce the likely hood of currupted configuration file by using a backup file containing the same information.

Returns:
Non-zero if success
See also:

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

Restores a window position from a reg value.

Parameters:
[in] hWnd - Handle to window that is restored
[in] pGroup - Key name
[in] pName - Value name
[in] bSize - Non-zero to resize window
[in] bPosition - Non-zero to reposition window
Returns:
Non-zero if success
See also:

DWORD CReg::Save LPCTSTR  pFile  )  [virtual]
 

Saves a Windows Registry formated file to disk.

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

Reimplemented from CLList.

BOOL CReg::SaveRegFile LPCTSTR  pFile,
LPCTSTR  pKey = NULL,
LPCTSTR  pHeader = NULL
 

Saves a registry formated file to the specified file.

Parameters:
[out] pFile - Filename
[in] pKey - Name of the key to save. NULL to save all keys.
[in] pHeader - Pointer to file header. NULL for default. Set to empty string for none.
Returns:
Non-zero if success
See also:

BOOL CReg::SaveRegFile CPipe pipe,
LPCTSTR  pKey = NULL,
LPCTSTR  pHeader = NULL
 

Saves a registry formated file to the specified pipe.

Parameters:
[out] pipe - Pipe that receives the formated file data
[in] pKey - Name of the key to save. NULL to save all keys.
[in] pHeader - Pointer to file header. NULL for default. Set to empty string for none.
Returns:
Non-zero if success
See also:

BOOL CReg::SaveRegFile CPipe pipe,
LPCTSTR  pKey = NULL,
LPCTSTR  pHeader = NULL
 

Saves a registry formated file to a CPipe object.

Parameters:
[out] pipe - Handle to CPipe object
[in] pKey - Key name to save, NULL for all keys
[in] pHeader - Pointer to file header. NULL for default. Set to empty string for none.
Returns:
Non-zero if success
See also:

BOOL CReg::SaveRegKey CPipe pipe,
LPREGKEY  pRk
 

Saves a key to the specified pipe.

Parameters:
[out] pipe - Pipe that receives the key
[in] pRk - Key object
Returns:
Non-zero if success
See also:

BOOL CReg::SaveSettings LPCTSTR  pFile,
LPCTSTR  pBak = NULL
 

Saves the registry values to a disk file.

Parameters:
[in] pFile - Disk filename
[in] pBak - Optional backup file name
Saves data to a configuration file. Also saves to a backup file to be used in case the main file is currupted.

Returns:
See also:

BOOL CReg::SaveWindowPos HWND  hWnd,
LPCTSTR  pGroup,
LPCTSTR  pName
 

Saves the position of a window.

Parameters:
[in] hWnd - Handle to window to save
[in] pGroup - Key name
[in] pName - Value name
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
CRKey pRk
[inline]
 

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

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
CReg pReg
 

Serializes the CReg object and stores it.

Parameters:
[in] pKey - Key name.
[in] pName - Variable name.
[in] pReg - Pointer to CReg object.
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
LPVOID  ptr,
DWORD  size
[inline]
 

Sets the binary representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] ptr - Binary value
[in] size - Number of bytes in ptr
Returns:
Non-zero if success

See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
UINT  u
[inline]
 

Sets the unsigned int representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] u - Value to set
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
int  i
[inline]
 

Sets the int representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] i - Value to set
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
long  l
[inline]
 

Sets the long representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] l - Value to set
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
double  d
[inline]
 

Sets the double representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] d - Value to set
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
DWORD  dw
[inline]
 

Sets the DWORD representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] dw - Value to set
Returns:
Non-zero if success
See also:

BOOL CReg::Set LPCTSTR  pKey,
LPCTSTR  pName,
LPCTSTR  str
[inline]
 

Sets the string representation of the specified value.

Parameters:
[in] pKey - Key name
[in] pName - Value name
[in] str - Value to set
Returns:
Non-zero if success
See also:

void CReg::SetMinSize DWORD  min  )  [inline]
 

Specifies the minimum size allocated for each key item.

Parameters:
[in] min - Minimum size in bytes

DWORD CReg::SkipNonWhiteSpace LPBYTE  buf,
DWORD  size,
DWORD  i
[static]
 

Skips the white space in buffer.

Parameters:
[in] buf - Buffer to process
[in] size - Number of bytes in buf
[in] i - Starting offset in buf
Returns:
Offset of first white space character
See also:

DWORD CReg::SkipWhiteSpace LPBYTE  buf,
DWORD  size,
DWORD  i,
BOOL  bIncludeNewLine = FALSE
[static]
 

Skips the white space in buffer.

Parameters:
[in] buf - Buffer to process
[in] size - Number of bytes in buf
[in] i - Starting offset in buf
[in] bIncludeNewLine - Non-zero to skip new line characters as well.
Returns:
Offset of first non-white space character
See also:

BOOL CReg::WriteStr CPipe pipe,
LPCTSTR  pStr
 

Writes a string to the specified pipe.

Parameters:
[out] pipe - Pipe that receives string
[in] pStr - String to write
Returns:
Non-zero if success
See also:


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