G::Time Class Reference

A simple time-of-day (hh/mm/ss) class. More...

#include <gtime.h>

List of all members.

Public Member Functions

 Time ()
 Constructor, using UTC, for now.
 Time (const G::DateTime::BrokenDownTime &tm)
 Constructor for the given broken-down time.
 Time (G::DateTime::EpochTime t)
 Constructor, using UTC, for the given epoch time.
 Time (G::DateTime::EpochTime t, const LocalTime &)
 Constructor, using the local timezone, for the given epoch time.
 Time (const LocalTime &)
 Localtime constructor for now.
unsigned int hours () const
 Returns the hours (0 <= h < 24).
unsigned int minutes () const
 Returns the minutes (0 <= m < 60).
unsigned int seconds () const
 Returns the seconds (0 <= s <= 61 [sic]).
std::string hhmmss (const char *sep=NULL) const
 Returns a hhmmss string.
std::string hhmm (const char *sep=NULL) const
 Returns a hhmm string.
std::string ss () const
 Returns the seconds as a two-digit decimal seconds.

Classes

class  LocalTime
 An overload discriminator class for Time constructors. More...


Detailed Description

A simple time-of-day (hh/mm/ss) class.

See also:
G::Date, G::DateTime

Definition at line 39 of file gtime.h.


Constructor & Destructor Documentation

G::Time::Time (  ) 

Constructor, using UTC, for now.

Definition at line 33 of file gtime.cpp.

References G::DateTime::now(), and G::DateTime::utc().

G::Time::Time ( const G::DateTime::BrokenDownTime tm  )  [explicit]

Constructor for the given broken-down time.

Definition at line 26 of file gtime.cpp.

G::Time::Time ( G::DateTime::EpochTime  t  )  [explicit]

Constructor, using UTC, for the given epoch time.

Definition at line 41 of file gtime.cpp.

References G::DateTime::utc().

G::Time::Time ( G::DateTime::EpochTime  t,
const LocalTime  
)

Constructor, using the local timezone, for the given epoch time.

Definition at line 57 of file gtime.cpp.

References G::DateTime::local().

G::Time::Time ( const LocalTime  )  [explicit]

Localtime constructor for now.

Definition at line 49 of file gtime.cpp.

References G::DateTime::local(), and G::DateTime::now().


Member Function Documentation

unsigned int G::Time::hours (  )  const

Returns the hours (0 <= h < 24).

Definition at line 65 of file gtime.cpp.

unsigned int G::Time::minutes (  )  const

Returns the minutes (0 <= m < 60).

Definition at line 70 of file gtime.cpp.

unsigned int G::Time::seconds (  )  const

Returns the seconds (0 <= s <= 61 [sic]).

Definition at line 75 of file gtime.cpp.

std::string G::Time::hhmmss ( const char *  sep = NULL  )  const

Returns a hhmmss string.

Definition at line 80 of file gtime.cpp.

References ss().

Referenced by GSmtp::ServerProtocolText::receivedLine().

std::string G::Time::hhmm ( const char *  sep = NULL  )  const

Returns a hhmm string.

Definition at line 88 of file gtime.cpp.

References ss().

std::string G::Time::ss (  )  const

Returns the seconds as a two-digit decimal seconds.

Definition at line 96 of file gtime.cpp.

Referenced by hhmm(), and hhmmss().


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5