The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
utils::irdya_date Class Reference

Calendar for handling and comparing dates using the common epoches of the storyline. More...

#include <irdya_datetime.hpp>

Public Member Functions

 irdya_date ()=default
 
 irdya_date (wesnoth_epoch::type epoch, unsigned year)
 
wesnoth_epoch::type get_epoch () const
 
unsigned int get_year () const
 
bool is_valid () const
 
std::string to_string () const
 

Static Public Member Functions

static irdya_date read_date (const std::string &date)
 

Private Attributes

wesnoth_epoch::type epoch
 
unsigned int year = 0
 

Detailed Description

Calendar for handling and comparing dates using the common epoches of the storyline.

Definition at line 28 of file irdya_datetime.hpp.

Constructor & Destructor Documentation

◆ irdya_date() [1/2]

utils::irdya_date::irdya_date ( )
default

◆ irdya_date() [2/2]

utils::irdya_date::irdya_date ( wesnoth_epoch::type  epoch,
unsigned  year 
)
inline

Definition at line 33 of file irdya_datetime.hpp.

Member Function Documentation

◆ get_epoch()

wesnoth_epoch::type utils::irdya_date::get_epoch ( ) const
inline

Definition at line 41 of file irdya_datetime.hpp.

References epoch.

Referenced by BOOST_AUTO_TEST_CASE(), utils::operator<(), and utils::operator==().

◆ get_year()

unsigned int utils::irdya_date::get_year ( ) const
inline

Definition at line 46 of file irdya_datetime.hpp.

References year.

Referenced by BOOST_AUTO_TEST_CASE(), utils::operator<(), and utils::operator==().

◆ is_valid()

bool utils::irdya_date::is_valid ( ) const
inline

Definition at line 52 of file irdya_datetime.hpp.

References year.

Referenced by utils::operator<().

◆ read_date()

irdya_date irdya_date::read_date ( const std::string &  date)
static

◆ to_string()

std::string irdya_date::to_string ( ) const

Definition at line 53 of file irdya_datetime.cpp.

References epoch, VGETTEXT, and year.

Member Data Documentation

◆ epoch

wesnoth_epoch::type utils::irdya_date::epoch
private

Definition at line 61 of file irdya_datetime.hpp.

Referenced by get_epoch(), read_date(), and to_string().

◆ year

unsigned int utils::irdya_date::year = 0
private

Definition at line 63 of file irdya_datetime.hpp.

Referenced by get_year(), is_valid(), read_date(), and to_string().


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