|
ActiveLib
|
Class for transporting a data/time via XML. More...
#include <XMLDateTime.h>


Public Types | |
| enum class | Format { iso8601 , secondsSince1970 } |
| Preferred JSON date/time format. More... | |
| enum class | Content { dateTime , dateOnly , timeOnly , dateTimeWithOffset , timeOnlyWithOffset } |
| The date/time content, i.e. just a date, just a time, date & time etc. Ignored for secondsSince1970 format. | |
Public Types inherited from active::serialise::Item | |
| enum class | Type { text , number , boolean } |
Public Types inherited from active::serialise::Cargo | |
| using | Unique = std::unique_ptr<Cargo> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Cargo> |
| Shared pointer. | |
| using | size_type = std::string::size_type |
| Class size type. | |
| using | sizeOption = std::optional<size_type> |
| Optional size type (used to indicate an unspecified or non-existant position) | |
Public Member Functions | |
| XMLDateTime (utility::Time &time, Content content=Content::dateTimeWithOffset, double prec=1e-6) | |
| virtual const utility::Time & | getTime () const |
| double | getSecondsPrecision () const |
| virtual Format | getFormat () const |
| virtual Content | getContent () const |
| virtual bool | isRead () const |
| virtual bool | write (utility::String &dest) const override |
| void | setSecondsPrecision (double prec) |
| virtual void | setFormat (Format format) |
| virtual void | setContent (Content content) |
| virtual void | setDefault () override |
| virtual bool | validate () override |
| virtual bool | read (const utility::String &source) override |
Public Member Functions inherited from active::serialise::Item | |
| virtual bool | fillInventory (Inventory &inventory) const |
| virtual Cargo::Unique | getCargo (const Inventory::Item &item) const |
| virtual std::optional< Type > | type () const |
| virtual bool | read (const setting::Value &source) |
Public Member Functions inherited from active::serialise::Cargo | |
| Cargo () | |
| Cargo (const Cargo &source) | |
| virtual | ~Cargo ()=default |
| virtual void | clear () |
Class for transporting a data/time via XML.
|
strong |
| XMLDateTime::XMLDateTime | ( | utility::Time & | time, |
| Content | content = Content::dateTimeWithOffset, | ||
| double | prec = 1e-6 ) |
Constructor
| time | A time |
| content | The date/time content |
| prec | The seconds precision (e.g. 1e-6 for microsecond precision, 1.0 for whole seconds only) |
|
inlinevirtual |
Get the content of the date/time
|
inlinevirtual |
Get the date/time format
|
inline |
Get the precision for seconds (e.g. 1e-6 for microsecond precision, 1.0 for whole seconds only)
|
inlinevirtual |
Get the time
|
inlinevirtual |
Determine if a time has been read
|
overridevirtual |
Read the item data from the specified string
| source | The string to read |
Implements active::serialise::Item.

|
inlinevirtual |
Set the content of the date/time
| content | The content of the date/time |
|
overridevirtual |
Set to the default package content
Implements active::serialise::Cargo.

|
inlinevirtual |
Set the date/time format
| format | The date/time format |
|
inline |
Set the precision for seconds (e.g. 1e-6 for microsecond precision, 1.0 for whole seconds only)
| prec | The seconds precision |
|
inlineoverridevirtual |
Validate the transported data
Reimplemented from active::serialise::Cargo.
|
overridevirtual |
Write the item data to a string
| dest | The string to write the const data to |
Implements active::serialise::Item.
