|
C++/Tree Mapping Runtime Library
|
Class corresponding to the XML Schema duration built-in type. More...
#include <date-time.hxx>
Constructors | |
| duration (bool negative, unsigned int years, unsigned int months, unsigned int days, unsigned int hours, unsigned int minutes, double seconds) | |
| Initialize a potentially negative instance with the years, months, days, hours, minutes, and seconds components. | |
| duration (const duration &x, flags f=0, container *c=0) | |
| Copy constructor. | |
| virtual duration * | _clone (flags f=0, container *c=0) const |
| Copy the instance polymorphically. | |
| template<typename S > | |
| duration (istream< S > &s, flags f=0, container *c=0) | |
| Create an instance from a data representation stream. | |
| duration (const xercesc::DOMElement &e, flags f=0, container *c=0) | |
| Create an instance from a DOM element. | |
| duration (const xercesc::DOMAttr &a, flags f=0, container *c=0) | |
| Create an instance from a DOM Attribute. | |
| duration (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0) | |
| Create an instance from a string fragment. | |
| bool | negative () const |
| Determine if duration is negative. | |
| void | negative (bool n) |
| Change duration sign. | |
| unsigned int | years () const |
| Get the years component. | |
| void | years (unsigned int y) |
| Set the years component. | |
| unsigned int | months () const |
| Get the months component. | |
| void | months (unsigned int m) |
| Set the months component. | |
| unsigned int | days () const |
| Get the days component. | |
| void | days (unsigned int d) |
| Set the days component. | |
| unsigned int | hours () const |
| Get the hours component. | |
| void | hours (unsigned int h) |
| Set the hours component. | |
| unsigned int | minutes () const |
| Get the minutes component. | |
| void | minutes (unsigned int m) |
| Set the minutes component. | |
| double | seconds () const |
| Get the seconds component. | |
| void | seconds (double s) |
| Set the seconds component. | |
Class corresponding to the XML Schema duration built-in type.
The duration class represents a potentially negative duration in the form of years, months, days, hours, minutes, and seconds.
| duration | ( | bool | negative, |
| unsigned int | years, | ||
| unsigned int | months, | ||
| unsigned int | days, | ||
| unsigned int | hours, | ||
| unsigned int | minutes, | ||
| double | seconds | ||
| ) |
Initialize a potentially negative instance with the years, months, days, hours, minutes, and seconds components.
| negative | A boolean value indicating whether the duration is negative (true) or positive (false). |
| years | The years component. |
| months | The months component. |
| days | The days component. |
| hours | The hours component. |
| minutes | The minutes component. |
| seconds | The seconds component. |
| duration | ( | const duration< 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.
| duration | ( | 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. |
| duration | ( | 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. |
| duration | ( | 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. |
| duration | ( | 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.
| bool negative | ( | ) | const |
Determine if duration is negative.
| void negative | ( | bool | n | ) |
Change duration sign.
| n | A boolean value indicating whether duration is negative (true) or positive (false). |
| unsigned int years | ( | ) | const |
Get the years component.
| void years | ( | unsigned int | y | ) |
Set the years component.
| y | The new years component. |
| unsigned int months | ( | ) | const |
Get the months component.
| void months | ( | unsigned int | m | ) |
Set the months component.
| m | The new months component. |
| unsigned int days | ( | ) | const |
Get the days component.
| void days | ( | unsigned int | d | ) |
Set the days component.
| d | The new days component. |
| unsigned int hours | ( | ) | const |
Get the hours component.
| void hours | ( | unsigned int | h | ) |
Set the hours component.
| h | The new hours component. |
| unsigned int minutes | ( | ) | const |
Get the minutes component.
| void minutes | ( | unsigned int | 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. |