Quick Links: |
#include <baltzo_zoneinfobinaryheader.h>
Public Member Functions | |
ZoneinfoBinaryHeader () | |
ZoneinfoBinaryHeader (const ZoneinfoBinaryHeader &original) | |
ZoneinfoBinaryHeader (char version, int numIsGmt, int numIsStd, int numLeaps, int numTransitions, int numLocalTimeTypes, int abbrevDataSize) | |
~ZoneinfoBinaryHeader () | |
ZoneinfoBinaryHeader & | operator= (const ZoneinfoBinaryHeader &rhs) |
void | setVersion (char value) |
void | setNumIsGmt (int value) |
void | setNumIsStd (int value) |
void | setNumLeaps (int value) |
void | setNumTransitions (int value) |
void | setNumLocalTimeTypes (int value) |
void | setAbbrevDataSize (int value) |
void | swap (ZoneinfoBinaryHeader &other) |
char | version () const |
int | numIsGmt () const |
int | numIsStd () const |
int | numLeaps () const |
int | numTransitions () const |
int | numLocalTimeTypes () const |
int | abbrevDataSize () const |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Static Public Member Functions | |
static bool | isValidVersion (char value) |
static bool | isValidNumIsGmt (int value) |
static bool | isValidNumIsStd (int value) |
static bool | isValidNumLeaps (int value) |
static bool | isValidNumTransitions (int value) |
static bool | isValidNumLocalTimeTypes (int value) |
static bool | isValidAbbrevDataSize (int value) |
This simply constrained (value-semantic) attribute class represents the header information found at the start of a Zoneinfo (binary) database file, which describes the contents of the file.
See the Attributes section under @DESCRIPTION in the component-level documentation. Note that the class invariants are identically the constraints on the individual attributes.
This class:
supports a complete set of value semantic operations
bdex
serialization const
thread-safe For terminology see bsldoc_glossary
.
See Component baltzo_zoneinfobinaryheader
baltzo::ZoneinfoBinaryHeader::ZoneinfoBinaryHeader | ( | ) |
Create a ZoneinfoBinaryHeader
object having the (default) attribute values:
version() == 0 numIsGmt() == 0 numIsStd() == 0 numLeaps() == 0 numTransitions() == 0 numLocalTimeTypes() == 1 abbrevDataSize() == 1
baltzo::ZoneinfoBinaryHeader::ZoneinfoBinaryHeader | ( | const ZoneinfoBinaryHeader & | original | ) |
Create a ZoneInfoBinaryHeader
object with the same value as the specified original
.
baltzo::ZoneinfoBinaryHeader::ZoneinfoBinaryHeader | ( | char | version, | |
int | numIsGmt, | |||
int | numIsStd, | |||
int | numLeaps, | |||
int | numTransitions, | |||
int | numLocalTimeTypes, | |||
int | abbrevDataSize | |||
) |
Create a ZoneinfoBinaryHeader
having the specified version
, numIsGmt
, numIsStd
, numLeaps
, numTransitions
, numLocalTimeTypes
, and abbrevDataSize
values. The behavior is undefined unless 0 == version || 50 == version || 51 == version
, 0 <= numIsGmt
, 0 <= numIsStd
, 0 == numLeaps
, 0 <= numTransitions
, 1 <= numLocalTimeTypes
, and 1 <= abbrevDataSize
. Note that 50 is the value of ASCII character 2
and 51 is the value of ASCII character 3
.
baltzo::ZoneinfoBinaryHeader::~ZoneinfoBinaryHeader | ( | ) |
Destroy this object.
static bool baltzo::ZoneinfoBinaryHeader::isValidVersion | ( | char | value | ) | [static] |
Return true
if the specified value equals \0
or 2
, and false
otherwise.
static bool baltzo::ZoneinfoBinaryHeader::isValidNumIsGmt | ( | int | value | ) | [static] |
Return true
if the specified value
is greater than or equal to 0, and false
otherwise'.
static bool baltzo::ZoneinfoBinaryHeader::isValidNumIsStd | ( | int | value | ) | [static] |
Return true
if the specified value
is greater than or equal to 0, and false
otherwise'.
static bool baltzo::ZoneinfoBinaryHeader::isValidNumLeaps | ( | int | value | ) | [static] |
Return true
if the specified value equals 0, and false
otherwise'.
static bool baltzo::ZoneinfoBinaryHeader::isValidNumTransitions | ( | int | value | ) | [static] |
Return true
if the specified value
is greater than or equal to 0, and false
otherwise'.
static bool baltzo::ZoneinfoBinaryHeader::isValidNumLocalTimeTypes | ( | int | value | ) | [static] |
Return true
if the specified value
is greater than or equal to 1, and false
otherwise'.
static bool baltzo::ZoneinfoBinaryHeader::isValidAbbrevDataSize | ( | int | value | ) | [static] |
Return true
if the specified value
is greater than or equal to 1, and false
otherwise'.
ZoneinfoBinaryHeader& baltzo::ZoneinfoBinaryHeader::operator= | ( | const ZoneinfoBinaryHeader & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
void baltzo::ZoneinfoBinaryHeader::setVersion | ( | char | value | ) |
Set the version
attribute of this object to the specified value
. The behavior is undefined unless '0 == value || 50 == value || 51 == value'. Note that 50 is the value of ASCII character 2
and 51 is the value of ASCII character 3
.
void baltzo::ZoneinfoBinaryHeader::setNumIsGmt | ( | int | value | ) |
Set the numIsGmt
attribute of this object to the specified value
. The behavior is undefined unless 0 <= value
.
void baltzo::ZoneinfoBinaryHeader::setNumIsStd | ( | int | value | ) |
Set the numIsStd
attribute of this object to the specified value
. The behavior is undefined unless 0 <= value
.
void baltzo::ZoneinfoBinaryHeader::setNumLeaps | ( | int | value | ) |
Set the numLeaps
attribute of this object to the specified value
. The behavior is undefined unless 0 == value
.
void baltzo::ZoneinfoBinaryHeader::setNumTransitions | ( | int | value | ) |
Set the numTransitions
attribute of this object to the specified value
. The behavior is undefined unless 0 <= value
.
void baltzo::ZoneinfoBinaryHeader::setNumLocalTimeTypes | ( | int | value | ) |
Set the numLocalTimeTypes
attribute of this object to the specified value
. The behavior is undefined unless 1 <= value
.
void baltzo::ZoneinfoBinaryHeader::setAbbrevDataSize | ( | int | value | ) |
Set the abbrevDataSize
attribute of this object to the specified value
. The behavior is undefined unless 1 <= value
.
void baltzo::ZoneinfoBinaryHeader::swap | ( | ZoneinfoBinaryHeader & | other | ) |
Efficiently exchange the value of this object with the value of the specified other
object. This method provides the no-throw exception-safety guarantee.
char baltzo::ZoneinfoBinaryHeader::version | ( | ) | const |
Return the value of the version
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::numIsGmt | ( | ) | const |
Return the value of the numIsGmt
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::numIsStd | ( | ) | const |
Return the value of the numIsStd
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::numLeaps | ( | ) | const |
Return the value of the numLeaps
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::numTransitions | ( | ) | const |
Return the value of the numTransitions
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::numLocalTimeTypes | ( | ) | const |
Return the value of the numLocalTimeTypes
attribute of this object.
int baltzo::ZoneinfoBinaryHeader::abbrevDataSize | ( | ) | const |
Return the value of the abbrevDataSize
attribute of this object.
bsl::ostream& baltzo::ZoneinfoBinaryHeader::print | ( | bsl::ostream & | stream, | |
int | level = 0 , |
|||
int | spacesPerLevel = 4 | |||
) | const |
Write the value of this object to the specified output stream
in a human-readable format, and return a reference to stream
. Optionally specify an initial indentation level
, whose absolute value is incremented recursively for nested objects. If level
is specified, optionally specify spacesPerLevel
, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
). If stream
is not valid on entry, this operation has no effect. Note that the format is not fully specified, and can change without notice.