Falcon::TimeStamp Class Reference

TimeStamp class. More...

#include <timestamp.h>

Inheritance diagram for Falcon::TimeStamp:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void add (int32 days, int32 hours=0, int32 mins=0, int32 secs=0, int32 msecs=0)
void add (const TimeStamp &ts)
void changeTimezone (TimeZone tz)
 Shifts this timestamp moving the old timezone into the new one.
virtual FalconDataclone () const
int32 compare (const TimeStamp &ts) const
void copy (const TimeStamp &ts)
void currentTime ()
int16 dayOfWeek () const
 Gets the day of week.
int16 dayOfYear () const
void distance (const TimeStamp &ts)
void fromLongFormat (int64 lf)
void fromSystemTime (const SystemTime &st)
virtual void gcMark (uint32 mark)
void getTZDisplacement (int16 &hours, int16 &minutes) const
bool isLeapYear () const
bool isValid () const
bool operator!= (const TimeStamp &ts) const
TimeStampoperator+= (const TimeStamp &ts)
TimeStampoperator-= (const TimeStamp &ts)
bool operator< (const TimeStamp &ts) const
bool operator<= (const TimeStamp &ts) const
TimeStampoperator= (const TimeStamp &ts)
bool operator== (const TimeStamp &ts) const
bool operator> (const TimeStamp &ts) const
bool operator>= (const TimeStamp &ts) const
 TimeStamp (int64 lfmt)
 TimeStamp (const TimeStamp &ts)
 TimeStamp (int16 y=0, int16 M=0, int16 d=0, int16 h=0, int16 m=0, int16 s=0, int16 ms=0, TimeZone tz=tz_NONE)
int64 toLongFormat () const
String toRFC2822 (bool bSemantic=false, bool bDst=false) const
 Convert this timestamp to RFC2822 format.
bool toRFC2822 (String &target, bool bSemantic=false, bool bDst=false) const
 Convert this timestamp to RFC2822 format.
bool toString (String &target, const String &fmt) const
void toString (String &target) const
 ~TimeStamp ()

Static Public Member Functions

static bool fromRFC2822 (TimeStamp &target, const char *source)
 Parse a RFC2822 date format and configure the given timestamp.
static bool fromRFC2822 (TimeStamp &target, const String &source)
 Parse a RFC2822 date format and configure the given timestamp.
static int16 getRFC2822_Month (const char *name)
 Return numeric month from a RFC2822 format month name.
static const char * getRFC2822_MonthName (int16 wd)
 Gets a RFC 2822 timestamp compliant month name.
static int16 getRFC2822_WeekDay (const char *name)
 Return numeric weekday from a RFC2822 format weekday name.
static const char * getRFC2822_WeekDayName (int16 wd)
 Gets a RFC 2822 timestamp compliant weekday name.
static TimeZone getRFC2822_Zone (const char *csZoneName)
 Return a timezone given a RCF2822 timezone name.
static const char * getRFC2822_ZoneName (TimeZone tz, bool bSemantic=false, bool bDst=false)
 Return a RCF2822 timezone name.
static void getTZDisplacement (TimeZone tz, int16 &hours, int16 &minutes)
 Get a timezone displacement.

Public Attributes

int16 m_day
int16 m_hour
int16 m_minute
int16 m_month
int16 m_msec
int16 m_second
TimeZone m_timezone
int16 m_year

Friends

void Sys::Time::timestampFromSystemTime (const SystemTime &sys_time, TimeStamp &ts)


Detailed Description

TimeStamp class.

This class is both used as a system independent time accounting object and as a internal object for the TimeStamp falcon core object.


Constructor & Destructor Documentation

Falcon::TimeStamp::TimeStamp ( int16  y = 0,
int16  M = 0,
int16  d = 0,
int16  h = 0,
int16  m = 0,
int16  s = 0,
int16  ms = 0,
TimeZone  tz = tz_NONE 
) [inline]

Falcon::TimeStamp::TimeStamp ( const TimeStamp ts  )  [inline]

Falcon::TimeStamp::TimeStamp ( int64  lfmt  )  [inline]

Falcon::TimeStamp::~TimeStamp (  )  [inline]


Member Function Documentation

void Falcon::TimeStamp::add ( int32  days,
int32  hours = 0,
int32  mins = 0,
int32  secs = 0,
int32  msecs = 0 
)

void Falcon::TimeStamp::add ( const TimeStamp ts  ) 

Referenced by Falcon::operator+().

void Falcon::TimeStamp::changeTimezone ( TimeZone  tz  ) 

Shifts this timestamp moving the old timezone into the new one.

virtual FalconData* Falcon::TimeStamp::clone (  )  const [virtual]

Implements Falcon::FalconData.

int32 Falcon::TimeStamp::compare ( const TimeStamp ts  )  const

void Falcon::TimeStamp::copy ( const TimeStamp ts  ) 

void Falcon::TimeStamp::currentTime (  ) 

int16 Falcon::TimeStamp::dayOfWeek (  )  const

Gets the day of week.

Week starting on monday, 0 based.

int16 Falcon::TimeStamp::dayOfYear (  )  const

void Falcon::TimeStamp::distance ( const TimeStamp ts  ) 

Referenced by Falcon::operator-().

void Falcon::TimeStamp::fromLongFormat ( int64  lf  ) 

static bool Falcon::TimeStamp::fromRFC2822 ( TimeStamp target,
const char *  source 
) [static]

Parse a RFC2822 date format and configure the given timestamp.

static bool Falcon::TimeStamp::fromRFC2822 ( TimeStamp target,
const String source 
) [static]

Parse a RFC2822 date format and configure the given timestamp.

void Falcon::TimeStamp::fromSystemTime ( const SystemTime st  )  [inline]

virtual void Falcon::TimeStamp::gcMark ( uint32  mark  )  [inline, virtual]

Implements Falcon::FalconData.

static int16 Falcon::TimeStamp::getRFC2822_Month ( const char *  name  )  [static]

Return numeric month from a RFC2822 format month name.

Returns:
-1 if the name is not valid, 1-12 otherwise (january being 1).

static const char* Falcon::TimeStamp::getRFC2822_MonthName ( int16  wd  )  [static]

Gets a RFC 2822 timestamp compliant month name.

Returns:
Month name.

static int16 Falcon::TimeStamp::getRFC2822_WeekDay ( const char *  name  )  [static]

Return numeric weekday from a RFC2822 format weekday name.

Returns:
-1 if the name is not valid, 0-6 otherwise (Monday being 0).

static const char* Falcon::TimeStamp::getRFC2822_WeekDayName ( int16  wd  )  [static]

Gets a RFC 2822 timestamp compliant weekday name.

Returns:
weekday name.

static TimeZone Falcon::TimeStamp::getRFC2822_Zone ( const char *  csZoneName  )  [static]

Return a timezone given a RCF2822 timezone name.

Parameters:
csZoneName The timezone name.
Returns:
the zone, or tz_NONE if the zone didn't parse succesfully.

static const char* Falcon::TimeStamp::getRFC2822_ZoneName ( TimeZone  tz,
bool  bSemantic = false,
bool  bDst = false 
) [static]

Return a RCF2822 timezone name.

Parameters:
tz The timezone.
bSemantic return semantic zone names instead of + displacements when available.
bDst Get the DST version of the semantic zone.
Returns:
the zone name.

void Falcon::TimeStamp::getTZDisplacement ( int16 hours,
int16 minutes 
) const

static void Falcon::TimeStamp::getTZDisplacement ( TimeZone  tz,
int16 hours,
int16 minutes 
) [static]

Get a timezone displacement.

Parameters:
tz the timezone.
hours hours the displacement in hours
minutes minutes the displacement in minutes

bool Falcon::TimeStamp::isLeapYear (  )  const

bool Falcon::TimeStamp::isValid (  )  const

bool Falcon::TimeStamp::operator!= ( const TimeStamp ts  )  const [inline]

TimeStamp& Falcon::TimeStamp::operator+= ( const TimeStamp ts  )  [inline]

TimeStamp& Falcon::TimeStamp::operator-= ( const TimeStamp ts  )  [inline]

bool Falcon::TimeStamp::operator< ( const TimeStamp ts  )  const [inline]

bool Falcon::TimeStamp::operator<= ( const TimeStamp ts  )  const [inline]

TimeStamp& Falcon::TimeStamp::operator= ( const TimeStamp ts  ) 

bool Falcon::TimeStamp::operator== ( const TimeStamp ts  )  const [inline]

bool Falcon::TimeStamp::operator> ( const TimeStamp ts  )  const [inline]

bool Falcon::TimeStamp::operator>= ( const TimeStamp ts  )  const [inline]

int64 Falcon::TimeStamp::toLongFormat (  )  const

String Falcon::TimeStamp::toRFC2822 ( bool  bSemantic = false,
bool  bDst = false 
) const [inline]

Convert this timestamp to RFC2822 format.

Parameters:
bSemantic return semantic zone names instead of + displacements when available.
bDst Get the DST version of the semantic zone.
Returns:
The string converted.

bool Falcon::TimeStamp::toRFC2822 ( String target,
bool  bSemantic = false,
bool  bDst = false 
) const

Convert this timestamp to RFC2822 format.

Parameters:
target The string that will receive the converted date, or "?" in case it doesn't work.
bSemantic return semantic zone names instead of + displacements when available.
bDst Get the DST version of the semantic zone.
Returns:
false if the date is invalid.

bool Falcon::TimeStamp::toString ( String target,
const String fmt 
) const

void Falcon::TimeStamp::toString ( String target  )  const


Friends And Related Function Documentation

void Sys::Time::timestampFromSystemTime ( const SystemTime sys_time,
TimeStamp ts 
) [friend]


Member Data Documentation


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

Generated on Mon Oct 19 10:11:48 2009 for Falcon_Core by  doxygen 1.5.8