Barry::ConfigFile Class Reference

Collaboration diagram for Barry::ConfigFile:
[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 32 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 56 of file configfile.cc.

References Load().

Here is the call graph for this function:

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 72 of file configfile.cc.

References Enlighten(), and Load().

Here is the call graph for this function:


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 286 of file configfile.cc.

Referenced by Load(), Barry::GlobalConfigFile::Save(), and Save().

Here is the caller graph for this function:

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 223 of file configfile.cc.

Referenced by ConfigFile().

Here is the caller graph for this function:

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

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

Definition at line 121 of file configfile.cc.

References CheckPath().

Referenced by ConfigFile().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Barry::ConfigFile::Save (  ) 

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

Definition at line 182 of file configfile.cc.

References CheckPath().

Here is the call graph for this function:

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

Sets list with new config.

Definition at line 251 of file configfile.cc.


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

Generated on 29 Mar 2010 for Barry by  doxygen 1.6.1