GNU CommonC++
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ost::Time Class Reference

The Time class uses a integer representation of the current time. More...

#include <numbers.h>

Inheritance diagram for ost::Time:
ost::Datetime

Public Member Functions

 Time (time_t tm)
 
 Time (tm *dt)
 
 Time (char *str, size_t size=0)
 
 Time (int hour, int minute, int second)
 
 Time ()
 
virtual ~Time ()
 
long getValue (void) const
 
int getHour (void) const
 
int getMinute (void) const
 
int getSecond (void) const
 
char * getTime (char *buffer) const
 
time_t getTime (void) const
 
tm * getTime (tm *buf) const
 
void setTime (char *str, size_t size=0)
 
bool isValid (void) const
 
 operator long ()
 
String operator() () const
 
Timeoperator++ ()
 
Timeoperator-- ()
 
Timeoperator+= (const int val)
 
Timeoperator-= (const int val)
 
int operator== (const Time &time)
 
int operator!= (const Time &time)
 
int operator< (const Time &time)
 
int operator<= (const Time &time)
 
int operator> (const Time &time)
 
int operator>= (const Time &time)
 
bool operator! () const
 

Protected Member Functions

void toSeconds (int hour, int minute, int second)
 
void fromSeconds (char *buf) const
 
virtual void update (void)
 

Protected Attributes

long seconds
 

Friends

Time operator+ (const Time &time1, const Time &time2)
 
Time operator- (const Time &time1, const Time &time2)
 
Time operator+ (const Time &time, const int val)
 
Time operator- (const Time &time, const int val)
 
Time operator+ (const int val, const Time &time)
 
Time operator- (const int val, const Time &time)
 

Detailed Description

The Time class uses a integer representation of the current time.

This is then manipulated in several forms and may be exported as needed.

Author
Marcelo Dalmas mad@b.nosp@m.rasm.nosp@m.ap.co.nosp@m.m.br

Integer based time class.

Constructor & Destructor Documentation

◆ Time() [1/5]

ost::Time::Time ( time_t  tm)

◆ Time() [2/5]

ost::Time::Time ( tm *  dt)

◆ Time() [3/5]

ost::Time::Time ( char *  str,
size_t  size = 0 
)

◆ Time() [4/5]

ost::Time::Time ( int  hour,
int  minute,
int  second 
)

◆ Time() [5/5]

ost::Time::Time ( )

◆ ~Time()

virtual ost::Time::~Time ( )
virtual

Member Function Documentation

◆ fromSeconds()

void ost::Time::fromSeconds ( char *  buf) const
protected

◆ getHour()

int ost::Time::getHour ( void  ) const

◆ getMinute()

int ost::Time::getMinute ( void  ) const

◆ getSecond()

int ost::Time::getSecond ( void  ) const

◆ getTime() [1/3]

char* ost::Time::getTime ( char *  buffer) const

◆ getTime() [2/3]

tm* ost::Time::getTime ( tm *  buf) const

◆ getTime() [3/3]

time_t ost::Time::getTime ( void  ) const

◆ getValue()

long ost::Time::getValue ( void  ) const

◆ isValid()

bool ost::Time::isValid ( void  ) const

◆ operator long()

ost::Time::operator long ( )
inline

◆ operator!()

bool ost::Time::operator! ( ) const
inline

◆ operator!=()

int ost::Time::operator!= ( const Time time)

◆ operator()()

String ost::Time::operator() ( ) const

◆ operator++()

Time& ost::Time::operator++ ( )

◆ operator+=()

Time& ost::Time::operator+= ( const int  val)

◆ operator--()

Time& ost::Time::operator-- ( )

◆ operator-=()

Time& ost::Time::operator-= ( const int  val)

◆ operator<()

int ost::Time::operator< ( const Time time)

◆ operator<=()

int ost::Time::operator<= ( const Time time)

◆ operator==()

int ost::Time::operator== ( const Time time)

◆ operator>()

int ost::Time::operator> ( const Time time)

◆ operator>=()

int ost::Time::operator>= ( const Time time)

◆ setTime()

void ost::Time::setTime ( char *  str,
size_t  size = 0 
)

◆ toSeconds()

void ost::Time::toSeconds ( int  hour,
int  minute,
int  second 
)
protected

◆ update()

virtual void ost::Time::update ( void  )
protectedvirtual

Friends And Related Function Documentation

◆ operator+ [1/3]

Time operator+ ( const int  val,
const Time time 
)
friend

◆ operator+ [2/3]

Time operator+ ( const Time time,
const int  val 
)
friend

◆ operator+ [3/3]

Time operator+ ( const Time time1,
const Time time2 
)
friend

◆ operator- [1/3]

Time operator- ( const int  val,
const Time time 
)
friend

◆ operator- [2/3]

Time operator- ( const Time time,
const int  val 
)
friend

◆ operator- [3/3]

Time operator- ( const Time time1,
const Time time2 
)
friend

Member Data Documentation

◆ seconds

long ost::Time::seconds
protected

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