Country Generator 3.3.2
Procedural country generation for C++23
Loading...
Searching...
No Matches
dasmig::holiday Struct Reference

One day of a holiday in a year. More...

#include <countrygen.hpp>

Public Member Functions

void to_json (core::json_writer &w) const
 Write this holiday as a JSON object, dates as YYYY-MM-DD.
 
std::string to_json () const
 This holiday as a JSON document.
 

Public Attributes

std::chrono::year_month_day date {}
 The day itself.
 
std::optional< std::chrono::year_month_day > observed
 Only when a weekend rule moves the day off.
 
std::string key
 Stable: "christmas_day", "eid_al_fitr_holiday".
 
std::string name
 In the country's language, as python-holidays writes it: "Natal".
 
std::string name_en
 In English: "Christmas Day".
 
holiday_kind kind {holiday_kind::public_}
 The kind of day.
 
unsigned day {1}
 1-based day of a multi-day holiday (Eid's second day is 2).
 

Detailed Description

One day of a holiday in a year.

Definition at line 1681 of file countrygen.hpp.

Member Function Documentation

◆ to_json() [1/2]

std::string dasmig::holiday::to_json ( ) const
inline

This holiday as a JSON document.

Returns
Compact JSON.

Definition at line 1708 of file countrygen.hpp.

◆ to_json() [2/2]

void dasmig::holiday::to_json ( core::json_writer &  w) const
inline

Write this holiday as a JSON object, dates as YYYY-MM-DD.

Parameters
wWriter positioned where a value is allowed.

Definition at line 1693 of file countrygen.hpp.

Member Data Documentation

◆ date

std::chrono::year_month_day dasmig::holiday::date {}

The day itself.

Definition at line 1683 of file countrygen.hpp.

◆ day

unsigned dasmig::holiday::day {1}

1-based day of a multi-day holiday (Eid's second day is 2).

Definition at line 1689 of file countrygen.hpp.

◆ key

std::string dasmig::holiday::key

Stable: "christmas_day", "eid_al_fitr_holiday".

Definition at line 1685 of file countrygen.hpp.

◆ kind

holiday_kind dasmig::holiday::kind {holiday_kind::public_}

The kind of day.

Definition at line 1688 of file countrygen.hpp.

◆ name

std::string dasmig::holiday::name

In the country's language, as python-holidays writes it: "Natal".

Definition at line 1686 of file countrygen.hpp.

◆ name_en

std::string dasmig::holiday::name_en

In English: "Christmas Day".

Definition at line 1687 of file countrygen.hpp.

◆ observed

std::optional<std::chrono::year_month_day> dasmig::holiday::observed

Only when a weekend rule moves the day off.

Definition at line 1684 of file countrygen.hpp.


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