xvr2::Date Class Reference

#include <Date.h>

Inheritance diagram for xvr2::Date:

Inheritance graph
[legend]

List of all members.


Detailed Description

This class implements the basic date/time handling facilities.

Definition at line 26 of file Date.h.


Public Types

enum  DateAMPM { AM, PM }
enum  DateARITHParts { DAYS, HOURS, MINUTES, SECONDS }

Public Member Functions

 Date ()
 Default constructor, this will initialize the value of unixtime.
 Date (UInt32 __unixtime)
 This constructor will initialize every member to its unixtime equivalent.
 Date (int __y, int __m, int __dw, int __dm, int __h, int __mi, int __s=0)
 This will initialize every one of this class members to the following values:
year: __y
month: __m
day of week: __dw
day of month: __dm
hour: __h
minute: __mi
second: __s.
 Date (const char *format, const char *date_text)
 By calling this constructor you'll be able to initialize a Date object from a string with the specified format.
 Date (const String &format, const String &date_text)
 By calling this constructor you'll be able to initialize a Date object from a string with the specified format.
 Date (const Date &d)
 Date (const Date *d)
virtual ~Date ()
Dateoperator= (const Date &_d)
virtual time_t getCurrentTime ()
 This method will update the value of unixtime and all the other broken-time values.
const UInt32 unixTime ()
 This methid will give you the numeric representation of the date in the unix time format.
const UInt32 unixTime () const
virtual std::string toString ()
 This will convert the current date object to the following format: YYYY-MM-DD HH:MM:SS.
virtual void add (DateARITHParts component, int value)
virtual const char * getClassName ()
 Returns the name of the current class.

Static Public Member Functions

static Date Now ()
static void usleep (UInt32 usec)
 This will return how many CPUs are installed in the system.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Public Attributes

int hour
 This member stores the hour 0-23.
int hr12hour
 This member will show the hour using non-24hr format.
int minute
 This member stores the minute 0-59.
int second
 This member stores the second 0-59.
int dayofweek
 This member stores the day of the week e.g Monday, Tuesday, Wednesday.
int dayofyear
 This member stores the days elapsed since january first of the current year.
int dayofmonth
 This member stores the day of the month 1-31.
int month
 This member stores the month 1-12.
int year
 This member stores the year 1960 - ????
int hr12ampm
 This member knows whether the timing is AM or PM.

Protected Member Functions

void setTStamp (UInt32 tstamp)
 This member holds the String representation of the current Date.
void decode (const char *format, const char *date_text)
virtual void encode ()

Protected Attributes

time_t unixtime
 This variable stores the time queried by getCurrentTime();.
std::string * string_representation
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Member Enumeration Documentation

Enumerator:
AM 
PM 

Definition at line 38 of file Date.h.

Enumerator:
DAYS 
HOURS 
MINUTES 
SECONDS 

Definition at line 42 of file Date.h.


Constructor & Destructor Documentation

xvr2::Date::Date (  ) 

Default constructor, this will initialize the value of unixtime.

xvr2::Date::Date ( UInt32  __unixtime  ) 

This constructor will initialize every member to its unixtime equivalent.

Unixtime is the number of seconds since January 1st 1970

xvr2::Date::Date ( int  __y,
int  __m,
int  __dw,
int  __dm,
int  __h,
int  __mi,
int  __s = 0 
)

This will initialize every one of this class members to the following values:
year: __y
month: __m
day of week: __dw
day of month: __dm
hour: __h
minute: __mi
second: __s.

xvr2::Date::Date ( const char *  format,
const char *  date_text 
)

By calling this constructor you'll be able to initialize a Date object from a string with the specified format.

This method makes use of the strptime(3) C function, for more information on the format string read the manpage for strptime.

Parameters:
format The format as a valid strptime format string
date_text The date as a string matching the given format

xvr2::Date::Date ( const String format,
const String date_text 
)

By calling this constructor you'll be able to initialize a Date object from a string with the specified format.

This method makes use of the strptime(3) C function, for more information on the format string read the manpage for strptime.

Parameters:
format The format as a valid strptime format string
date_text The date as a string matching the given format

xvr2::Date::Date ( const Date d  ) 

xvr2::Date::Date ( const Date d  ) 

virtual xvr2::Date::~Date (  )  [virtual]


Member Function Documentation

void xvr2::Date::setTStamp ( UInt32  tstamp  )  [protected]

This member holds the String representation of the current Date.

void xvr2::Date::decode ( const char *  format,
const char *  date_text 
) [protected]

virtual void xvr2::Date::encode (  )  [protected, virtual]

Reimplemented in xvr2::Time.

Date& xvr2::Date::operator= ( const Date _d  ) 

virtual time_t xvr2::Date::getCurrentTime (  )  [virtual]

This method will update the value of unixtime and all the other broken-time values.

const UInt32 xvr2::Date::unixTime (  ) 

This methid will give you the numeric representation of the date in the unix time format.

const UInt32 xvr2::Date::unixTime (  )  const

virtual std::string xvr2::Date::toString (  )  [virtual]

This will convert the current date object to the following format: YYYY-MM-DD HH:MM:SS.

Reimplemented from xvr2::Object.

virtual void xvr2::Date::add ( DateARITHParts  component,
int  value 
) [virtual]

static Date xvr2::Date::Now (  )  [static]

static void xvr2::System::usleep ( UInt32  usec  )  [static, inherited]

This will return how many CPUs are installed in the system.

This will return the CPU speed in megahertz Will return the total amount of system memory Will return the total amount of free system memory Will freeze the software for usec microseconds

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

time_t xvr2::Date::unixtime [protected]

This variable stores the time queried by getCurrentTime();.

Definition at line 29 of file Date.h.

std::string* xvr2::Date::string_representation [protected]

Definition at line 36 of file Date.h.

This member stores the hour 0-23.

Definition at line 49 of file Date.h.

This member will show the hour using non-24hr format.

Definition at line 51 of file Date.h.

This member stores the minute 0-59.

Definition at line 53 of file Date.h.

This member stores the second 0-59.

Definition at line 55 of file Date.h.

This member stores the day of the week e.g Monday, Tuesday, Wednesday.

..

Definition at line 57 of file Date.h.

This member stores the days elapsed since january first of the current year.

Definition at line 59 of file Date.h.

This member stores the day of the month 1-31.

Definition at line 61 of file Date.h.

This member stores the month 1-12.

Definition at line 63 of file Date.h.

This member stores the year 1960 - ????

Definition at line 65 of file Date.h.

This member knows whether the timing is AM or PM.

Definition at line 67 of file Date.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:53 2008 for X-VR2 SDK by  doxygen 1.5.5