Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

BasicPreferences Class Reference

base class for all classes that need to register and access user options More...

#include <BasicPreferences.h>

Inheritance diagram for BasicPreferences:

Loggable BasicPlugin PluginManager SyncLog SyncManager BasicSync GSyncSetFactory GSyncSocket OrderedSync SetSync List of all members.

Public Member Functions

 BasicPreferences (SyncLog *pSyncLog, SettingsContainer *pSC)
 constructor
virtual ~BasicPreferences ()
 destructor
virtual string GetModuleName ()=0
 returns module name - used to identify which modules registered an option, to inform user about available plugins
virtual long GetModuleVersion (bool fHigh)=0
 returns module version - used for informative purposes (especially important for plugins)
virtual string GetModuleInfo ()=0
 returns module information - used to identify which modules registered an option
void RegisterValidator (fCBValidateParameters *pcfValidateAll)
void ParseCommandLine (char **ppCL, int nParamsNum, bool fWarnIfOptionUnregistered)
 parses command line options
void WriteSetupFile (const char *sSetupFName)
 writes setup file
void ParseSetupFile (const char *sSetupFName, bool fWarnIfOptionUnregistered)
 parses setup file
void SetOption (long nOption, bool fSet)
 set boolean option
bool GetOption (long nOption)
 get boolean option
bool RegisterO (string sOID, EOptionKind eKind, string sShortDescription, string sLongDescription)
 registers new option; returns false is such an option already exists or in case of any other problem
long GetON (string sID)
 get option value by option name
void SetON (string sID, long nValue)
 set option value by option name
double GetOFP (string sID)
 get option value by option name
void SetOFP (string sID, double dValue)
 set option value by option name
string GetOS (string sID)
 get option value by option name
void AddOS (string sID, string sValue)
 add string option value by option name
void SetOS (string sID, string sValue)
 set option value by option name
string FirstOSL (string sID, StringList::iterator &i)
 get first string from the list for the specified option
string NextOSL (string sID, StringList::iterator &i)
 get next string from the list for the specified option
const char * GetOCA (string sID, long &nArrayLength)
 get character array option value by option name (nArrayLength is set to the length of the array)
void SetOCA (string sID, const char *pValue, long nArrayLength, bool fCopy=TRUE)
 set character array option value by option name (nArrayLength is set to the length of the array)
string GetRemoteHostName ()
 get remote host name
void SetRemoteHostName (string sHName)
 set remote host name
long GetSocketPort ()
 get socket port number
void SetSocketPort (long nSocketPort)
 set socket port number
string GetDstFName ()
void SetDstFName (string sFName)
string GetSrcFName ()
void SetSrcFName (string sFName)
void DisplayOptions ()
 shows the list of available options provided by all loaded modules
const char * GetOptionKindName (EOptionKind eKind)
 returns man readable name of option kind (boolean, long integer, etc)

Protected Member Functions

bool IsOption (char *sString)
string GetOptionID (char *sString)
string GetOptionIDF (char *&sString)
BPOptionGetOption (string sOptionID)
 returns BPOption object associated with provided sOptionID
void ValidateSettingsContainer ()

Protected Attributes

string m_sRemoteHostName
 the name of the destination.Using this implies, this host is the client
long m_nSocketPort
 remote port number to connect; defaults to SR_DEFAULT_SOCKET_PORT
string m_sSrcFName
 Local file name.
string m_sDstFName
 Synchronized file name for testing purposed differs from the original file.
long m_nOptions0
long m_nOptions1
SettingsContainerm_pSettingsContainer
fCBValidateParametersm_pcfValidateAll

Detailed Description

base class for all classes that need to register and access user options


Constructor & Destructor Documentation

BasicPreferences::BasicPreferences SyncLog pSyncLog,
SettingsContainer pSC
 

constructor

BasicPreferences::~BasicPreferences  )  [virtual]
 

destructor


Member Function Documentation

void BasicPreferences::AddOS string  sID,
string  sValue
 

add string option value by option name

void BasicPreferences::DisplayOptions  ) 
 

shows the list of available options provided by all loaded modules

string BasicPreferences::FirstOSL string  sID,
StringList::iterator &  i
 

get first string from the list for the specified option

string BasicPreferences::GetDstFName  ) 
 

virtual string BasicPreferences::GetModuleInfo  )  [pure virtual]
 

returns module information - used to identify which modules registered an option

Implemented in PluginManager, SyncLog, and SyncManager.

virtual string BasicPreferences::GetModuleName  )  [pure virtual]
 

returns module name - used to identify which modules registered an option, to inform user about available plugins

Implemented in PluginManager, SyncLog, and SyncManager.

virtual long BasicPreferences::GetModuleVersion bool  fHigh  )  [pure virtual]
 

returns module version - used for informative purposes (especially important for plugins)

Implemented in PluginManager, SyncLog, and SyncManager.

const char * BasicPreferences::GetOCA string  sID,
long &  nArrayLength
 

get character array option value by option name (nArrayLength is set to the length of the array)

double BasicPreferences::GetOFP string  sID  ) 
 

get option value by option name

long BasicPreferences::GetON string  sID  ) 
 

get option value by option name

BPOption * BasicPreferences::GetOption string  sOptionID  )  [protected]
 

returns BPOption object associated with provided sOptionID

bool BasicPreferences::GetOption long  nOption  ) 
 

get boolean option

string BasicPreferences::GetOptionID char *  sString  )  [protected]
 

string BasicPreferences::GetOptionIDF char *&  sString  )  [protected]
 

const char * BasicPreferences::GetOptionKindName EOptionKind  eKind  ) 
 

returns man readable name of option kind (boolean, long integer, etc)

string BasicPreferences::GetOS string  sID  ) 
 

get option value by option name

string BasicPreferences::GetRemoteHostName  ) 
 

get remote host name

long BasicPreferences::GetSocketPort  )  [inline]
 

get socket port number

string BasicPreferences::GetSrcFName  ) 
 

bool BasicPreferences::IsOption char *  sString  )  [protected]
 

string BasicPreferences::NextOSL string  sID,
StringList::iterator &  i
 

get next string from the list for the specified option

void BasicPreferences::ParseCommandLine char **  ppCL,
int  nParamsNum,
bool  fWarnIfOptionUnregistered
 

parses command line options

void BasicPreferences::ParseSetupFile const char *  sSetupFName,
bool  fWarnIfOptionUnregistered
 

parses setup file

bool BasicPreferences::RegisterO string  sOID,
EOptionKind  eKind,
string  sShortDescription,
string  sLongDescription
 

registers new option; returns false is such an option already exists or in case of any other problem

void BasicPreferences::RegisterValidator fCBValidateParameters pcfValidateAll  ) 
 

register function called after parsing the command line and/or configuration file to validate the set of options

void BasicPreferences::SetDstFName string  sFName  ) 
 

void BasicPreferences::SetOCA string  sID,
const char *  pValue,
long  nArrayLength,
bool  fCopy = TRUE
 

set character array option value by option name (nArrayLength is set to the length of the array)

void BasicPreferences::SetOFP string  sID,
double  dValue
 

set option value by option name

void BasicPreferences::SetON string  sID,
long  nValue
 

set option value by option name

void BasicPreferences::SetOption long  nOption,
bool  fSet
 

set boolean option

void BasicPreferences::SetOS string  sID,
string  sValue
 

set option value by option name

void BasicPreferences::SetRemoteHostName string  sHName  ) 
 

set remote host name

void BasicPreferences::SetSocketPort long  nSocketPort  )  [inline]
 

set socket port number

void BasicPreferences::SetSrcFName string  sFName  ) 
 

void BasicPreferences::ValidateSettingsContainer  )  [protected]
 

void BasicPreferences::WriteSetupFile const char *  sSetupFName  ) 
 

writes setup file


Member Data Documentation

long BasicPreferences::m_nOptions0 [protected]
 

long BasicPreferences::m_nOptions1 [protected]
 

long BasicPreferences::m_nSocketPort [protected]
 

remote port number to connect; defaults to SR_DEFAULT_SOCKET_PORT

fCBValidateParameters* BasicPreferences::m_pcfValidateAll [protected]
 

SettingsContainer* BasicPreferences::m_pSettingsContainer [protected]
 

string BasicPreferences::m_sDstFName [protected]
 

Synchronized file name for testing purposed differs from the original file.

string BasicPreferences::m_sRemoteHostName [protected]
 

the name of the destination.Using this implies, this host is the client

string BasicPreferences::m_sSrcFName [protected]
 

Local file name.


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 12:59:36 2007 for GenSync by  doxygen 1.3.9.1