27 namespace time_internal {
39 namespace time_internal {
40 namespace cctz_extension {
47 #include "absl/time/internal/zoneinfo.inc" 49 const struct ZoneInfo {
55 {
"America/Los_Angeles",
56 reinterpret_cast<char*
>(America_Los_Angeles), America_Los_Angeles_len},
58 reinterpret_cast<char*
>(America_New_York), America_New_York_len},
60 reinterpret_cast<char*
>(Australia_Sydney), Australia_Sydney_len},
63 {
"Invalid/TimeZone",
nullptr, 0},
68 reinterpret_cast<char*
>(America_Los_Angeles), America_Los_Angeles_len},
73 reinterpret_cast<char*
>(America_Los_Angeles), America_Los_Angeles_len},
76 reinterpret_cast<char*
>(America_Los_Angeles), America_Los_Angeles_len},
82 TestZoneInfoSource(
const char*
data, std::size_t
size)
85 std::size_t Read(
void*
ptr, std::size_t size)
override {
87 memcpy(ptr,
data_, len);
92 int Skip(std::size_t offset)
override {
102 std::unique_ptr<cctz::ZoneInfoSource> TestFactory(
103 const std::string&
name,
104 const std::function<std::unique_ptr<cctz::ZoneInfoSource>(
105 const std::string& name)>& ) {
106 for (
const ZoneInfo& zoneinfo : kZoneInfo) {
107 if (name == zoneinfo.name) {
108 if (zoneinfo.data ==
nullptr)
return nullptr;
109 return std::unique_ptr<cctz::ZoneInfoSource>(
110 new TestZoneInfoSource(zoneinfo.data, zoneinfo.length));
113 ABSL_RAW_LOG(FATAL,
"Unexpected time zone \"%s\" in test", name.c_str());
ZoneInfoSourceFactory zone_info_source_factory
#define ABSL_RAW_LOG(severity,...)
#define ABSL_RAW_CHECK(condition, message)
static PerThreadSynch * Skip(PerThreadSynch *x)
TimeZone LoadTimeZone(const std::string &name)
std::unique_ptr< absl::time_internal::cctz::ZoneInfoSource >(*)(const std::string &, const std::function< std::unique_ptr< absl::time_internal::cctz::ZoneInfoSource >(const std::string &)> &) ZoneInfoSourceFactory