#include <CVSConfig.h>
Public Member Functions | |
CVSConfig (Glib::ustring &) | |
Constructor. | |
~CVSConfig () | |
Destructor. | |
Glib::ustring | getCfgFile (void) |
Returns the config file. | |
int | newConfigFile (Glib::ustring &) |
Set new config file. | |
Glib::ustring | getServerName (void) |
Return name of server. | |
int | newServerName (Glib::ustring &) |
Set new server name. | |
repoData * | getReposData (unsigned int &) |
Return repository data. | |
Private Member Functions | |
int | initConfig (void) |
Initialize configuration data. | |
int | loadConfig (void) |
(Re-)Load the configuration | |
Private Attributes | |
Parser * | m_cvsParser |
Parser to actually read the configuration file. | |
Glib::ustring | m_configFile |
Filename of CVSNT configuration file. | |
Glib::ustring | m_serverName |
Name of server (for mDNS publishing) as given by the user. | |
unsigned int | m_numRepos |
Number of repositories in config file. | |
repoData * | m_repositories |
Data about all defined repositories. |
This class contains all entries
CVSConfig::CVSConfig | ( | Glib::ustring & | cfgFile | ) |
Constructor.
The constructor for the configuration class. It exspects a CVSNT configuration file
[in] | cfgFile | Configuration file |
CVSConfig::~CVSConfig | ( | ) |
Destructor.
The destructor cleans up the used memory
int CVSConfig::initConfig | ( | void | ) | [private] |
Initialize configuration data.
This function initializes all configuration data of the class and therefore also for the given file
NO_ERROR | Successfully initialized |
int CVSConfig::loadConfig | ( | void | ) | [private] |
(Re-)Load the configuration
This function loads or reloads a configuration from a given file
NO_ERROR | Configuration successfully loaded | |
COULD_NOT_OPEN_FILE | The configuration file could not be opened for whatever reason |
Glib::ustring CVSConfig::getCfgFile | ( | void | ) |
Returns the config file.
This function returnes the filename of the current configuration file
int CVSConfig::newConfigFile | ( | Glib::ustring & | cfgFile | ) |
Set new config file.
Set filename for new configuration file
NO_ERROR | Configuration filename successfully set |
Glib::ustring CVSConfig::getServerName | ( | void | ) |
Return name of server.
This method returns the name of the server that is published via mDNS together with the published repositories. It is either the name provided in the configuration file or (if not specified) the hostname
int CVSConfig::newServerName | ( | Glib::ustring & | newSrvName | ) |
Set new server name.
This method sets the new server name (from the UI)
[in] | newSrvName | Name of the server |
NO_ERROR | New server name successfully set |
repoData * CVSConfig::getReposData | ( | unsigned int & | nRepos | ) |
Return repository data.
This method returns the repository data. The returned value is a pointer to an array of structs. The function parameter contains the number of entries in the array
[out] | nRepos | Number of repositories in returned array |
Parser* CVSConfig::m_cvsParser [private] |
Parser to actually read the configuration file.
Glib::ustring CVSConfig::m_configFile [private] |
Filename of CVSNT configuration file.
Glib::ustring CVSConfig::m_serverName [private] |
Name of server (for mDNS publishing) as given by the user.
unsigned int CVSConfig::m_numRepos [private] |
Number of repositories in config file.
repoData* CVSConfig::m_repositories [private] |
Data about all defined repositories.