C++/Tree Mapping Runtime Library
|
Class corresponding to the XML Schema dateTime built-in type. More...
#include <date-time.hxx>
Constructors | |
date_time (int year, unsigned short month, unsigned short day, unsigned short hours, unsigned short minutes, double seconds) | |
Initialize an instance with the year, month, day, hours, minutes, and seconds components. | |
date_time (int year, unsigned short month, unsigned short day, unsigned short hours, unsigned short minutes, double seconds, short zone_hours, short zone_minutes) | |
Initialize an instance with the year, month, day, hours, minutes, and seconds components as well as time zone. | |
date_time (const date_time &x, flags f=0, container *c=0) | |
Copy constructor. | |
virtual date_time * | _clone (flags f=0, container *c=0) const |
Copy the instance polymorphically. | |
template<typename S > | |
date_time (istream< S > &s, flags f=0, container *c=0) | |
Create an instance from a data representation stream. | |
date_time (const xercesc::DOMElement &e, flags f=0, container *c=0) | |
Create an instance from a DOM element. | |
date_time (const xercesc::DOMAttr &a, flags f=0, container *c=0) | |
Create an instance from a DOM Attribute. | |
date_time (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0) | |
Create an instance from a string fragment. | |
int | year () const |
Get the year component. | |
void | year (int y) |
Set the year component. | |
unsigned short | month () const |
Get the month component. | |
void | month (unsigned short m) |
Set the month component. | |
unsigned short | day () const |
Get the day component. | |
void | day (unsigned short d) |
Set the day component. | |
unsigned short | hours () const |
Get the hours component. | |
void | hours (unsigned short h) |
Set the hours component. | |
unsigned short | minutes () const |
Get the minutes component. | |
void | minutes (unsigned short m) |
Set the minutes component. | |
double | seconds () const |
Get the seconds component. | |
void | seconds (double s) |
Set the seconds component. | |
Additional Inherited Members | |
![]() | |
time_zone () | |
Default constructor. | |
time_zone (short hours, short minutes) | |
Initialize an instance with the hours and minutes components. | |
bool | zone_present () const |
Determine if time zone is specified. | |
void | zone_reset () |
Reset the time zone to the 'not specified' state. | |
short | zone_hours () const |
Get the hours component of the time zone. | |
void | zone_hours (short h) |
Set the hours component of the time zone. | |
short | zone_minutes () const |
Get the minutes component of the time zone. | |
void | zone_minutes (short m) |
Set the minutes component of the time zone. | |
Class corresponding to the XML Schema dateTime built-in type.
The date_time class represents year, month, day, hours, minutes, and seconds with an optional time zone.
date_time | ( | int | year, |
unsigned short | month, | ||
unsigned short | day, | ||
unsigned short | hours, | ||
unsigned short | minutes, | ||
double | seconds | ||
) |
Initialize an instance with the year, month, day, hours, minutes, and seconds components.
When this constructor is used, the time zone is left unspecified.
year | The year component. |
month | The month component. |
day | The day component. |
hours | The hours component. |
minutes | The minutes component. |
seconds | The seconds component. |
date_time | ( | int | year, |
unsigned short | month, | ||
unsigned short | day, | ||
unsigned short | hours, | ||
unsigned short | minutes, | ||
double | seconds, | ||
short | zone_hours, | ||
short | zone_minutes | ||
) |
Initialize an instance with the year, month, day, hours, minutes, and seconds components as well as time zone.
year | The year component. |
month | The month component. |
day | The day component. |
hours | The hours component. |
minutes | The minutes component. |
seconds | The seconds component. |
zone_hours | The time zone hours component. |
zone_minutes | The time zone minutes component. |
date_time | ( | const date_time< C, B > & | x, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Copy constructor.
x | An instance to make a copy of. |
f | Flags to create the copy with. |
c | A pointer to the object that will contain the copy. |
For polymorphic object models use the _clone function instead.
date_time | ( | istream< S > & | s, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a data representation stream.
s | A stream to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
date_time | ( | const xercesc::DOMElement & | e, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a DOM element.
e | A DOM element to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
date_time | ( | const xercesc::DOMAttr & | a, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a DOM Attribute.
a | A DOM attribute to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
date_time | ( | const std::basic_string< C > & | s, |
const xercesc::DOMElement * | e, | ||
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a string fragment.
s | A string fragment to extract the data from. |
e | A pointer to DOM element containing the string fragment. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
|
virtual |
Copy the instance polymorphically.
f | Flags to create the copy with. |
c | A pointer to the object that will contain the copy. |
This function ensures that the dynamic type of the instance is used for copying and should be used for polymorphic object models instead of the copy constructor.
int year | ( | ) | const |
Get the year component.
void year | ( | int | y | ) |
Set the year component.
y | The new year component. |
unsigned short month | ( | ) | const |
Get the month component.
void month | ( | unsigned short | m | ) |
Set the month component.
m | The new month component. |
unsigned short day | ( | ) | const |
Get the day component.
void day | ( | unsigned short | d | ) |
Set the day component.
d | The new day component. |
unsigned short hours | ( | ) | const |
Get the hours component.
void hours | ( | unsigned short | h | ) |
Set the hours component.
h | The new hours component. |
unsigned short minutes | ( | ) | const |
Get the minutes component.
void minutes | ( | unsigned short | m | ) |
Set the minutes component.
m | The new minutes component. |
double seconds | ( | ) | const |
Get the seconds component.
void seconds | ( | double | s | ) |
Set the seconds component.
s | The new seconds component. |