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

#include <irdya_datetime.hpp>

Public Member Functions

 MAKE_ENUM (EPOCH,(BEFORE_WESNOTH, "BW")(WESNOTH, "YW")(BEFORE_FALL, "BF")(AFTER_FALL, "AF")) irdya_date()=default
 
 irdya_date (EPOCH epoch, unsigned year)
 
EPOCH 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

EPOCH epoch
 
unsigned int year = 0
 

Detailed Description

Definition at line 22 of file irdya_datetime.hpp.

Constructor & Destructor Documentation

◆ irdya_date()

irdya_date::irdya_date ( EPOCH  epoch,
unsigned  year 
)
inline

Definition at line 29 of file irdya_datetime.hpp.

References read_date().

Member Function Documentation

◆ get_epoch()

EPOCH irdya_date::get_epoch ( ) const
inline

Definition at line 37 of file irdya_datetime.hpp.

References epoch.

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

◆ get_year()

unsigned int irdya_date::get_year ( ) const
inline

Definition at line 42 of file irdya_datetime.hpp.

References year.

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

◆ is_valid()

bool irdya_date::is_valid ( ) const
inline

Definition at line 48 of file irdya_datetime.hpp.

References to_string(), and year.

Referenced by operator<().

◆ MAKE_ENUM()

irdya_date::MAKE_ENUM ( EPOCH  ,
(BEFORE_WESNOTH, "BW")(WESNOTH, "YW")(BEFORE_FALL, "BF")(AFTER_FALL, "AF")   
)
default

◆ read_date()

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

Definition at line 22 of file irdya_datetime.cpp.

References epoch, and year.

Referenced by BOOST_AUTO_TEST_CASE(), ng::campaign::campaign(), and irdya_date().

◆ to_string()

std::string irdya_date::to_string ( ) const

Definition at line 52 of file irdya_datetime.cpp.

References epoch, VGETTEXT, and year.

Referenced by is_valid(), and operator<<().

Member Data Documentation

◆ epoch

EPOCH irdya_date::epoch
private

Definition at line 57 of file irdya_datetime.hpp.

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

◆ year

unsigned int irdya_date::year = 0
private

Definition at line 59 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: