Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_cronjob Class Reference

Represents a single entry from the cron section of mascot.dat. More...

#include <ms_cronoptions.hpp>

Public Member Functions

 ms_cronjob ()
 Default constructor.
 
 ms_cronjob (const ms_cronjob &src)
 Copying constructor.
 
 ~ms_cronjob ()
 Default destructor.
 
void copyFrom (const ms_cronjob *right)
 Can be used to create a copy of another object.
 
void defaultValues ()
 Initialises the instance with default values.
 
std::string getCommandStr () const
 Returns a string that is executed by the shell (command prompt) at the specified times.
 
bool isDayOfMonth (const int day) const
 Returns TRUE for a valid day number, FALSE otherwise.
 
bool isDayOfWeek (const int day) const
 Returns TRUE for a valid day of week number, FALSE otherwise.
 
bool isEnabled () const
 Returns true if the cron job is enabled.
 
bool isHour (const int hour) const
 Returns TRUE for a valid hour number, FALSE otherwise.
 
bool isMinute (const int min) const
 Returns TRUE for a valid minute number, FALSE otherwise.
 
bool isMonthOfYear (const int month) const
 Returns TRUE for a valid month number, FALSE otherwise.
 
ms_cronjoboperator= (const ms_cronjob &right)
 Assignment operator for C++ client applications.
 
void setCommandStr (const char *str)
 Set the command that is executed by the shell (command prompt) at the specified times.
 
void setDayOfMonth (const int day, const bool value)
 Set valid/illegal days.
 
void setDayOfWeek (const int day, const bool value)
 Set valid/illegal days.
 
void setEnabled (const bool enabled)
 Set the flag for determining if the cron job is enabled or disabled.
 
void setHour (const int hour, const bool value)
 Set valid/illegal hours.
 
void setMinute (const int min, const bool value)
 Set valid/illegal minutes.
 
void setMonthOfYear (const int month, const bool value)
 Set valid/illegal months.
 

Detailed Description

Represents a single entry from the cron section of mascot.dat.

Instances of this class can be stored in ms_cronoptions.

Member Function Documentation

◆ getCommandStr()

std::string getCommandStr ( ) const

Returns a string that is executed by the shell (command prompt) at the specified times.

By default this is empty.

Returns
the command to be run.
Examples
config_mascotdat.cpp.

◆ isDayOfMonth()

bool isDayOfMonth ( const int  day) const

Returns TRUE for a valid day number, FALSE otherwise.

A cron job entry in the configuration file specifies time to run a command. Use this function to retrieve the 'day' part of this specification.

Parameters
daya day number (1..31).
Returns
By default FALSE is returned for all days.

◆ isDayOfWeek()

bool isDayOfWeek ( const int  day) const

Returns TRUE for a valid day of week number, FALSE otherwise.

A cron job entry in the configuration file specifies time to run a command. Use this function to retrieve the 'day of week' part of this specification.

Parameters
daya day of week number (0..6, 0=Sunday).
Returns
By default FALSE is returned for all days.

◆ isEnabled()

bool isEnabled ( ) const

Returns true if the cron job is enabled.

A cron job entry in the configuration file specifies time to run a command. The entry can be disabled by putting a comments symbol # at the start of the line

Returns
true if the cron job is enabled.

◆ isHour()

bool isHour ( const int  hour) const

Returns TRUE for a valid hour number, FALSE otherwise.

A cron job entry in the configuration file specifies time to run a command. Use this function to retrieve the 'hour' part of this specification.

Parameters
houran hour number (0..23).
Returns
By default FALSE is returned for all hours.

◆ isMinute()

bool isMinute ( const int  min) const

Returns TRUE for a valid minute number, FALSE otherwise.

A cron job entry in the configuration file specifies time to run a command. Use this function to retrieve the 'minute' part of this specification.

Parameters
mina minute number (0..59).
Returns
By default FALSE is returned for all minutes.

◆ isMonthOfYear()

bool isMonthOfYear ( const int  month) const

Returns TRUE for a valid month number, FALSE otherwise.

A cron job entry in the configuration file specifies time to run a command. Use this function to retrieve the 'month' part of this specification.

Parameters
montha month number (1..12).
Returns
By default FALSE is returned for all months.

◆ setCommandStr()

void setCommandStr ( const char *  str)

Set the command that is executed by the shell (command prompt) at the specified times.

Parameters
stris the new command to be run.

◆ setDayOfMonth()

void setDayOfMonth ( const int  day,
const bool  value 
)

Set valid/illegal days.

See also
isDayOfMonth()
Parameters
dayan hour number (1..31).
valuea new boolean flag for the given day.

◆ setDayOfWeek()

void setDayOfWeek ( const int  day,
const bool  value 
)

Set valid/illegal days.

See also
isDayOfWeek()
Parameters
daya day of week number (0..6, 0=Sunday).
valuea new boolean flag for the given day.

◆ setEnabled()

void setEnabled ( const bool  enabled)

Set the flag for determining if the cron job is enabled or disabled.

A cron job entry in the configuration file specifies time to run a command. The entry can be disabled by putting a comments symbol # at the start of the line

Parameters
enabledtrue if the cron job is enabled.

◆ setHour()

void setHour ( const int  hour,
const bool  value 
)

Set valid/illegal hours.

See also
isHour()
Parameters
houran hour number (0..23).
valuea new boolean flag for the given hour.

◆ setMinute()

void setMinute ( const int  min,
const bool  value 
)

Set valid/illegal minutes.

See also
isMinute()
Parameters
mina minute number (0..59)
valuea new boolean flag for the given minute

◆ setMonthOfYear()

void setMonthOfYear ( const int  month,
const bool  value 
)

Set valid/illegal months.

See also
isMonthOfYear()
Parameters
montha month number (1..12).
valuea new boolean flag for the given month.

The documentation for this class was generated from the following files: