AnCH Framework  0.1
Another C++ Hack Framework
Public Member Functions | Friends | List of all members
anch::date::Date Class Reference

#include <date.hpp>

Collaboration diagram for anch::date::Date:

Public Member Functions

 Date (bool init=true)
 
 Date (const Date &date)
 
 Date (const std::time_t &time)
 
 Date (const std::tm *const time)
 
virtual ~Date ()
 
bool after (const Date &date) const noexcept
 
bool before (const Date &date) const noexcept
 
bool equals (const Date &date) const noexcept
 
bool operator> (const Date &date) const noexcept
 
bool operator>= (const Date &date) const noexcept
 
bool operator< (const Date &date) const noexcept
 
bool operator<= (const Date &date) const noexcept
 
bool operator== (const Date &date) const noexcept
 
bool operator!= (const Date &date) const noexcept
 
 operator std::time_t () const noexcept
 
 operator std::tm () const noexcept
 

Friends

class formatter::IDatePartFormatter
 
class DateFormatter
 

Detailed Description

Date and time utility class.

The class implementation is thread safe (when using this class).
POSIX time management is not thread safe. This class uses POSIX implementation.
Be aware that if you use the POSIX API, you will loose the thread safe support provided in this implementation.

Author
Vincent Lachenal

Constructor & Destructor Documentation

Date::Date ( bool  init = true)

Date default constructor.

Parameters
initInitialize the Date to now (default true)
Date::Date ( const Date date)

Date private copy constructor

Parameters
dateThe Date to copy
Date::Date ( const std::time_t &  time)

Date constructor.

Parameters
timeThe time to set
Date::Date ( const std::tm *const  time)

Date constructor.

Parameters
timeThe time to set
Date::~Date ( )
virtual

Date destructor

Member Function Documentation

bool anch::date::Date::after ( const Date date) const
inlinenoexcept

Check if current Date is after another one.

Parameters
dateThe other Date
Returns
true if current Date is after the other one, false otherwise.
bool anch::date::Date::before ( const Date date) const
inlinenoexcept

Check if current Date is before another one.

Parameters
dateThe other Date
Returns
true if current Date is before the other one, false otherwise.
bool anch::date::Date::equals ( const Date date) const
inlinenoexcept

Check if current Date is equals to another one.

Parameters
dateThe other Date
Returns
true if current Date is equals to the other one, false otherwise.
anch::date::Date::operator std::time_t ( ) const
inlinenoexcept

Cast operator to std::time_t definition.

Returns
The converted std::time_t
anch::date::Date::operator std::tm ( ) const
inlinenoexcept

Cast operator to std::tm definition.

Returns
The converted std::tm
bool anch::date::Date::operator!= ( const Date date) const
inlinenoexcept

'!=' operator definition. Calls equals method

Parameters
dateThe date to compare to
bool anch::date::Date::operator< ( const Date date) const
inlinenoexcept

'<' operator definition. Calls before method

Parameters
dateThe date to compare to
bool anch::date::Date::operator<= ( const Date date) const
inlinenoexcept

'<=' operator definition. Calls before and equals methods

Parameters
dateThe date to compare to
bool anch::date::Date::operator== ( const Date date) const
inlinenoexcept

'==' operator definition. Calls equals method

Parameters
dateThe date to compare to
bool anch::date::Date::operator> ( const Date date) const
inlinenoexcept

'>' operator definition. Calls after method

Parameters
dateThe date to compare to
bool anch::date::Date::operator>= ( const Date date) const
inlinenoexcept

'>=' operator definition. Calls after and equals methods

Parameters
dateThe date to compare to

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