TrinityCore
WowTime Class Reference

#include <WowTime.h>

Public Member Functions

uint32 GetPackedTime () const
 
void SetPackedTime (uint32 packedTime)
 
std::time_t GetUnixTimeFromUtcTime () const
 
void SetUtcTimeFromUnixTime (std::time_t unixTime)
 
int32 GetYear () const
 
void SetYear (int32 year)
 
int8 GetMonth () const
 
void SetMonth (int8 month)
 
int8 GetMonthDay () const
 
void SetMonthDay (int8 monthDay)
 
int8 GetWeekDay () const
 
void SetWeekDay (int8 weekDay)
 
int8 GetHour () const
 
void SetHour (int8 hour)
 
int8 GetMinute () const
 
void SetMinute (int8 minute)
 
int8 GetFlags () const
 
void SetFlags (int8 flags)
 
int8 GetHolidayOffset () const
 
void SetHolidayOffset (int8 holidayOffset)
 
bool IsInRange (WowTime const &from, WowTime const &to) const
 
WowTimeoperator+= (Seconds seconds)
 
WowTime operator+ (Seconds seconds) const
 
WowTimeoperator-= (Seconds seconds)
 
WowTime operator- (Seconds seconds) const
 

Private Attributes

int32 _year = -1
 
int8 _month = -1
 
int8 _monthDay = -1
 
int8 _weekDay = -1
 
int8 _hour = -1
 
int8 _minute = -1
 
int8 _flags = -1
 
int8 _holidayOffset = 0
 

Friends

TC_GAME_API std::strong_ordering operator<=> (WowTime const &left, WowTime const &right)
 
TC_GAME_API bool operator== (WowTime const &left, WowTime const &right)
 
TC_GAME_API ByteBufferoperator<< (ByteBuffer &data, WowTime const &wowTime)
 
TC_GAME_API ByteBufferoperator>> (ByteBuffer &data, WowTime &wowTime)
 

Detailed Description

Definition at line 29 of file WowTime.h.

Member Function Documentation

◆ GetFlags()

int8 WowTime::GetFlags ( ) const
inline

Definition at line 56 of file WowTime.h.

◆ GetHolidayOffset()

int8 WowTime::GetHolidayOffset ( ) const
inline

Definition at line 59 of file WowTime.h.

◆ GetHour()

int8 WowTime::GetHour ( ) const
inline

Definition at line 50 of file WowTime.h.

◆ GetMinute()

int8 WowTime::GetMinute ( ) const
inline

Definition at line 53 of file WowTime.h.

◆ GetMonth()

int8 WowTime::GetMonth ( ) const
inline

Definition at line 41 of file WowTime.h.

◆ GetMonthDay()

int8 WowTime::GetMonthDay ( ) const
inline

Definition at line 44 of file WowTime.h.

◆ GetPackedTime()

uint32 WowTime::GetPackedTime ( ) const

Definition at line 23 of file WowTime.cpp.

+ Here is the caller graph for this function:

◆ GetUnixTimeFromUtcTime()

std::time_t WowTime::GetUnixTimeFromUtcTime ( ) const

Definition at line 65 of file WowTime.cpp.

+ Here is the caller graph for this function:

◆ GetWeekDay()

int8 WowTime::GetWeekDay ( ) const
inline

Definition at line 47 of file WowTime.h.

◆ GetYear()

int32 WowTime::GetYear ( ) const
inline

Definition at line 38 of file WowTime.h.

◆ IsInRange()

bool WowTime::IsInRange ( WowTime const &  from,
WowTime const &  to 
) const

Definition at line 173 of file WowTime.cpp.

+ Here is the caller graph for this function:

◆ operator+()

WowTime WowTime::operator+ ( Seconds  seconds) const

Definition at line 189 of file WowTime.cpp.

◆ operator+=()

WowTime & WowTime::operator+= ( Seconds  seconds)

Definition at line 181 of file WowTime.cpp.

+ Here is the call graph for this function:

◆ operator-()

WowTime WowTime::operator- ( Seconds  seconds) const

Definition at line 202 of file WowTime.cpp.

◆ operator-=()

WowTime & WowTime::operator-= ( Seconds  seconds)

Definition at line 194 of file WowTime.cpp.

+ Here is the call graph for this function:

◆ SetFlags()

void WowTime::SetFlags ( int8  flags)

Definition at line 136 of file WowTime.cpp.

◆ SetHolidayOffset()

void WowTime::SetHolidayOffset ( int8  holidayOffset)
inline

Definition at line 60 of file WowTime.h.

◆ SetHour()

void WowTime::SetHour ( int8  hour)

Definition at line 124 of file WowTime.cpp.

◆ SetMinute()

void WowTime::SetMinute ( int8  minute)

Definition at line 130 of file WowTime.cpp.

◆ SetMonth()

void WowTime::SetMonth ( int8  month)

Definition at line 106 of file WowTime.cpp.

◆ SetMonthDay()

void WowTime::SetMonthDay ( int8  monthDay)

Definition at line 112 of file WowTime.cpp.

◆ SetPackedTime()

void WowTime::SetPackedTime ( uint32  packedTime)

Definition at line 34 of file WowTime.cpp.

+ Here is the caller graph for this function:

◆ SetUtcTimeFromUnixTime()

void WowTime::SetUtcTimeFromUnixTime ( std::time_t  unixTime)

Definition at line 86 of file WowTime.cpp.

+ Here is the caller graph for this function:

◆ SetWeekDay()

void WowTime::SetWeekDay ( int8  weekDay)

Definition at line 118 of file WowTime.cpp.

◆ SetYear()

void WowTime::SetYear ( int32  year)

Definition at line 100 of file WowTime.cpp.

Friends And Related Function Documentation

◆ operator<<

TC_GAME_API ByteBuffer & operator<< ( ByteBuffer data,
WowTime const &  wowTime 
)
friend

Definition at line 207 of file WowTime.cpp.

◆ operator<=>

TC_GAME_API std::strong_ordering operator<=> ( WowTime const &  left,
WowTime const &  right 
)
friend

Definition at line 142 of file WowTime.cpp.

◆ operator==

TC_GAME_API bool operator== ( WowTime const &  left,
WowTime const &  right 
)
friend

Definition at line 63 of file WowTime.h.

◆ operator>>

TC_GAME_API ByteBuffer & operator>> ( ByteBuffer data,
WowTime wowTime 
)
friend

Definition at line 213 of file WowTime.cpp.

Member Data Documentation

◆ _flags

int8 WowTime::_flags = -1
private

Definition at line 86 of file WowTime.h.

◆ _holidayOffset

int8 WowTime::_holidayOffset = 0
private

Definition at line 87 of file WowTime.h.

◆ _hour

int8 WowTime::_hour = -1
private

Definition at line 84 of file WowTime.h.

◆ _minute

int8 WowTime::_minute = -1
private

Definition at line 85 of file WowTime.h.

◆ _month

int8 WowTime::_month = -1
private

Definition at line 81 of file WowTime.h.

◆ _monthDay

int8 WowTime::_monthDay = -1
private

Definition at line 82 of file WowTime.h.

◆ _weekDay

int8 WowTime::_weekDay = -1
private

Definition at line 83 of file WowTime.h.

◆ _year

int32 WowTime::_year = -1
private

Definition at line 80 of file WowTime.h.


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