Public Member Functions | Public Attributes | Friends

Burger::TimeDate_t Struct Reference

Structure to hold a date and time. More...

#include <brtimedate.h>

List of all members.

Public Member Functions

BURGER_INLINE void Clear (void)
 Zero out all entries.
void GetTime (void)
 Obtain the current localized time.
void GetTime (time_t uInput)
 Convert a time_t to a TimeDate_t.
void TimeToString (char *pOutput) const
 Convert the time to 23:23:21.
void TimeToStringPM (char *pOutput) const
 Convert the time to 11:23:21PM.
void DateToString (char *pOutput) const
 Convert the date to 10/30/63.
void DateToStringVerbose (char *pOutput) const
 Convert the date to Sunday, October 30, 1963.
void Read (StreamHandle_t *pInput)
 Read the structure record from a StreamHandle_t.
void Write (StreamHandle_t *pOutput) const
 Write the structure record to a StreamHandle_t.
int Compare (const TimeDate_t *pInput) const
 Compares two Burger::TimeDate_t records for equality.

Public Attributes

Word32 m_uYear
 Year "2009".
Word16 m_usMilliseconds
 0-999
Word8 m_bMonth
 1-12
Word8 m_bDay
 1-31
Word8 m_bDayOfWeek
 0-6
Word8 m_bHour
 0-23
Word8 m_bMinute
 0-59
Word8 m_bSecond
 0-59

Friends

BURGER_INLINE friend Word operator== (const TimeDate_t &rInput1, const TimeDate_t &rInput2)
BURGER_INLINE friend Word operator!= (const TimeDate_t &rInput1, const TimeDate_t &rInput2)
BURGER_INLINE friend Word operator> (const TimeDate_t &rInput1, const TimeDate_t &rInput2)
BURGER_INLINE friend Word operator>= (const TimeDate_t &rInput1, const TimeDate_t &rInput2)
BURGER_INLINE friend Word operator< (const TimeDate_t &rInput1, const TimeDate_t &rInput2)
BURGER_INLINE friend Word operator<= (const TimeDate_t &rInput1, const TimeDate_t &rInput2)

Detailed Description

Structure to hold a date and time.

This structure contains all the information of the date and time in a human readable format


Member Function Documentation

Burger::TimeDate_t::Clear ( void   )  [inline]

Zero out all entries.

Initialize all entries to zero. This is considered an error state.

Returns:
All entries are equal to zero.
int Burger::TimeDate_t::Compare ( const TimeDate_t pInput  )  const

Compares two Burger::TimeDate_t records for equality.

Compares two Burger::TimeDate_t records and return -1 if the this is less than the record passed. return 0 if they are the same and 1 if the parameter is less than the this.

Parameters:
pInput Pointer to an initialized Burger::TimeDate_t record.
Returns:
-1 if less then, 0 if equal, 1 if greater than.
void Burger::TimeDate_t::DateToString ( char *  pOutput  )  const

Convert the date to 10/30/63.

Convert the date into a string that is in the format of MM/DD/YY

Parameters:
pOutput C char buffer at least 9 bytes long to receive the string.
See also:
Burger::TimeDate_t::DateToStringVerbose(char *pOutput) const
void Burger::TimeDate_t::DateToStringVerbose ( char *  pOutput  )  const

Convert the date to Sunday, October 30, 1963.

Convert the date into a string that is in the format of "Sunday, October 30, 1963"

Parameters:
pOutput C char buffer at least 64 bytes long to receive the string.
See also:
Burger::TimeDate_t::DateToString(char *pOutput) const
void Burger::TimeDate_t::GetTime ( void   ) 

Obtain the current localized time.

A query is made to the target platform and the structure is filled in with the current date and time.

Returns:
The structure is set to the current localized time.
void Burger::TimeDate_t::GetTime ( time_t  uInput  ) 

Convert a time_t to a TimeDate_t.

A query is made to the target platform and the structure is filled in with the current date and time.

Parameters:
uInput A time_t value obtained by a call to the "C library. \return The structure is filled with the time as converted from the "C" library time.
void Burger::TimeDate_t::Read ( StreamHandle_t pInput  ) 

Read the structure record from a StreamHandle_t.

Initialize a Burger::TimeDate_t structure from a StreamHandle_t record. The data will be read from what was stored from a call to Burger::TimeDate_t::Write(StreamHandle_t *) const . It will read the data back irregardless of platform.

This call is endian neutral and assumes the Burger::TimeDate_t is uninitialized.

Parameters:
pInput Pointer to a valid StreamHandle_t structure initialized for input
See also:
Burger::TimeDate_t::Write(StreamHandle_t *), StreamHandleInitGet(), Burger::TimeDate_t, StreamHandle_t
void Burger::TimeDate_t::TimeToString ( char *  pOutput  )  const

Convert the time to 23:23:21.

Convert the time into a string that is in the format of HH:MM:SS. Uses a 24 hour (Military time) format.

Parameters:
pOutput C char buffer at least 9 bytes long to receive the string.
See also:
Burger::TimeDate_t::TimeToStringPM(char *pOutput) const
void Burger::TimeDate_t::TimeToStringPM ( char *  pOutput  )  const

Convert the time to 11:23:21PM.

Convert the time into a string that is in the format of HH:MM:SSAM Uses a 12 hour (AM/PM) format.

Parameters:
pOutput C char buffer at least 11 bytes long to receive the string.
See also:
Burger::TimeDate_t::TimeToString(char *pOutput) const
void Burger::TimeDate_t::Write ( StreamHandle_t pOutput  )  const

Write the structure record to a StreamHandle_t.

Take the contents of a Burger::TimeDate_t structure and write it out to a StreamHandle_t record. The data will be written so a call to Burger::TimeDate_t::Read(StreamHandle_t *) will read the data back irregardless of platform.

This call is endian neutral and assumes the Burger::TimeDate_t is initialized.

Parameters:
pOutput Pointer to a valid StreamHandle_t structure initialized for output
See also:
Burger::TimeDate_t::Read(StreamHandle_t *), StreamHandleInitPut(), Burger::TimeDate_t, StreamHandle_t

Friends And Related Function Documentation

BURGER_INLINE friend Word operator!= ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]
BURGER_INLINE friend Word operator< ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]
BURGER_INLINE friend Word operator<= ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]
BURGER_INLINE friend Word operator== ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]
BURGER_INLINE friend Word operator> ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]
BURGER_INLINE friend Word operator>= ( const TimeDate_t rInput1,
const TimeDate_t rInput2 
) [friend]

Member Data Documentation

1-31

0-6

0-23

0-59

1-12

0-59

0-999

Year "2009".