Download Source Code

CCfgFile Class Reference

This class reads and writes files similar to Windows ini files. More...

#include <CfgFile.h>

Collaboration diagram for CCfgFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void DeleteElements (HGROUP hGroup)
 Deletes all elements of the specified group.
DWORD WriteToMem (LPBYTE buf, DWORD size, LPCTSTR src, DWORD srcsize)
 Writes the specified data to the specified memory buffer.
DWORD SaveToMem (LPBYTE buf, DWORD len)
 Creates a configuration file in memory.
BOOL RestoreWindowPos (HWND hWnd, LPCTSTR pGroup, LPCTSTR pName, BOOL bSize=TRUE, BOOL bPosition=TRUE, BOOL bToolWindow=FALSE, BOOL bTopmost=FALSE)
 Restores the position of a window from a configuration file entry.
BOOL SaveWindowPos (HWND hWnd, LPCTSTR pGroup, LPCTSTR pName, BOOL bToolwindow=FALSE)
 Saves the position of a window into a configuration file entry.
BOOL RemoveElement (LPCTSTR pGroup, LPCTSTR pElement)
 Removes an element from the configuration list.
HGROUP VerifyGroup (HGROUP hGroup)
 Verifies that a handle to a group is in fact valid.
BOOL RemoveGroup (LPCTSTR pGroup)
 Removes a group from the configuration list.
BOOL RemoveGroup (HGROUP node)
 Removes a group from the configuration list.
HGROUP AddGroup (LPCTSTR pGroup)
 Adds the group if it does not already exist.
HGROUP FindGroup (LPCTSTR pGroup)
 Returns the handle to the specified group.
BOOL AddLine (LPSTR pLine)
 Processes a single line of a configuration file.
BOOL LoadFromMem (LPBYTE buf, DWORD size, BOOL bMerge=FALSE)
 Loads a configuration file from a memory buffer.
BOOL Load (LPCTSTR pFile, BOOL bMerge=FALSE)
 Loads a configuration file from disk.
LPCFGELEMENTINFO FindElement (HGROUP hGroup, LPCTSTR pName)
 Searches for the named element.
BOOL Save (LPCTSTR pFile=NULL)
 Saves configuration file to disk.
BOOL RemoveElement (HGROUP hGroup, LPCFGELEMENTINFO node)
BOOL AddElement (HGROUP hGroup, LPCTSTR name, DWORD type, DWORD size, LPVOID value)
 Adds an element to the configuration.
void Destroy ()
 Releases all groups and elements.
 CCfgFile ()
 Constructor.
virtual ~CCfgFile ()
 Destructor.
DWORD Size ()
 Returns the total size of the list, i.e. the total number of elements.
DWORD GetNumGroups ()
 Returns the total number of groups in the configuration.
LPCFGGROUPINFO GetNext (LPCFGGROUPINFO ptr)
 Gets the pointer to the next group.
BOOL Copy (HGROUP hGroup, CRKey *pRk)
 Copies the specified CRKey object into the specified group.
BOOL Copy (LPCTSTR pGroup, CRKey *pRk)
BOOL CopyGroup (LPCTSTR pGroup, LPCTSTR pNewGroup)
 Copies one group to another.
LPCFGELEMENTINFO GetNextElement (HGROUP hGroup, LPCFGELEMENTINFO ptr)
 Returns the next element in a group.
DWORD GetValueSize (HGROUP hGroup, LPCTSTR pName)
 Returns the size of the data in the specified element.
DWORD GetValueSize (LPCTSTR pGroup, LPCTSTR pName)
 Returns the size of the data in the specified element.
LPVOID GetValuePtr (HGROUP hGroup, LPCTSTR pName)
 Returns a pointer to the data of the specified element.
LPVOID GetValuePtr (LPCTSTR pGroup, LPCTSTR pName)
 Returns a pointer to the data of the specified element.
LPCTSTR GetSz (LPCTSTR pGroup, LPCTSTR pName, LPCTSTR pDefault="")
 Returns a pointer to a string representation of an element.
LPCTSTR GetSz (HGROUP hGroup, LPCTSTR pName, LPCTSTR pDefault="")
 Returns a pointer to a string representation of an element.
DWORD GetDword (LPCTSTR pGroup, LPCTSTR pName, DWORD dwDefault=0)
 DWORD representation of element.
DWORD GetDword (HGROUP hGroup, LPCTSTR pName, DWORD dwDefault=0)
 DWORD representation of element.
BOOL SetValue (HGROUP hGroup, LPCTSTR pName, LPVOID pValue, DWORD dwSize)
 Set binary variables.
BOOL SetValue (LPCTSTR pGroup, LPCTSTR pName, LPVOID pValue, DWORD dwSize)
 Set binary variables.
BOOL GetValue (HGROUP hGroup, LPCTSTR pName, LPVOID pValue, DWORD dwSize)
 Returns the value data for the specified element.
BOOL GetValue (LPCTSTR pGroup, LPCTSTR pName, LPVOID pValue, DWORD dwSize)
 Returns the value data for the specified element.
BOOL SetValue (HGROUP hGroup, LPCTSTR pName, LPCTSTR pValue)
 Sets the string representation for an element.
BOOL SetValue (LPCTSTR pGroup, LPCTSTR pName, LPCTSTR pValue)
 Sets the string representation for an element.
BOOL GetValue (HGROUP hGroup, LPCTSTR pName, LPSTR pValue, DWORD dwSize)
 Returns the value data for the specified element.
BOOL GetValue (LPCTSTR pGroup, LPCTSTR pName, LPSTR pValue, DWORD dwSize)
 Returns the value data for the specified element.
BOOL SetValue (HGROUP hGroup, LPCTSTR pName, DWORD dwValue)
 Sets the DWORD representation of the specified element.
BOOL SetValue (LPCTSTR pGroup, LPCTSTR pName, DWORD dwValue)
 Sets the DWORD representation of the specified element.
BOOL GetValue (HGROUP hGroup, LPCTSTR pName, LPDWORD pdwValue)
 Retreives the DWORD representation of the specified element.
BOOL GetValue (LPCTSTR pGroup, LPCTSTR pName, LPDWORD pdwValue)
 Retreives the DWORD representation of the specified element.
BOOL SetValue (HGROUP hGroup, LPCTSTR pName, long lValue)
 Sets the long representation of an element.
BOOL SetValue (LPCTSTR pGroup, LPCTSTR pName, long lValue)
 Sets the long representation of an element.
BOOL GetValue (HGROUP hGroup, LPCTSTR pName, long *plValue)
 Returns the long representation of the specified element.
BOOL GetValue (LPCTSTR pGroup, LPCTSTR pName, long *plValue)
 Returns the long representation of the specified element.
BOOL SetValue (HGROUP hGroup, LPCTSTR pName, double dValue)
 Sets the double representation of the element.
BOOL SetValue (LPCTSTR pGroup, LPCTSTR pName, double dValue)
 Sets the double representation of the element.
BOOL GetValue (HGROUP hGroup, LPCTSTR pName, double *pdValue)
 Retreives the double representation of the specified element.
BOOL GetValue (LPCTSTR pGroup, LPCTSTR pName, double *pdValue)
 Retreives the double representation of the specified element.
void SetFileName (LPCTSTR file)
 Sets the default filename for the configuration.
void SetKey (LPCTSTR pKey)
 Sets the encryption / decryption key for the configuration file.
void SetTerminator (BYTE term)
 Sets the default line terminiation character.

Static Public Member Functions

static DWORD GetMinDeCanonicalizeBufferSize (DWORD size)
 Returns the minimum size buffer needed to store the decoded string.
static BOOL DeCanonicalizeBuffer (LPCTSTR str, LPBYTE buf, DWORD max, LPDWORD size)
 Decodes buffer, that is, converts all escape characters to actual values.
static DWORD GetMinCanonicalizeBufferSize (DWORD size)
 Returns the minimum size buffer needed to store the encoded string.
static BOOL CanonicalizeBuffer (LPSTR str, LPBYTE buf, DWORD size)
 Encodes buffer. Converts certain characters to escape sequences.

Detailed Description

This class reads and writes files similar to Windows ini files.

This class will read file formats similar to the Windows ini files. This class was not written specifically for this purpose and there may be differences. The intent was simply to implement a human readable configuration file. For accessing Windows ini files, you should use the Windows API functions instead.


Member Function Documentation

BOOL CCfgFile::AddElement HGROUP  hGroup,
LPCTSTR  name,
DWORD  type,
DWORD  size,
LPVOID  value
 

Adds an element to the configuration.

Parameters:
[in] hGroup - Handle to group into which to add element.
[in] name - Name of the new element.
[in] type - Data type of the new element.
[in] size - Size of the new element.
[in] value - Initial value of the new element.
Returns:
Non-zero if success, otherwise zero.
See also:

HGROUP CCfgFile::AddGroup LPCTSTR  pGroup  ) 
 

Adds the group if it does not already exist.

Parameters:
[in] pGroup - Pointer to a string naming the group that is to be added.
Returns:
Returns the handle to the new or existing group, or NULL if failure.

BOOL CCfgFile::AddLine LPSTR  pLine  ) 
 

Processes a single line of a configuration file.

Parameters:
[in] pLine - Pointer to a string containing the line to process and add.
Returns:
Non-zero if success.

BOOL CCfgFile::CanonicalizeBuffer LPSTR  str,
LPBYTE  buf,
DWORD  size
[static]
 

Encodes buffer. Converts certain characters to escape sequences.

Parameters:
[out] str - Buffer that receives the encoded string
[in] buf - Buffer that holds the data to be encoded
[in] size - Size of the buffer in buf.
Returns:
Non-zero if success.
See also:
DeCanonicalizeBuffer()

BOOL CCfgFile::Copy LPCTSTR  pGroup,
CRKey pRk
[inline]
 

Parameters:
[in] pGroup - Name of group that will receive the elements.
[in] pRk - CRKey object whose elements that will be copied.
Returns:
Non-zero if success
See also:

BOOL CCfgFile::Copy HGROUP  hGroup,
CRKey pRk
 

Copies the specified CRKey object into the specified group.

Parameters:
[in] hGroup - Group that will receive the elements.
[in] pRk - CRKey object whose elements that will be copied.
Returns:
Non-zero if success
See also:

BOOL CCfgFile::CopyGroup LPCTSTR  pGroup,
LPCTSTR  pNewGroup
 

Copies one group to another.

Parameters:
[in] pGroup - Name of group that will be copied.
[in] pNewGroup - Name of new group to be created.
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::DeCanonicalizeBuffer LPCTSTR  str,
LPBYTE  buf,
DWORD  max,
LPDWORD  size
[static]
 

Decodes buffer, that is, converts all escape characters to actual values.

Parameters:
[in] str - The string to decode.
[out] buf - Buffer to hold decoded string.
[in] max - The size of the buffer in buf.
[out] size - The number of bytes written to buf.
Returns:
Non-zero if success.
See also:
CanonicalizeBuffer()

void CCfgFile::DeleteElements HGROUP  hGroup  ) 
 

Deletes all elements of the specified group.

Parameters:
[in] hGroup - Handle to the group.

LPCFGELEMENTINFO CCfgFile::FindElement HGROUP  hGroup,
LPCTSTR  pName
 

Searches for the named element.

Parameters:
[in] hGroup - Handle to group containing element
[in] pName - Name of element to find.
Returns:
Pointer to element data or NULL if not found.
See also:

HGROUP CCfgFile::FindGroup LPCTSTR  pGroup  ) 
 

Returns the handle to the specified group.

Parameters:
[in] pGroup - Pointer to a string naming the group to find.
Returns:
Returns the handle to the group if found, otherwise NULL.

DWORD CCfgFile::GetDword HGROUP  hGroup,
LPCTSTR  pName,
DWORD  dwDefault = 0
[inline]
 

DWORD representation of element.

Parameters:
[in] hGroup - Group containing element
[in] pName - Name of element.
[in] dwDefault - Default value for element.
Returns:
DWORD value for element or dwDefault if error.
See also:

DWORD CCfgFile::GetDword LPCTSTR  pGroup,
LPCTSTR  pName,
DWORD  dwDefault = 0
[inline]
 

DWORD representation of element.

Parameters:
[in] pGroup - Group containing element
[in] pName - Name of element.
[in] dwDefault - Default value for element.
Returns:
DWORD value for element or dwDefault if error.
See also:

static DWORD CCfgFile::GetMinCanonicalizeBufferSize DWORD  size  )  [inline, static]
 

Returns the minimum size buffer needed to store the encoded string.

Parameters:
[in] size - Size of the decoded string.
Returns:
The maximum size of the encoded string.
See also:
CanonicalizeBuffer()

static DWORD CCfgFile::GetMinDeCanonicalizeBufferSize DWORD  size  )  [inline, static]
 

Returns the minimum size buffer needed to store the decoded string.

Parameters:
[in] size - Size of the encoded string.
Returns:
The maximum size of the decoded string.
See also:
DeCanonicalizeBuffer()

LPCFGGROUPINFO CCfgFile::GetNext LPCFGGROUPINFO  ptr  )  [inline]
 

Gets the pointer to the next group.

Parameters:
[in] ptr - A group information structure
Returns:
Pointer to the next group or NULL if none.
See also:

LPCFGELEMENTINFO CCfgFile::GetNextElement HGROUP  hGroup,
LPCFGELEMENTINFO  ptr
[inline]
 

Returns the next element in a group.

Parameters:
[in] hGroup - Group containing element.
[in] ptr - Pointer to current element.
Returns:
Pointer to the next element or NULL if none.
See also:

DWORD CCfgFile::GetNumGroups  )  [inline]
 

Returns the total number of groups in the configuration.

Returns:
The number of groups in the configuration.
See also:

LPCTSTR CCfgFile::GetSz HGROUP  hGroup,
LPCTSTR  pName,
LPCTSTR  pDefault = ""
[inline]
 

Returns a pointer to a string representation of an element.

Parameters:
[in] hGroup - Group containing the element.
[in] pName - Name of the element.
[in] pDefault - Default value for element.
Returns:
Pointer to string representation of element or pDefault if failure.
See also:

LPCTSTR CCfgFile::GetSz LPCTSTR  pGroup,
LPCTSTR  pName,
LPCTSTR  pDefault = ""
[inline]
 

Returns a pointer to a string representation of an element.

Parameters:
[in] pGroup - Group containing the element.
[in] pName - Name of the element.
[in] pDefault - Default value for element.
Returns:
Pointer to string representation of element or pDefault if failure.
See also:

BOOL CCfgFile::GetValue LPCTSTR  pGroup,
LPCTSTR  pName,
double *  pdValue
[inline]
 

Retreives the double representation of the specified element.

Parameters:
[in] pGroup - Group containing the element.
[in] pName - Name of the element.
[in] pdValue - Receives the double representation.
Returns:
Non-zero if success, otherwise zero
See also:

BOOL CCfgFile::GetValue HGROUP  hGroup,
LPCTSTR  pName,
double *  pdValue
[inline]
 

Retreives the double representation of the specified element.

Parameters:
[in] hGroup - Group containing the element.
[in] pName - Name of the element.
[in] pdValue - Receives the double representation.
Returns:
Non-zero if success, otherwise zero
See also:

BOOL CCfgFile::GetValue LPCTSTR  pGroup,
LPCTSTR  pName,
long *  plValue
[inline]
 

Returns the long representation of the specified element.

Parameters:
[in] pGroup - Group containing the element.
[in] pName - Name of the element.
[in] plValue - Receives the long representation of the element.
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::GetValue HGROUP  hGroup,
LPCTSTR  pName,
long *  plValue
[inline]
 

Returns the long representation of the specified element.

Parameters:
[in] hGroup - Group containing the element.
[in] pName - Name of the element.
[in] plValue - Receives the long representation of the element.
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::GetValue LPCTSTR  pGroup,
LPCTSTR  pName,
LPDWORD  pdwValue
[inline]
 

Retreives the DWORD representation of the specified element.

Parameters:
[in] pGroup - Name of the group containing the element.
[in] pName - Name of the element.
[out] pdwValue - Receives the DWORD value of the element.
Returns:
Non-zero if success
See also:

BOOL CCfgFile::GetValue HGROUP  hGroup,
LPCTSTR  pName,
LPDWORD  pdwValue
[inline]
 

Retreives the DWORD representation of the specified element.

Parameters:
[in] hGroup - Handle to the group containing the element.
[in] pName - Name of the element.
[out] pdwValue - Receives the DWORD value of the element.
Returns:
Non-zero if success
See also:

BOOL CCfgFile::GetValue LPCTSTR  pGroup,
LPCTSTR  pName,
LPSTR  pValue,
DWORD  dwSize
[inline]
 

Returns the value data for the specified element.

Parameters:
[in] pGroup - Name of the group containing element.
[in] pName - Name of the element.
[out] pValue - Receives the string value for the element.
[in] dwSize - Size of the buffer in pValue.
Call with pValue set to NULL to retreive the required buffer size.

Returns:
Non-zero if success.
See also:

BOOL CCfgFile::GetValue HGROUP  hGroup,
LPCTSTR  pName,
LPSTR  pValue,
DWORD  dwSize
[inline]
 

Returns the value data for the specified element.

Parameters:
[in] hGroup - Handle of the group containing element.
[in] pName - Name of the element.
[out] pValue - Receives the string value for the element.
[in] dwSize - Size of the buffer in pValue.
Call with pValue set to NULL to retreive the required buffer size.

Returns:
Non-zero if success.
See also:

BOOL CCfgFile::GetValue LPCTSTR  pGroup,
LPCTSTR  pName,
LPVOID  pValue,
DWORD  dwSize
[inline]
 

Returns the value data for the specified element.

Parameters:
[in] pGroup - Name of the group containing element.
[in] pName - Name of the element.
[out] pValue - Receives the value data for the element.
[in] dwSize - Size of the buffer in pValue.
Call with pValue set to NULL to retreive the required buffer size.

Returns:
Non-zero if success.
See also:

BOOL CCfgFile::GetValue HGROUP  hGroup,
LPCTSTR  pName,
LPVOID  pValue,
DWORD  dwSize
[inline]
 

Returns the value data for the specified element.

Parameters:
[in] hGroup - Handle to group containing element.
[in] pName - Name of the element.
[out] pValue - Receives the value data for the element.
[in] dwSize - Size of the buffer in pValue.
Call with pValue set to NULL to retreive the required buffer size.

Returns:
Non-zero if success.
See also:

LPVOID CCfgFile::GetValuePtr LPCTSTR  pGroup,
LPCTSTR  pName
[inline]
 

Returns a pointer to the data of the specified element.

Parameters:
[in] pGroup - Name of the group containing the element.
[in] pName - The name of the element.
Returns:
Pointer to the element data.
See also:

LPVOID CCfgFile::GetValuePtr HGROUP  hGroup,
LPCTSTR  pName
[inline]
 

Returns a pointer to the data of the specified element.

Parameters:
[in] hGroup - Handle to group containing the element.
[in] pName - The name of the element.
Returns:
Pointer to the element data.
See also:

DWORD CCfgFile::GetValueSize LPCTSTR  pGroup,
LPCTSTR  pName
[inline]
 

Returns the size of the data in the specified element.

Parameters:
[in] pGroup - Name of the group containing element
[in] pName - Pointer to name of the element.
Returns:
Size of the data.
See also:

DWORD CCfgFile::GetValueSize HGROUP  hGroup,
LPCTSTR  pName
[inline]
 

Returns the size of the data in the specified element.

Parameters:
[in] hGroup - Handle to group containing element
[in] pName - Pointer to name of the element.
Returns:
Size of the data.
See also:

BOOL CCfgFile::Load LPCTSTR  pFile,
BOOL  bMerge = FALSE
 

Loads a configuration file from disk.

Parameters:
[in] pFile - Filename of the configuration file that will be read.
[in] bMerge - Set to non-zero if you want to merge the configuration file into the existing configuration.

BOOL CCfgFile::LoadFromMem LPBYTE  buf,
DWORD  size,
BOOL  bMerge = FALSE
 

Loads a configuration file from a memory buffer.

Parameters:
[in] buf - Pointer to the buffer containing the configuration file data.
[in] size - Size of the buffer in buf.
[in] bMerge - Set to non-zero if you want to merge the configuration file into the existing configuration.

BOOL CCfgFile::RemoveElement HGROUP  hGroup,
LPCFGELEMENTINFO  node
 

Parameters:
[in] hGroup - Handle to group containing element to remove.
[in] node - Pointer to element structure to remove.
Returns:
Non-zero if success
See also:

BOOL CCfgFile::RemoveElement LPCTSTR  pGroup,
LPCTSTR  pElement
 

Removes an element from the configuration list.

Parameters:
[in] pGroup - Pointer to a string naming the settings group.
[in] pElement - Pointer to a string naming the setting.
Returns:
Returns non-zero on success.

BOOL CCfgFile::RemoveGroup HGROUP  node  ) 
 

Removes a group from the configuration list.

Parameters:
[in] node - Handle to group
Returns:
Returns non-zero on success.

BOOL CCfgFile::RemoveGroup LPCTSTR  pGroup  ) 
 

Removes a group from the configuration list.

Parameters:
[in] pGroup - Pointer to a string naming the settings group.
Returns:
Returns non-zero on success.

BOOL CCfgFile::RestoreWindowPos HWND  hWnd,
LPCTSTR  pGroup,
LPCTSTR  pName,
BOOL  bSize = TRUE,
BOOL  bPosition = TRUE,
BOOL  bToolWindow = FALSE,
BOOL  bTopmost = FALSE
 

Restores the position of a window from a configuration file entry.

Parameters:
[in] hWnd - Handle to the window that will be restored.
[in] pGroup - Pointer to a string naming the settings group.
[in] pName - Pointer to a string nameing the setting.
[in] bSize - Set to non-zero to have the window resized.
[in] bPosition - Set to non-zero to have the window repositioned.
[in] bToolWindow - Set to non-zero if the window is a tool window
[in] bTopmost - Set to non-zero to restore the Z-Order position.
Returns:
Returns non-zero on success.

BOOL CCfgFile::Save LPCTSTR  pFile = NULL  ) 
 

Saves configuration file to disk.

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

BOOL CCfgFile::SaveWindowPos HWND  hWnd,
LPCTSTR  pGroup,
LPCTSTR  pName,
BOOL  bToolwindow = FALSE
 

Saves the position of a window into a configuration file entry.

Parameters:
[in] hWnd - Handle to the window that will be restored.
[in] pGroup - Pointer to a string naming the settings group.
[in] pName - Pointer to a string naming the setting.
[in] bToolwindow - Set to non-zero if the window is a tool window
Returns:
Returns non-zero on success.

void CCfgFile::SetFileName LPCTSTR  file  )  [inline]
 

Sets the default filename for the configuration.

Parameters:
[in] file - The file name of the configuration.

void CCfgFile::SetKey LPCTSTR  pKey  )  [inline]
 

Sets the encryption / decryption key for the configuration file.

Parameters:
[in] pKey - The encryption / decryption key for the file.

void CCfgFile::SetTerminator BYTE  term  )  [inline]
 

Sets the default line terminiation character.

Parameters:
[in] term - The default line terminiation character
Returns:
See also:

BOOL CCfgFile::SetValue LPCTSTR  pGroup,
LPCTSTR  pName,
double  dValue
[inline]
 

Sets the double representation of the element.

Parameters:
[in] pGroup - Group containing the element.
[in] pName - Name of the element.
[in] dValue - double representation of the element
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue HGROUP  hGroup,
LPCTSTR  pName,
double  dValue
[inline]
 

Sets the double representation of the element.

Parameters:
[in] hGroup - Group containing the element.
[in] pName - Name of the element.
[in] dValue - double representation of the element
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue LPCTSTR  pGroup,
LPCTSTR  pName,
long  lValue
[inline]
 

Sets the long representation of an element.

Parameters:
[in] pGroup - Name of the group containing element.
[in] pName - Name of the element to set.
[in] lValue - New long value of the element
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue HGROUP  hGroup,
LPCTSTR  pName,
long  lValue
[inline]
 

Sets the long representation of an element.

Parameters:
[in] hGroup - Handle to the group containing element.
[in] pName - Name of the element to set.
[in] lValue - New long value of the element
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue LPCTSTR  pGroup,
LPCTSTR  pName,
DWORD  dwValue
[inline]
 

Sets the DWORD representation of the specified element.

Parameters:
[in] pGroup - Name of the group containing the element
[in] pName - Name of the element.
[in] dwValue - New DWORD value for element
Returns:
Non-Zero if success.
See also:

BOOL CCfgFile::SetValue HGROUP  hGroup,
LPCTSTR  pName,
DWORD  dwValue
[inline]
 

Sets the DWORD representation of the specified element.

Parameters:
[in] hGroup - Handle to the group containing the element
[in] pName - Name of the element.
[in] dwValue - New DWORD value for element
Returns:
Non-Zero if success.
See also:

BOOL CCfgFile::SetValue LPCTSTR  pGroup,
LPCTSTR  pName,
LPCTSTR  pValue
[inline]
 

Sets the string representation for an element.

Parameters:
[in] pGroup - Group containing the element.
[in] pName - Name of the element.
[in] pValue - String value of the element.
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue HGROUP  hGroup,
LPCTSTR  pName,
LPCTSTR  pValue
[inline]
 

Sets the string representation for an element.

Parameters:
[in] hGroup - Group containing the element.
[in] pName - Name of the element.
[in] pValue - String value of the element.
Returns:
Non-zero if success.
See also:

BOOL CCfgFile::SetValue LPCTSTR  pGroup,
LPCTSTR  pName,
LPVOID  pValue,
DWORD  dwSize
[inline]
 

Set binary variables.

Parameters:
[in] pGroup - Group containing element
[in] pName - Name of the element to set
[in] pValue - New value data of element.
[in] dwSize - Size of the buffer in pValue.
Returns:
See also:

BOOL CCfgFile::SetValue HGROUP  hGroup,
LPCTSTR  pName,
LPVOID  pValue,
DWORD  dwSize
[inline]
 

Set binary variables.

Parameters:
[in] hGroup - Group containing element
[in] pName - Name of the element to set
[in] pValue - New value data of element.
[in] dwSize - Size of the buffer in pValue.
Returns:
See also:

DWORD CCfgFile::Size  )  [inline]
 

Returns the total size of the list, i.e. the total number of elements.

Returns:
The number of elements in the configuration.
See also:

HGROUP CCfgFile::VerifyGroup HGROUP  hGroup  ) 
 

Verifies that a handle to a group is in fact valid.

Parameters:
[in] hGroup - Pointer to a group handle.
Returns:
Returns hGroup if it is valid otherwise NULL.

DWORD CCfgFile::WriteToMem LPBYTE  buf,
DWORD  size,
LPCTSTR  src,
DWORD  srcsize
 

Writes the specified data to the specified memory buffer.

Parameters:
[in] buf - Memory buffer pointer.
[in] size - Size of the buffer in buf.
[in] src - Data to write.
[in] srcsize - Size of the buffer in src.
Returns:
Returns the number of bytes written to buf.


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