GNU CommonC++
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]

◆ 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

Referenced by operator long().

◆ isValid()

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

Referenced by operator!().

◆ operator long()

ost::Time::operator long ( )
inline

References getValue().

◆ operator!()

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

References isValid().

◆ operator!=()

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

References Time().

◆ operator()()

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

◆ operator++()

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

References Time().

◆ operator+=()

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

References Time().

◆ operator--()

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

References Time().

◆ operator-=()

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

References Time().

◆ operator<()

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

References Time().

◆ operator<=()

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

References Time().

◆ operator==()

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

References Time().

◆ operator>()

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

References Time().

◆ operator>=()

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

References 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

◆ operator+ [1/3]

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

References Time().

◆ operator+ [2/3]

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

References Time().

◆ operator+ [3/3]

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

References Time().

◆ operator- [1/3]

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

References Time().

◆ operator- [2/3]

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

References Time().

◆ operator- [3/3]

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

References Time().

Member Data Documentation

◆ seconds

long ost::Time::seconds
protected

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