#include <datetime.h>
Inheritance diagram for ucommon::DateTimeString:
Public Types | |
BOTH | |
DATE | |
enum | mode_t { DATE, TIME, BOTH } |
Specify string buffer mode. More... | |
TIME | |
Public Member Functions | |
char * | c_str (void) |
Extract char from string. | |
DateTimeString (mode_t string=DateTimeString::BOTH) | |
Construct a new date and time object with current date and time. | |
DateTimeString (DateTimeString &object) | |
Create a datetime object from another object. | |
DateTimeString (int year, unsigned month, unsigned day, int hour=0, int minute=0, int second=0) | |
Construct a date and time object from explicit date and time values. | |
DateTimeString (char *pointer, size_t size=0) | |
Construct a date and time from ISO string buffer. | |
DateTimeString (tm_t *tm) | |
Construct a date and time from C library time structure. | |
DateTimeString (time_t time) | |
Construct a date and time from C libraray time_t type. | |
operator char * (void) | |
Cast to string. | |
void | set (mode_t string) |
Set the string mode. | |
void | set (void) |
Set (update) the date and time with current date and time. | |
virtual | ~DateTimeString () |
Destroy date time string. | |
Protected Member Functions | |
void | update (void) |
A method to use to "post" any changed values when shadowing a mixed object class. |
This can be used to access the date and time as a standard string without requiring an external buffer.
Definition at line 858 of file datetime.h.
Specify string buffer mode.
By default we form a string with date and time.
Definition at line 865 of file datetime.h.
ucommon::DateTimeString::DateTimeString | ( | time_t | time | ) |
Construct a date and time from C libraray time_t type.
time | type to make date and time from. |
ucommon::DateTimeString::DateTimeString | ( | tm_t * | tm | ) |
Construct a date and time from C library time structure.
tm | structure from C library (from glt or gmt). |
ucommon::DateTimeString::DateTimeString | ( | char * | pointer, | |
size_t | size = 0 | |||
) |
Construct a date and time from ISO string buffer.
pointer | to string field holding date and time. | |
size | of field if not null terminated string. |
ucommon::DateTimeString::DateTimeString | ( | int | year, | |
unsigned | month, | |||
unsigned | day, | |||
int | hour = 0 , |
|||
int | minute = 0 , |
|||
int | second = 0 | |||
) |
Construct a date and time object from explicit date and time values.
year | of object. | |
month | of object (1-12). | |
day | of month of object (1-31). | |
hour | of object (0-23). | |
minute | of object (0-59). | |
second | of object (0-59). |
ucommon::DateTimeString::DateTimeString | ( | DateTimeString & | object | ) |
Create a datetime object from another object.
object | to copy. |
char* ucommon::DateTimeString::c_str | ( | void | ) | [inline] |
ucommon::DateTimeString::operator char * | ( | void | ) | [inline] |
void ucommon::DateTimeString::set | ( | mode_t | string | ) |
Set the string mode.
string | mode to use. |
void ucommon::DateTimeString::update | ( | void | ) | [protected, virtual] |
A method to use to "post" any changed values when shadowing a mixed object class.
This is used by DateNumber and string classes.
Reimplemented from ucommon::DateTime.