BDE 4.14.0 Production release
|
Provide an attribute class for Zoneinfo binary-file header data.
This component provides a simply constrained attribute class, baltzo::ZoneinfoBinaryHeader
, representing the header data of a Zoneinfo binary data file.
version
: Zoneinfo file format version, as of 2013, either '\0', 2
, or 3
.numIsGmt
: number of encoded UTC/local indicators in the file, indicating whether a transition time was originally specified as UTC in the rule file.numIsStd
: number of encoded standard/wall indicators in the file, indicating whether a transition time was originally specified as standard time in the rule file.numLeaps
: number of leap corrections stored in the file.numTransitions
: number of local-time type transitions stored in the file.numLocalTimeTypes
: number of local-time types stored in the file.abbrevDataSize
: length of the sequence of characters containing the ('\0'-separated) abbreviation strings in the file.This section illustrates intended use of this component.
We define the getNextZoneinfoBinaryHeader
helper function, reads data from a stream, validates the data, and constructs a baltzo::ZoneinfoBinaryHeader
object.
To use our helper function, we supply it with a stream of (decimal, whitespace-separated values). The resulting object has the expected value.
Since all of the data in the stream has now been consumed, another call to the function returns an error and leaves the object unchanged.