2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.


Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Ux::TimeParts Class Reference
[C++ Wrapper for Standard UNIX Functions]

Inheritance diagram for Ux::TimeParts:

tm Ux::Base List of all members.

Detailed Description

Clearer replacement for Timetm (struct tm).

Definition at line 121 of file uxtime.hpp.

Public Types

enum  zone { zone_local, zone_utc }

Public Member Functions

 TimeParts (time_t t=0)
 operator const char * ()
void set (const struct tm &t)
TimeSec get_secs (void)
const char * get_string (bool keep_nl=true)
void set (const char *s)
void set (time_t t, zone z=zone_local)
void set (zone z=zone_local)
char * set_fmt (const char *s, const char *format)
size_t get_fmt (char *buf, size_t bufsize, const char *format)
size_t get_fmtw (wchar_t *buf, size_t bufsize, const wchar_t *format)

Protected Attributes

TimeString str

Member Enumeration Documentation

enum Ux::TimeParts::zone

Enumeration values:

Definition at line 126 of file uxtime.hpp.

Constructor & Destructor Documentation

Ux::TimeParts::TimeParts time_t  t = 0  )  [inline]

Initializes to local time (at epoch by default).

Definition at line 130 of file uxtime.hpp.

References set().

Member Function Documentation

size_t TimeParts::get_fmt char *  buf,
size_t  bufsize,
const char *  format

Gets string from parts according to format (calls strftime).

Definition at line 145 of file uxtime.cpp.

References errno.

size_t TimeParts::get_fmtw wchar_t *  buf,
size_t  bufsize,
const wchar_t *  format

Gets string from parts according to format; wide-character version (calls wstrftime).

Definition at line 161 of file uxtime.cpp.

References errno.

TimeSec TimeParts::get_secs void   ) 

Calls mktime.

Definition at line 26 of file uxtime.cpp.

References errno.

const char * TimeParts::get_string bool  keep_nl = true  ) 

Calls asctime_t; optionally removes newline.

Definition at line 42 of file uxtime.cpp.

References errno, str, and Ux::TimeString::timestr.

Referenced by operator const char *().

Ux::TimeParts::operator const char *  )  [inline]

Definition at line 134 of file uxtime.hpp.

References get_string().

void Ux::TimeParts::set zone  z = zone_local  )  [inline]

Definition at line 141 of file uxtime.hpp.

References Ux::now, and set().

void TimeParts::set time_t  t,
zone  z = zone_local

Sets parts according to local time (calling localtime_r) or GMT (calling gmtime_r).

Definition at line 96 of file uxtime.cpp.

References errno, and zone_local.

void TimeParts::set const char *  s  ) 

Calls getdate.

Definition at line 58 of file uxtime.cpp.

References EC_GETDATE, and set().

void TimeParts::set const struct tm &  t  ) 

Sets from another TimeParts or struct tm.

Definition at line 112 of file uxtime.cpp.

References Ux::TimeString::set(), str, tm::tm_hour, tm::tm_isdst, tm::tm_mday, tm::tm_min, tm::tm_mon, tm::tm_sec, tm::tm_wday, tm::tm_yday, and tm::tm_year.

Referenced by set(), and TimeParts().

char * TimeParts::set_fmt const char *  s,
const char *  format

Sets parts from string according to format (calls strptime).

Definition at line 129 of file uxtime.cpp.

References errno.

Member Data Documentation

TimeString Ux::TimeParts::str [protected]

Definition at line 123 of file uxtime.hpp.

Referenced by get_string(), and set().

The documentation for this class was generated from the following files:
Generated on Fri Apr 23 10:57:18 2004 for AUP2 Example Source by doxygen 1.3.1