Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
Datetime Class Reference

The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. More...

#include <numbers.h>

Inheritance diagram for Datetime:
Inheritance graph
[legend]
Collaboration diagram for Datetime:
Collaboration graph
[legend]

Public Member Functions

 Datetime (time_t tm)
 
 Datetime (tm *dt)
 
 Datetime (const char *str, size_t size=0)
 
 Datetime (int year, unsigned month, unsigned day, int hour, int minute, int second)
 
 Datetime ()
 
virtual ~Datetime ()
 
char * getDatetime (char *buffer) const
 
time_t getDatetime (void) const
 
bool isValid (void) const
 
Datetimeoperator= (const Datetime datetime)
 
Datetimeoperator+= (const Datetime &datetime)
 
Datetimeoperator-= (const Datetime &datetime)
 
Datetimeoperator+= (const Time &time)
 
Datetimeoperator-= (const Time &time)
 
int operator== (const Datetime &)
 
int operator!= (const Datetime &)
 
int operator< (const Datetime &)
 
int operator<= (const Datetime &)
 
int operator> (const Datetime &)
 
int operator>= (const Datetime &)
 
bool operator! () const
 
String strftime (const char *format) const
 
int getYear (void) const
 
unsigned getMonth (void) const
 
unsigned getDay (void) const
 
unsigned getDayOfWeek (void) const
 
char * getDate (char *buffer) const
 
time_t getDate (void) const
 
time_t getDate (tm *buf) const
 
long getValue (void) const
 
void setDate (const char *str, size_t size=0)
 
 operator long () const
 
String operator() () const
 
Dateoperator++ ()
 
Dateoperator-- ()
 
Dateoperator+= (const long val)
 
Dateoperator-= (const long val)
 
int operator== (const Date &date)
 
int operator!= (const Date &date)
 
int operator< (const Date &date)
 
int operator<= (const Date &date)
 
int operator> (const Date &date)
 
int operator>= (const Date &date)
 
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)
 
 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)
 

Protected Member Functions

void toJulian (long year, long month, long day)
 
void fromJulian (char *buf) const
 
virtual void update (void)
 A method to use to "post" any changed values when shadowing a mixed object class. More...
 
void toSeconds (int hour, int minute, int second)
 
void fromSeconds (char *buf) const
 
virtual void update (void)
 

Protected Attributes

long julian
 
long seconds
 

Detailed Description

The Datetime class uses a julian date representation of the current year, month, and day and 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.

Definition at line 278 of file numbers.h.

Constructor & Destructor Documentation

Datetime::Datetime ( time_t  tm)
Datetime::Datetime ( tm *  dt)
Datetime::Datetime ( const char *  str,
size_t  size = 0 
)
Datetime::Datetime ( int  year,
unsigned  month,
unsigned  day,
int  hour,
int  minute,
int  second 
)
Datetime::Datetime ( )
virtual Datetime::~Datetime ( )
virtual

Member Function Documentation

void Date::fromJulian ( char *  buf) const
protectedinherited
void Time::fromSeconds ( char *  buf) const
protectedinherited
char* Date::getDate ( char *  buffer) const
inherited
time_t Date::getDate ( void  ) const
inherited
time_t Date::getDate ( tm *  buf) const
inherited
char* Datetime::getDatetime ( char *  buffer) const
time_t Datetime::getDatetime ( void  ) const
unsigned Date::getDay ( void  ) const
inherited
unsigned Date::getDayOfWeek ( void  ) const
inherited
int Time::getHour ( void  ) const
inherited
int Time::getMinute ( void  ) const
inherited
unsigned Date::getMonth ( void  ) const
inherited
int Time::getSecond ( void  ) const
inherited
char* Time::getTime ( char *  buffer) const
inherited
time_t Time::getTime ( void  ) const
inherited
tm* Time::getTime ( tm *  buf) const
inherited
long Date::getValue ( void  ) const
inherited
long Time::getValue ( void  ) const
inherited
int Date::getYear ( void  ) const
inherited
bool Datetime::isValid ( void  ) const
Date::operator long ( ) const
inlineinherited

Definition at line 188 of file numbers.h.

Time::operator long ( )
inlineinherited

Definition at line 250 of file numbers.h.

bool Datetime::operator! ( ) const
int Date::operator!= ( const Date date)
inherited
int Time::operator!= ( const Time time)
inherited
int Datetime::operator!= ( const Datetime )
String Date::operator() ( ) const
inherited
String Time::operator() ( ) const
inherited
Date& Date::operator++ ( )
inherited
Time& Time::operator++ ( )
inherited
Date& Date::operator+= ( const long  val)
inherited
Time& Time::operator+= ( const int  val)
inherited
Datetime& Datetime::operator+= ( const Datetime datetime)
Datetime& Datetime::operator+= ( const Time time)
Date& Date::operator-- ( )
inherited
Time& Time::operator-- ( )
inherited
Date& Date::operator-= ( const long  val)
inherited
Time& Time::operator-= ( const int  val)
inherited
Datetime& Datetime::operator-= ( const Datetime datetime)
Datetime& Datetime::operator-= ( const Time time)
int Date::operator< ( const Date date)
inherited
int Time::operator< ( const Time time)
inherited
int Datetime::operator< ( const Datetime )
int Date::operator<= ( const Date date)
inherited
int Time::operator<= ( const Time time)
inherited
int Datetime::operator<= ( const Datetime )
Datetime& Datetime::operator= ( const Datetime  datetime)
int Date::operator== ( const Date date)
inherited
int Time::operator== ( const Time time)
inherited
int Datetime::operator== ( const Datetime )
int Date::operator> ( const Date date)
inherited
int Time::operator> ( const Time time)
inherited
int Datetime::operator> ( const Datetime )
int Date::operator>= ( const Date date)
inherited
int Time::operator>= ( const Time time)
inherited
int Datetime::operator>= ( const Datetime )
void Date::setDate ( const char *  str,
size_t  size = 0 
)
inherited
void Time::setTime ( char *  str,
size_t  size = 0 
)
inherited
String Datetime::strftime ( const char *  format) const
void Date::toJulian ( long  year,
long  month,
long  day 
)
protectedinherited
void Time::toSeconds ( int  hour,
int  minute,
int  second 
)
protectedinherited
virtual void Date::update ( void  )
protectedvirtualinherited

A method to use to "post" any changed values when shadowing a mixed object class.

This is used by DateNumber.

Reimplemented in DateNumber.

virtual void Time::update ( void  )
protectedvirtualinherited

Field Documentation

long Date::julian
protectedinherited

Definition at line 151 of file numbers.h.

long Time::seconds
protectedinherited

Definition at line 218 of file numbers.h.


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