NetResponsibility

class Options

Library: Net Responsibility
Package: Core
Header: Options.h

Description

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 Summary

Member Functions: doCompressAttachedReport, doSaveHistory, doSendImprovementData, getAttachedReportParts, getBlacklistFile, getConfigfile, getDatabasefile, getEmailFrom, getEmailTo, getInitBypasses, getMacAddress, getName, getPidfile, getReportFrequency, getReportModule, getReportParts, getReportStrengthThreshold, getServer, getTxt, getUsername, getVersion, isAttachedReportPart, isReportPart, loadConfigfile, setUsername

Constructors

Options

Options();

Options

Options(
    int argc,
    char * argv[]
);

Deprecated, use the default contructor Options() instead.

Destructor

~Options virtual

virtual ~Options();

Member Functions

doCompressAttachedReport

bool doCompressAttachedReport() const;

Returns true if the report should be zipped.

doSaveHistory

bool doSaveHistory() const;

doSendImprovementData

bool doSendImprovementData() const;

Returns true if we're supposed to send the improvement data to the server.

getAttachedReportParts

vector < string > getAttachedReportParts() const;

Returns the attached report parts.

getBlacklistFile

string getBlacklistFile() const;

The path to the local blacklist file.

getConfigfile

string getConfigfile() const;

The path to the local config file.

getDatabasefile

string getDatabasefile() const;

The path to the database.

getEmailFrom

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.

getEmailTo

vector < string > getEmailTo() const;

Returns all emails to send reports to.

getInitBypasses

Bypasses & getInitBypasses() const;

getMacAddress

string getMacAddress() const;

Returns the computer's MAC Address. This is used when communicating with the server.

getName

string getName() const;

Returns the name of the user. This name will be used as sender of the reports.

getPidfile

string getPidfile() const;

The path to the pidfile.

getReportFrequency

int getReportFrequency() const;

Returns the number of days between scheduled reports.

getReportModule

string getReportModule() const;

The path to the report module.

getReportParts

vector < string > getReportParts() const;

Returns the report parts.

getReportStrengthThreshold

int getReportStrengthThreshold() const;

Returns the report strength threshold.

getServer

string getServer() const;

The server, usually www.netresponsibility.com

getTxt

string getTxt(
    string
) const;

The path to the local txt file.

getUsername

string getUsername() const;

Returns the username, used to communicate with the server.

getVersion

string getVersion() const;

The current version of Net Responsibility.

isAttachedReportPart

bool isAttachedReportPart(
    string part
) const;

Returns true if the given part should be included in the attached report.

isReportPart

bool isReportPart(
    string part
) const;

Returns true if the given part should be included in the regular report.

loadConfigfile

void loadConfigfile();

Load all options from the local configfile, or download a new one if it's corrupt.

setUsername

void setUsername(
    string
);