Hegel 0.18.3
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::generators::temporal::RuleDate Struct Reference

The day and time of day a yearly rule changes the clocks on, as a POSIX TZ string names them (RFC 9636 §3.3.1). More...

#include <zone_source.h>

Public Types

enum class  Kind { Julian , ZeroBased , MonthWeekDay }
 How the day is named. More...

Static Public Member Functions

static RuleDate julian (uint16_t day, int32_t time=7200)
static RuleDate zero_based (uint16_t day, int32_t time=7200)
static RuleDate month_week_day (Month month, uint8_t week, Weekday weekday, int32_t time=7200)

Public Attributes

Kind kind = Kind::MonthWeekDay
 How the day is named.
uint16_t day = 0
 The day of the year, for Kind::Julian and Kind::ZeroBased.
Month month = Month::January
 The month, for Kind::MonthWeekDay.
uint8_t week = 1
 The week in [1, 5], 5 meaning the last, for Kind::MonthWeekDay.
Weekday weekday = Weekday::Sunday
 The weekday, for Kind::MonthWeekDay.
int32_t time = 7200

Detailed Description

The day and time of day a yearly rule changes the clocks on, as a POSIX TZ string names them (RFC 9636 §3.3.1).

Build one with julian(), zero_based() or month_week_day().

Member Enumeration Documentation

◆ Kind

How the day is named.

Enumerator
Julian 

Jn: day day of the year in [1, 365], never counting February 29.

ZeroBased 

n: day day of the year in [0, 365], counting February

MonthWeekDay 

Mm.w.d: weekday of week week of month.

Member Function Documentation

◆ julian()

RuleDate hegel::generators::temporal::RuleDate::julian ( uint16_t day,
int32_t time = 7200 )
inlinestatic

Day day in [1, 365] of every year, February 29 not counted, so that julian(60) is always March 1.

Parameters
dayThe day of the year.
timeSeconds after local midnight. Default: 02:00.
Returns
The rule date.

◆ month_week_day()

RuleDate hegel::generators::temporal::RuleDate::month_week_day ( Month month,
uint8_t week,
Weekday weekday,
int32_t time = 7200 )
inlinestatic

The week-th weekday of month, week 5 meaning the last, so that month_week_day(Month::March, 2, Weekday::Sunday) is the second Sunday of March.

Parameters
monthThe month.
weekThe week in [1, 5].
weekdayThe weekday.
timeSeconds after local midnight. Default: 02:00.
Returns
The rule date.

◆ zero_based()

RuleDate hegel::generators::temporal::RuleDate::zero_based ( uint16_t day,
int32_t time = 7200 )
inlinestatic

Day day in [0, 365] of every year, February 29 counted.

Parameters
dayThe zero-based day of the year.
timeSeconds after local midnight. Default: 02:00.
Returns
The rule date.

Member Data Documentation

◆ time

int32_t hegel::generators::temporal::RuleDate::time = 7200

Seconds after local midnight of the day, within ±167 hours, in the offset in force before the change.


The documentation for this struct was generated from the following file: