tbx  0.7.3
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tbx::UTCTime Class Reference

Class to handle the 5 byte times. More...

#include <path.h>

Public Member Functions

 UTCTime ()
 Construct UTC time for Midnight, 1st Jan 1990.
 
 UTCTime (long long csecs)
 Construct a UTC time for the given number of centiseconds. More...
 
 UTCTime (unsigned int loadAddress, unsigned int execAddress)
 Construct a UTC time give file system catalog information. More...
 
 UTCTime (const UTCTime &other)
 Copy constructor. More...
 
UTCTimeoperator= (const UTCTime &other)
 Assign to value fo another UTCTime. More...
 
std::string text () const
 Get time/date as text in standard format. More...
 
std::string text (const std::string &format) const
 Get time/date as text in specified format. More...
 
unsigned int low_word () const
 Get the low 4 bytes of the UTC time. More...
 
unsigned char high_byte () const
 Get the high byte of the UTC time. More...
 
long long centiseconds () const
 Get the UTC time as centiseconds. More...
 
unsigned char * buffer ()
 Pointer to start of time in memory. More...
 
unsigned char * buffer () const
 Pointer to start of time in memory This is used for calls to the OS that pass a UTC.
 

Static Public Member Functions

static UTCTime now ()
 Get a UTCTime representing the current time. More...
 

Protected Attributes

long long _centiseconds
 Number of centiseconds since Midnight Jan 1st 1900.
 

Detailed Description

Class to handle the 5 byte times.

The 5 byte time is used for time/date stamps on files on RISCOS. It is the number of centi-seconds from Midnight on 1st Jan 1900.

Constructor & Destructor Documentation

UTCTime::UTCTime ( long long  csecs)

Construct a UTC time for the given number of centiseconds.

Parameters
csecsnumber of centiseconds since Midnight, 1st Jan 1990
UTCTime::UTCTime ( unsigned int  load_address,
unsigned int  exec_address 
)

Construct a UTC time give file system catalog information.

Parameters
load_addressload address of the file
exec_addressexecute address of the file
UTCTime::UTCTime ( const UTCTime other)

Copy constructor.

Parameters
otherUTCTime to copy

Member Function Documentation

unsigned char* tbx::UTCTime::buffer ( )
inline

Pointer to start of time in memory.

This is used for calls to the OS that pass a UTC.

long long tbx::UTCTime::centiseconds ( ) const
inline

Get the UTC time as centiseconds.

Returns
number of centiseconds since Midnight Jan 1st 1900
unsigned char tbx::UTCTime::high_byte ( ) const
inline

Get the high byte of the UTC time.

Returns
the 8 bits of the high byte
unsigned int tbx::UTCTime::low_word ( ) const
inline

Get the low 4 bytes of the UTC time.

Returns
the low 4 bytes as a 32 bit integer
UTCTime UTCTime::now ( )
static

Get a UTCTime representing the current time.

Returns
a new UTCTime for now
UTCTime & UTCTime::operator= ( const UTCTime other)

Assign to value fo another UTCTime.

Parameters
otherUTCTime to copy
Returns
*this
std::string UTCTime::text ( ) const

Get time/date as text in standard format.

The standard format is read from the system variable Sys$DateFormat

Returns
string with formatted date
std::string UTCTime::text ( const std::string &  format) const

Get time/date as text in specified format.

Text from the format is copied directly into the result unless it starts with a "%" in which case the following is substituted. CS Centiseconds SE Seconds MI Minutes 12 Hours in 12 hour format 24 Hours in 24 hour format AM AM or PM indicator (in local language) PM AM or PM indicator (in local language) WE Weekday - full (in local language) W3 Weekday - short (in local language) WN Weekday - number DY Day of the month (in local language) ST Ordinal pre/suffix (in local language) (e.g st nd rd th) MO Month name - full (in local language) M3 Month name - short (in local language) MN Month - number CE Century YR Year within century WK Week of year (using local start of week) DN Day of the year TZ Timezone 0 Insert an ASCII 0 zero byte % Insert a ''

Returns
string with formatted date

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