libcommonc++  0.7
Time Class Reference

A representation of a clock time. More...

#include <Time.h++>

Inheritance diagram for Time:

Public Member Functions

 Time ()
 Construct a new Time initialized to 0:00:00:000. More...
 
 Time (uint_t hour, uint_t minute, uint_t second=0, uint_t msec=0)
 Construct a new Time with the given components. More...
 
 Time (const Time &other)
 Copy constructor. More...
 
virtual ~Time ()
 Destructor. More...
 
void setHour (uint_t hour)
 Set the hour component of the time. More...
 
void setHour12 (uint_t hour, bool pm=false)
 Set the hour component of the time (12-hour clock). More...
 
void setMinute (uint_t minute)
 Set the minute component of the time. More...
 
void setSecond (uint_t second)
 Set the second component of the time. More...
 
void setMillisecond (uint_t msec)
 Set the millisecond component of the time. More...
 
void setTime (uint_t hour, uint_t minute, uint_t second=0, uint_t msec=0)
 Set the hour, minute, second, and millisecond components of the time. More...
 
uint_t getHour () const
 Get the hour component of the time. More...
 
uint_t getHour12 () const
 Get the hour component of the time (12-hour clock). More...
 
bool isPM () const
 Test if the hour is post meridiem. More...
 
bool isAM () const
 Test if the hour is ante meridiem. More...
 
uint_t getMinute () const
 Get the minute component of the time. More...
 
uint_t getSecond () const
 Get the second component of the time. More...
 
uint_t getMillisecond () const
 Get the millisecond component of the time. More...
 
bool operator== (const Time &other) const
 
bool operator< (const Time &other) const
 
bool operator<= (const Time &other) const
 
bool operator!= (const Time &other) const
 
bool operator> (const Time &other) const
 
bool operator>= (const Time &other) const
 
Timeoperator= (const Time &other)
 

Detailed Description

A representation of a clock time.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ Time() [1/3]

Time ( )

Construct a new Time initialized to 0:00:00:000.

◆ Time() [2/3]

Time ( uint_t  hour,
uint_t  minute,
uint_t  second = 0,
uint_t  msec = 0 
)

Construct a new Time with the given components.

◆ Time() [3/3]

Time ( const Time other)

Copy constructor.

◆ ~Time()

~Time ( )
virtual

Destructor.

Member Function Documentation

◆ getHour()

uint_t getHour ( ) const
inline

Get the hour component of the time.

◆ getHour12()

uint_t getHour12 ( ) const
inline

Get the hour component of the time (12-hour clock).

◆ getMillisecond()

uint_t getMillisecond ( ) const
inline

Get the millisecond component of the time.

◆ getMinute()

uint_t getMinute ( ) const
inline

Get the minute component of the time.

◆ getSecond()

uint_t getSecond ( ) const
inline

Get the second component of the time.

◆ isAM()

bool isAM ( ) const
inline

Test if the hour is ante meridiem.

◆ isPM()

bool isPM ( ) const
inline

Test if the hour is post meridiem.

◆ operator!=()

bool operator!= ( const Time other) const
inline

◆ operator<()

bool operator< ( const Time other) const

◆ operator<=()

bool operator<= ( const Time other) const

◆ operator=()

Time & operator= ( const Time other)

◆ operator==()

bool operator== ( const Time other) const

◆ operator>()

bool operator> ( const Time other) const
inline

◆ operator>=()

bool operator>= ( const Time other) const
inline

◆ setHour()

void setHour ( uint_t  hour)

Set the hour component of the time.

◆ setHour12()

void setHour12 ( uint_t  hour,
bool  pm = false 
)

Set the hour component of the time (12-hour clock).

◆ setMillisecond()

void setMillisecond ( uint_t  msec)

Set the millisecond component of the time.

◆ setMinute()

void setMinute ( uint_t  minute)

Set the minute component of the time.

◆ setSecond()

void setSecond ( uint_t  second)

Set the second component of the time.

◆ setTime()

void setTime ( uint_t  hour,
uint_t  minute,
uint_t  second = 0,
uint_t  msec = 0 
)

Set the hour, minute, second, and millisecond components of the time.


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