#include <Options.h>
Public Member Functions | |
Options () | |
Constructor. | |
~Options () | |
Destructor. | |
int | readOptions (void) |
Read the options from file. | |
int | writeOptions (void) |
Write the current options to file. | |
Glib::ustring | getInetdName (void) |
void | setInetdName (Glib::ustring &) |
Set new name of inetd. | |
Glib::ustring | getCfgFilename (void) |
void | setCfgFilename (Glib::ustring &) |
Set name for used CVSNT configuration file. | |
bool | getBackupFlag (void) |
Return backup flag. | |
void | setBackupFlag (bool) |
Set backup flag. | |
Glib::ustring | getBackupExt (void) |
void | setBackupExt (Glib::ustring &) |
Set new file extension for backup file. | |
Private Member Functions | |
void | setDefaults (void) |
Set internal data to defaults. | |
Private Attributes | |
Parser * | m_optParser |
Instance of Parser class to parse the options. | |
Glib::ustring | m_inetdName |
Name of the inetd server. | |
Glib::ustring | m_cvsntCfgFile |
Name of the CVSNT configuration file. | |
bool | m_makeBackup |
Flag: Create a backup of the original CVSNT configuration fileno. | |
Glib::ustring | m_bkupExt |
Name of the backup file. |
This class is responsible for the CVSNT LCP internal options data. This includes reading and writing the options as well as providing the data in a useful form for the GUI
Options::Options | ( | ) |
Constructor.
The constructor creates an instance of the parser and reads the option file. If it does not exist, the internal values will be pre-set with the defaults value and the option file will be created
Options::~Options | ( | ) |
Destructor.
The destructor cleans up the used memory
void Options::setDefaults | ( | void | ) | [private] |
Set internal data to defaults.
This method sets the internal option data to the default values
int Options::readOptions | ( | void | ) |
Read the options from file.
This method reads the option file and parses the values found into the internal data
NO_ERROR | Option file successfully read | |
COULD_NOT_OPEN_FILE | The option file could not be found | |
NO_VALID_ENTRIES | The option file contained not one valid entry |
int Options::writeOptions | ( | void | ) |
Write the current options to file.
This methods writes the current internal option data to the option file
NO_ERROR | Options successfully written |
Glib::ustring Options::getInetdName | ( | void | ) |
Return the currently used name of inetd
void Options::setInetdName | ( | Glib::ustring & | newInetd | ) |
Set new name of inetd.
[in] | newInetd | New name for inetd |
Glib::ustring Options::getCfgFilename | ( | void | ) |
Return name of used CVSNT configuration file
void Options::setCfgFilename | ( | Glib::ustring & | newCfgFile | ) |
Set name for used CVSNT configuration file.
[in] | newCfgFile | New name for used CVSNT configuration file |
bool Options::getBackupFlag | ( | void | ) |
Return backup flag.
Return flag whether or not the configuration file should be backed up or not
void Options::setBackupFlag | ( | bool | backupFlag | ) |
Set backup flag.
Set flag whether or not the original configuration file should be backed up before writing
[in] | backupFlag | New value for backup flag |
Glib::ustring Options::getBackupExt | ( | void | ) |
Return file extension for backup file
void Options::setBackupExt | ( | Glib::ustring & | newExt | ) |
Set new file extension for backup file.
[in] | newExt | New file extension |
Parser* Options::m_optParser [private] |
Instance of Parser class to parse the options.
Glib::ustring Options::m_inetdName [private] |
Name of the inetd server.
Glib::ustring Options::m_cvsntCfgFile [private] |
Name of the CVSNT configuration file.
bool Options::m_makeBackup [private] |
Flag: Create a backup of the original CVSNT configuration fileno.
Glib::ustring Options::m_bkupExt [private] |
Name of the backup file.