Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions

Barry::ConfigFile Class Reference

Collaboration diagram for Barry::ConfigFile:
Collaboration graph
[legend]

List of all members.

Classes

class  DBListType

Public Member Functions

 ConfigFile (Barry::Pin pin)
 Loads config file for the given pin, and ends up in an unenlightened state.
 ConfigFile (Barry::Pin pin, const Barry::DatabaseDatabase &db)
 Opens and loads config file for given pin, and calls Enlighten Throws ConfigFileError on error.
bool Save ()
 Saves current device's config, overwriting or creating a config file.
void Enlighten (const Barry::DatabaseDatabase &db)
 Compares a given databasedatabase from a real device with the current config.
void SetBackupList (const DBListType &list)
 Sets list with new config.

Static Public Member Functions

static bool CheckPath (const std::string &path, std::string *perr=0)
 Checks that the path in path exists, and if not, creates it.

Protected Member Functions

void Load ()
 Attempt to load the configuration file, but do not fail if not available.

Detailed Description

Definition at line 38 of file configfile.h.


Constructor & Destructor Documentation

Barry::ConfigFile::ConfigFile ( Barry::Pin  pin  )  [explicit]

Loads config file for the given pin, and ends up in an unenlightened state.

Throws ConfigFileError on error, but it is not an error if the config does not exist. Never use this if you have a DatabaseDatabase object! This ctor is only for temporary loading of config data.

Definition at line 101 of file configfile.cc.

Barry::ConfigFile::ConfigFile ( Barry::Pin  pin,
const Barry::DatabaseDatabase db 
)

Opens and loads config file for given pin, and calls Enlighten Throws ConfigFileError on error.

Should never fail unless passed a bad pin, or if unable to get current user info.

Should never fail unless passed a bad pin.

Definition at line 118 of file configfile.cc.


Member Function Documentation

bool Barry::ConfigFile::CheckPath ( const std::string &  path,
std::string *  perr = 0 
) [static]

Checks that the path in path exists, and if not, creates it.

Returns false if unable to create path, true if ok.

Definition at line 372 of file configfile.cc.

void Barry::ConfigFile::Enlighten ( const Barry::DatabaseDatabase db  ) 

Compares a given databasedatabase from a real device with the current config.

If not yet configured, initialize with valid defaults.

Definition at line 288 of file configfile.cc.

void Barry::ConfigFile::Load (  )  [protected]

Attempt to load the configuration file, but do not fail if not available.

Definition at line 178 of file configfile.cc.

bool Barry::ConfigFile::Save (  ) 

Saves current device's config, overwriting or creating a config file.

Definition at line 244 of file configfile.cc.

void Barry::ConfigFile::SetBackupList ( const DBListType list  ) 

Sets list with new config.

Definition at line 332 of file configfile.cc.


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