wUtil::CConfigStore Class Reference

CConfigStore allows settings to be stored and read from common text files. More...

#include <wutil_config_store.h>

Public Member Functions

Protected Types

Protected Attributes


Detailed Description

CConfigStore allows settings to be stored and read from common text files.

Definition at line 39 of file wutil_config_store.h.


Member Function Documentation

std::pair< bool, std::wstring > wUtil::CConfigStore::GetStringEntry ( std::wstring  sKey  )  const

Read the specified setting as a string

Parameters:
sKey A string that identifies the entry to be read
Returns:
A pair, where the first bool indicates if the setting was retrieved, and the second is string value of the specified setting

Definition at line 35 of file wutil_config_store.cpp.

References m_SettingsMap.

Referenced by wGui::CApplication::GetFontEngine(), and wGui::CApplication::Init().

std::pair< bool, long int > wUtil::CConfigStore::GetLongIntEntry ( std::wstring  sKey  )  const

Read the specified setting as an integer

Parameters:
sKey A string that identifies the entry to be read
Returns:
A pair, where the first bool indicates if the setting was retrieved, and the second is long integer value of the specified setting

Definition at line 50 of file wutil_config_store.cpp.

References stdex::atol(), and m_SettingsMap.

Referenced by wGui::CApplication::Init().

std::pair< bool, double > wUtil::CConfigStore::GetDoubleEntry ( std::wstring  sKey  )  const

Read the specified setting as a double

Parameters:
sKey A string that identifies the entry to be read
Returns:
A pair, where the first bool indicates if the setting was retrieved, and the second is double value of the specified setting

Definition at line 65 of file wutil_config_store.cpp.

References stdex::atod(), and m_SettingsMap.

void wUtil::CConfigStore::SetStringEntry ( std::wstring  sKey,
std::wstring  sValue 
)

Store a setting as a string

Parameters:
sKey A string that identifies the entry to be stored
sValue The string value to be stored

Definition at line 80 of file wutil_config_store.cpp.

References m_SettingsMap.

void wUtil::CConfigStore::SetLongIntEntry ( std::wstring  sKey,
long int  lValue 
)

Store a setting as a long integer

Parameters:
sKey A string that identifies the entry to be stored
lValue The long integer value to be stored

Definition at line 86 of file wutil_config_store.cpp.

References stdex::ltoa(), and m_SettingsMap.

void wUtil::CConfigStore::SetDoubleEntry ( std::wstring  sKey,
double  dValue 
)

Store a setting as a double

Parameters:
sKey A string that identifies the entry to be stored
dValue The double value to be stored

Definition at line 92 of file wutil_config_store.cpp.

References stdex::dtoa(), and m_SettingsMap.

void wUtil::CConfigStore::RemoveEntry ( std::wstring  sKey  ) 

Remove a specified setting

Parameters:
sKey A string that identifies the entry to be removed

Definition at line 98 of file wutil_config_store.cpp.

References m_SettingsMap.

bool wUtil::CConfigStore::EntryExists ( std::wstring  sKey  )  const

Test to see if a specified entry exists

Parameters:
sKey A string that identifies the entry to be tested
Returns:
true if the entry exists, otherwise false

Definition at line 104 of file wutil_config_store.cpp.

References m_SettingsMap.

Referenced by wGui::CApplication::Init().

void wUtil::CConfigStore::StoreToFile ( std::wstring  sFilename  )  const

Save the settings to a file

Parameters:
sFilename The filename to store the settings to

Definition at line 110 of file wutil_config_store.cpp.

References m_SettingsMap, and stdex::ToMbString().

bool wUtil::CConfigStore::ReadFromFile ( std::wstring  sFilename  ) 

Read the settings from a file This will not clear any current settings in the object, but will overwrite any values with the same key

Parameters:
sFilename The filename to read the settings from
Returns:
true if the file existed and we were able to read from it

Definition at line 126 of file wutil_config_store.cpp.

References m_SettingsMap, stdex::ToMbString(), and stdex::TrimString().

Referenced by wGui::CApplication::Init().


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:28 2007 for wGui by  doxygen 1.5.1