MIRA
Classes
mira::HumanReadableSerialization Namespace Reference

The serialization of time-related types Time, Date and Duration is primarily aimed at efficiency and precision. More...

Classes

class  Date
 Derivation of mira::Date with human-readable serialization. More...
 
class  Duration
 Derivation of mira::Duration with human-readable serialization. More...
 
class  Time
 Derivation of mira::Time with human-readable serialization. More...
 

Detailed Description

The serialization of time-related types Time, Date and Duration is primarily aimed at efficiency and precision.

They may be less suited for use cases where the serialized output should be read by humans, or input for deserialization should be edited by humans.

For such cases, we add here derivations of mira::Time, mira::Date and mira::Duration which change the serialization format. These can be used for variables where the form of the output format matters more than precision or performance.

For each type, there is one variant serializing to a compact string (based on ISO 8601), and one that serializes to separate primitive members like 'Year', 'Month', 'Hours' etc.

Instead of using objects of these classes as replacement for Time, Date or Duration, specific getters and setters can be applied to objects of the original types just for serialization (defined within the owning class' reflect() method). Such setters and getters are also provided here, they use the alternative classes as proxies for serialization.