Options Class Reference

Options class. More...

#include <Options.h>

List of all members.

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

Parserm_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.


Detailed Description

Options class.

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


Constructor & Destructor Documentation

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


Member Function Documentation

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

Return values:
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

Return values:
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.

Parameters:
[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.

Parameters:
[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

Parameters:
[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.

Parameters:
[in] newExt New file extension


Member Data Documentation

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.


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 10:06:09 2007 for cvsntLCP by  doxygen 1.5.3