Remoto - VFS: VFS_cron::crontime Class Reference
Remoto - VFS

A class to represent a crontime, which can be matched against a (current) time to see if it is active. More...

Public Member Functions

 crontime (QString time="")
 
bool matches (quint8 s, quint8 m, quint8 h, quint8 d, quint8 mo, quint8 w, quint16 y)
 Check if a crontime matches. More...
 
QString toCrontime () const
 Create a parseable crontime string. More...
 
QString toString () const
 A pretty print version of a crontime. More...
 
bool valid ()
 Vailidty of a VFS_cron::crontime. More...
 

Private Member Functions

quint64 parseField (QString field)
 VFS_cron::crontime::parseField. More...
 
quint64 parseRange (QString range)
 Parse a range component from a crontime string. More...
 
QList< quint16 > parseYear (QString y)
 Parse the year component of a crontime string. More...
 
QString toCrontimeString (QString which) const
 Generate a crontime string component. More...
 

Private Attributes

std::bitset< 32 > _dates
 bitset of dates More...
 
std::bitset< 24 > _hours
 bitset of hours More...
 
std::bitset< 60 > _minutes
 bitset of minutes More...
 
std::bitset< 13 > _months
 bitset of months More...
 
std::bitset< 60 > _seconds
 bitset of seconds More...
 
bool _valid
 Is the crontime valid? More...
 
std::bitset< 7 > _weekdays
 bitset of weekdays More...
 
QList< quint16 > _years
 list of years More...
 

Detailed Description

A class to represent a crontime, which can be matched against a (current) time to see if it is active.

See also
VFS_cron

Definition at line 23 of file VFS_cron.h.

Constructor & Destructor Documentation

◆ crontime()

VFS_cron::crontime::crontime ( QString  spec = "")
Parameters
specThe crontime string

Definition at line 453 of file VFS_cron.cpp.

Member Function Documentation

◆ matches()

bool VFS_cron::crontime::matches ( quint8  s,
quint8  m,
quint8  h,
quint8  d,
quint8  mo,
quint8  w,
quint16  y 
)

Check if a crontime matches.

Parameters
sSeconds
mMinutes
hHours
dDate
moMonth
wWeekday
yYear
Returns
boolean match

Definition at line 614 of file VFS_cron.cpp.

◆ parseField()

quint64 VFS_cron::crontime::parseField ( QString  field)
private

VFS_cron::crontime::parseField.

Parameters
fieldA crontime component field
Returns
The parsed bitmask range of values specified

Definition at line 479 of file VFS_cron.cpp.

◆ parseRange()

quint64 VFS_cron::crontime::parseRange ( QString  range)
private

Parse a range component from a crontime string.

Parameters
rangeThe range component
Returns
A bit mask as a quint64 representing the range

Definition at line 497 of file VFS_cron.cpp.

◆ parseYear()

QList< quint16 > VFS_cron::crontime::parseYear ( QString  y)
private

Parse the year component of a crontime string.

Parameters
yThe year component
Returns
A list of applicable years for the crontime event

Definition at line 543 of file VFS_cron.cpp.

◆ toCrontime()

QString VFS_cron::crontime::toCrontime ( ) const

Create a parseable crontime string.

Returns
A VFS_cron parseable crontime string

Definition at line 667 of file VFS_cron.cpp.

◆ toCrontimeString()

QString VFS_cron::crontime::toCrontimeString ( QString  which) const
private

Generate a crontime string component.

Parameters
whichWhich component
Returns
The parseable value range of a component

Definition at line 688 of file VFS_cron.cpp.

◆ toString()

QString VFS_cron::crontime::toString ( ) const

A pretty print version of a crontime.

Returns
The pretty string

Definition at line 636 of file VFS_cron.cpp.

◆ valid()

bool VFS_cron::crontime::valid ( )

Vailidty of a VFS_cron::crontime.

Returns
boolean

A bad crontime string will cause a crontime to be invalid.

Definition at line 598 of file VFS_cron.cpp.

Member Data Documentation

◆ _dates

std::bitset<32> VFS_cron::crontime::_dates
private

bitset of dates

Definition at line 39 of file VFS_cron.h.

◆ _hours

std::bitset<24> VFS_cron::crontime::_hours
private

bitset of hours

Definition at line 38 of file VFS_cron.h.

◆ _minutes

std::bitset<60> VFS_cron::crontime::_minutes
private

bitset of minutes

Definition at line 37 of file VFS_cron.h.

◆ _months

std::bitset<13> VFS_cron::crontime::_months
private

bitset of months

Definition at line 40 of file VFS_cron.h.

◆ _seconds

std::bitset<60> VFS_cron::crontime::_seconds
private

bitset of seconds

Definition at line 36 of file VFS_cron.h.

◆ _valid

bool VFS_cron::crontime::_valid
private

Is the crontime valid?

Definition at line 34 of file VFS_cron.h.

◆ _weekdays

std::bitset<7> VFS_cron::crontime::_weekdays
private

bitset of weekdays

Definition at line 41 of file VFS_cron.h.

◆ _years

QList<quint16> VFS_cron::crontime::_years
private

list of years

Definition at line 42 of file VFS_cron.h.


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