UTILITY::CONFIGURATION::Settings Class Reference

#include <Settings.h>

List of all members.


Detailed Description

A class for loading and saving program settings easily.

Definition at line 28 of file Settings.h.


Public Member Functions

 Settings ()
 constructor
 ~Settings ()
 destructor
void Load (const char *pathName, bool clearBeforeLoad=true, bool quiet=true)
 loads a settings file
void Save (const char *pathName, bool quiet=true)
 saves settings to a file
void Clear ()
 clears all loaded settings
void List (FILE *target)
 lists all loaded settings to the specified file pointer
void Set (const char *setting, const char *value)
 sets the value of a setting, adds if it doesn't exist, overrides if it does
std::string Get (const char *setting)
 gets the value of a setting, or a null-string if it was not found

Private Types

typedef std::map< std::string,
std::string > 
SettingTable
 a typedef for string to string mapping
typedef std::map< std::string,
std::string >::iterator 
SettingTableIterator
 a typedef for iterating on a string to string mapping

Private Member Functions

 Settings (const Settings &rhs)
 hidden copy constructor
const Settingsoperator= (const Settings &rhs)
 hidden assignment operator

Private Attributes

SettingTable settings_
 the settings table

Member Typedef Documentation

typedef std::map<std::string, std::string> UTILITY::CONFIGURATION::Settings::SettingTable [private]

a typedef for string to string mapping

Definition at line 65 of file Settings.h.

typedef std::map<std::string, std::string>::iterator UTILITY::CONFIGURATION::Settings::SettingTableIterator [private]

a typedef for iterating on a string to string mapping

Definition at line 68 of file Settings.h.


Constructor & Destructor Documentation

UTILITY::CONFIGURATION::Settings::Settings (  ) 

constructor

Definition at line 34 of file Settings.cpp.

UTILITY::CONFIGURATION::Settings::~Settings (  ) 

destructor

Definition at line 40 of file Settings.cpp.

References Clear().

Here is the call graph for this function:

UTILITY::CONFIGURATION::Settings::Settings ( const Settings rhs  )  [private]

hidden copy constructor


Member Function Documentation

void UTILITY::CONFIGURATION::Settings::Load ( const char *  pathName,
bool  clearBeforeLoad = true,
bool  quiet = true 
)

loads a settings file

Definition at line 47 of file Settings.cpp.

References Clear(), UTILITY::PARSING::StringTokenizer::Execute(), UTILITY::PARSING::TextFileParser::Execute(), LogError, and Set().

Here is the call graph for this function:

void UTILITY::CONFIGURATION::Settings::Save ( const char *  pathName,
bool  quiet = true 
)

saves settings to a file

Definition at line 101 of file Settings.cpp.

References UTILITY::TIME::TimeStamp::Execute(), LogError, and settings_.

Here is the call graph for this function:

void UTILITY::CONFIGURATION::Settings::Clear (  ) 

clears all loaded settings

Definition at line 133 of file Settings.cpp.

References settings_.

Referenced by Load(), and ~Settings().

Here is the caller graph for this function:

void UTILITY::CONFIGURATION::Settings::List ( FILE *  target  ) 

lists all loaded settings to the specified file pointer

Definition at line 140 of file Settings.cpp.

References settings_.

void UTILITY::CONFIGURATION::Settings::Set ( const char *  setting,
const char *  value 
)

sets the value of a setting, adds if it doesn't exist, overrides if it does

Definition at line 151 of file Settings.cpp.

References settings_.

Referenced by Load().

Here is the caller graph for this function:

std::string UTILITY::CONFIGURATION::Settings::Get ( const char *  setting  ) 

gets the value of a setting, or a null-string if it was not found

Definition at line 158 of file Settings.cpp.

References settings_.

const Settings& UTILITY::CONFIGURATION::Settings::operator= ( const Settings rhs  )  [private]

hidden assignment operator


Member Data Documentation

the settings table

Definition at line 71 of file Settings.h.

Referenced by Clear(), Get(), List(), Save(), and Set().


The documentation for this class was generated from the following files:

Generated on Tue Mar 3 20:11:41 2009 for ged101minimal by  doxygen 1.5.5