6 #ifndef ACE_TIME_ZONE_DATA_H
7 #define ACE_TIME_ZONE_DATA_H
10 #include "../zoneinfo/infos.h"
11 #include "TimeOffset.h"
32 mZoneInfoBroker(zoneInfo) {}
40 mZoneInfoBroker(zoneInfo) {}
47 bool isNull()
const {
return mZoneInfoBroker.isNull(); }
51 const __FlashStringHelper* name = mZoneInfoBroker.name();
52 typename D::ZoneContextBroker zoneContext =
53 mZoneInfoBroker.zoneContext();
54 ace_common::KString
kname(
55 name, zoneContext.fragments(), zoneContext.numFragments());
56 kname.printTo(printer);
65 const __FlashStringHelper* name = mZoneInfoBroker.name();
66 const __FlashStringHelper* shortName = zoneinfo::findShortName(name);
67 ace_common::printReplaceCharTo(printer, shortName,
'_',
' ');
72 return mZoneInfoBroker.zoneId();
77 uint8_t numEras = mZoneInfoBroker.numEras();
78 typename D::ZoneEraBroker zeb = mZoneInfoBroker.era(numEras - 1);
83 ace_common::KString
kname()
const {
84 const auto* name =
isNull() ? nullptr : mZoneInfoBroker.name();
85 typename D::ZoneContextBroker zoneContext =
86 mZoneInfoBroker.zoneContext();
87 return ace_common::KString(
88 name, zoneContext.fragments(), zoneContext.numFragments());
92 typename D::ZoneInfoBroker mZoneInfoBroker;
95 using BasicZone = ZoneTemplate<basic::Info>;
96 using ExtendedZone = ZoneTemplate<extended::Info>;
97 using CompleteZone = ZoneTemplate<complete::Info>;
A thin wrapper that represents a time offset from a reference point, usually 00:00 at UTC,...
static TimeOffset forSeconds(int32_t seconds)
Create TimeOffset from seconds from 00:00.
A thin wrapper around a ZoneInfo data structure to provide a stable API access to some useful ZoneInf...
ZoneTemplate(const typename D::ZoneInfoBroker &zoneInfo)
Constructor from a Info:ZoneInfoBroker, used by various ZoneProcessor.
ace_common::KString kname() const
Return the name as a KString.
ZoneTemplate(const typename D::ZoneInfo *zoneInfo)
Constructor from a raw Info::ZoneInfo* pointer, intended for manual inspection of a ZoneInfo record.
bool isNull() const
Return true if zoneInfo is null.
uint32_t zoneId() const
Return the zoneId of the current zoneInfo.
void printShortNameTo(Print &printer) const
Print the short pretty zone name to the printer.
TimeOffset stdOffset() const
Return the STDOFF of the last ZoneEra.
void printNameTo(Print &printer) const
Print the full zone name to printer.