StTime Class Reference

Manage time and date. More...

#include <sttime.h>

List of all members.

Public Member Functions

 StTime ()
 StTime (time_t time)
void setTime (int year, int month, int day, int hour, int minute, int second)
void setTime (time_t time)
void setTime (tm *time)
time_t getTime ()
void setYear (int year)
void setMonth (int month)
void setDay (int day)
void setHour (int hour)
void setMin (int minute)
void setSec (int second)
int getYear () const
int getMonth () const
int getDay () const
int getHour () const
int getMin () const
int getSec () const
bool greaterThan (const StTime &otherTime)
bool lowerThan (const StTime &otherTime)
bool equal (const StTime &otherTime)
bool operator> (const StTime &otherTime)
bool operator< (const StTime &otherTime)
bool operator== (const StTime &otherTime)
int diffrence (StTime time)
void clear ()

Static Public Member Functions

static StTime getCurrentTime ()

Private Member Functions

void init ()

Private Attributes

int year
int month
int day
int hour
int min
int sec


Detailed Description

Manage time and date.

It allows you to getCurrentTime, setTime, setDate, check which time is earlier, greater or equal.


Constructor & Destructor Documentation

StTime::StTime (  )  [inline]

StTime::StTime ( time_t  time  ) 


Member Function Documentation

void StTime::clear (  )  [inline]

Set all variables to 0.

int StTime::diffrence ( StTime  time  )  [inline]

Calculate the diffrence between the time passed by argument and the time stored by class.

Returns:
Diffrence in seconds. If the time passed by argument is greater the diffrence is greater than 0, in other case in lower than 0.

bool StTime::equal ( const StTime otherTime  ) 

Compare the time stored by class with the time passed by argument.

Parameters:
otherTime - time to compare
Returns:
True if time passed by argument is equal.

StTime StTime::getCurrentTime (  )  [static]

Get the current time

int StTime::getDay (  )  const [inline]

Get the day.

int StTime::getHour (  )  const [inline]

Get the hour.

int StTime::getMin (  )  const [inline]

Get the minute.

int StTime::getMonth (  )  const [inline]

Get the month.

int StTime::getSec (  )  const [inline]

Get the second.

time_t StTime::getTime (  ) 

Get the time stored by class.

int StTime::getYear (  )  const [inline]

Get the year.

bool StTime::greaterThan ( const StTime otherTime  ) 

Compare the time stored by class with the time passed by argument.

Parameters:
otherTime - time to compare
Returns:
True if time passed by argument is greater.

void StTime::init (  )  [inline, private]

bool StTime::lowerThan ( const StTime otherTime  ) 

Compare the time stored by class with the time passed by argument.

Parameters:
otherTime - time to compare
Returns:
True if time passed by argument is lower.

bool StTime::operator< ( const StTime otherTime  )  [inline]

Same as lowerThan function

bool StTime::operator== ( const StTime otherTime  )  [inline]

Same as equal function

bool StTime::operator> ( const StTime otherTime  )  [inline]

Same as greaterThan function

void StTime::setDay ( int  day  )  [inline]

Set the day.

void StTime::setHour ( int  hour  )  [inline]

Set the hour.

void StTime::setMin ( int  minute  )  [inline]

Set the minute.

void StTime::setMonth ( int  month  )  [inline]

Set the month.

void StTime::setSec ( int  second  )  [inline]

Set the second.

void StTime::setTime ( tm *  time  ) 

void StTime::setTime ( time_t  time  ) 

void StTime::setTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second 
) [inline]

void StTime::setYear ( int  year  )  [inline]

Set the year.


Member Data Documentation

int StTime::day [private]

int StTime::hour [private]

int StTime::min [private]

int StTime::month [private]

int StTime::sec [private]

int StTime::year [private]


The documentation for this class was generated from the following files:
Generated on Tue Nov 14 21:15:10 2006 for Smart Tools Library by  doxygen 1.4.7