Main Page | Class List | File List | Class Members | File Members

format_system_time Class Reference

Formats systemtime date and time as a fixed width string. More...

#include <format_system_time.h>

List of all members.

Public Types

enum  { relative = 1, show_seconds = 2, show_milliseconds = 4 }

Public Member Functions

 format_system_time (const SYSTEMTIME &systemtime, int options=0)
 format_system_time (int options=0)
 Uses local time as input.

Static Public Member Functions

static int width (int options=0)
 Returns width of stream according to options.

Public Attributes

int m_options
SYSTEMTIME m_systemtime

Friends

std::ostream & operator<< (std::ostream &, const format_system_time &)


Detailed Description

Formats systemtime date and time as a fixed width string.

Format is date followed by time separated by a space.

Date is formatted according to regional settings for short date format-ordering specifier and date separator: mm-dd-yyyy, dd-mm-yyyy or yyyy-mm-dd

Time is formatted according to options in 24 hour format. Seconds and milliseonds are shown as specified in options. Showing milliseconds will also show seconds.

hh:mm:ss:mmm

Option relative shows date when different from current time.

Output width and alignment of stream is used.

Definition at line 27 of file format_system_time.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
relative 
show_seconds 
show_milliseconds 

Definition at line 30 of file format_system_time.h.


Constructor & Destructor Documentation

format_system_time::format_system_time const SYSTEMTIME &  systemtime,
int  options = 0
[inline]
 

Definition at line 31 of file format_system_time.h.

format_system_time::format_system_time int  options = 0  )  [inline]
 

Uses local time as input.

Definition at line 36 of file format_system_time.h.

References m_systemtime.


Member Function Documentation

int format_system_time::width int  options = 0  )  [static]
 

Returns width of stream according to options.

relative is not taken into consideration.

Definition at line 89 of file format_system_time.cpp.

References show_milliseconds, and show_seconds.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const format_system_time fst
[friend]
 

Definition at line 8 of file format_system_time.cpp.


Member Data Documentation

int format_system_time::m_options
 

Definition at line 47 of file format_system_time.h.

Referenced by operator<<().

SYSTEMTIME format_system_time::m_systemtime
 

Definition at line 48 of file format_system_time.h.

Referenced by format_system_time(), and operator<<().


The documentation for this class was generated from the following files:
Generated on Sun Jun 26 13:44:01 2005 for pingem by  doxygen 1.4.3