Library: Net Responsibility
Package: Core
Header: Options.h
Poco::Util::ServerApplication is already handling configurations and arguments, but it's way too flexible for us. This is where the Options class comes in. It processes the config and txt files, and stores all usable values in class members.
Member Functions: doCompressAttachedReport, doSaveHistory, doSendImprovementData, getAttachedReportParts, getBlacklistFile, getConfigfile, getDatabasefile, getEmailFrom, getEmailTo, getInitBypasses, getMacAddress, getName, getPidfile, getReportFrequency, getReportModule, getReportParts, getReportStrengthThreshold, getServer, getSmtpHost, getSmtpPort, getTxt, getUsername, getVersion, isAttachedReportPart, isReportPart, loadConfigfile, setUsername
Options();
Options(
int argc,
char * argv[]
);
Deprecated, use the default contructor Options() instead.
virtual ~Options();
bool doCompressAttachedReport() const;
Returns true if the report should be zipped.
bool doSaveHistory() const;
bool doSendImprovementData() const;
Returns true if we're supposed to send the improvement data to the server.
vector < string > getAttachedReportParts() const;
Returns the attached report parts.
string getBlacklistFile() const;
The path to the local blacklist file.
string getConfigfile() const;
The path to the local config file.
string getDatabasefile() const;
The path to the database.
string getEmailFrom() const;
Returns the user's email address. This will be specified as reply-to in the report header, so that accountability partners will reply directly to the user instead of report@netresponsibility.com.
vector < string > getEmailTo() const;
Returns all emails to send reports to.
Bypasses & getInitBypasses() const;
string getMacAddress() const;
Returns the computer's MAC Address. This is used when communicating with the server.
string getName() const;
Returns the name of the user. This name will be used as sender of the reports.
string getPidfile() const;
The path to the pidfile.
int getReportFrequency() const;
Returns the number of days between scheduled reports.
string getReportModule() const;
The path to the report module.
vector < string > getReportParts() const;
Returns the report parts.
int getReportStrengthThreshold() const;
Returns the report strength threshold.
string getServer() const;
The server, usually www.netresponsibility.com
string getSmtpHost() const;
int getSmtpPort() const;
string getTxt(
string
) const;
The path to the local txt file.
string getUsername() const;
Returns the username, used to communicate with the server.
string getVersion() const;
The current version of Net Responsibility.
bool isAttachedReportPart(
string part
) const;
Returns true if the given part should be included in the attached report.
bool isReportPart(
string part
) const;
Returns true if the given part should be included in the regular report.
void loadConfigfile();
Load all options from the local configfile, or download a new one if it's corrupt.
void setUsername(
string
);