MCPcopy Create free account
hub / github.com/HowardHinnant/date / load_transitions

Function load_transitions

src/tz.cpp:2049–2067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2047
2048template <class TimeType>
2049static
2050std::vector<detail::transition>
2051load_transitions(std::istream& inf, std::int32_t tzh_timecnt)
2052{
2053 // Read transitions
2054 using namespace std::chrono;
2055 std::vector<detail::transition> transitions;
2056 transitions.reserve(static_cast<unsigned>(tzh_timecnt));
2057 for (std::int32_t i = 0; i < tzh_timecnt; ++i)
2058 {
2059 TimeType t;
2060 inf.read(reinterpret_cast<char*>(&t), sizeof(t));
2061 maybe_reverse_bytes(t);
2062 transitions.emplace_back(sys_seconds{seconds{t}});
2063 if (transitions.back().timepoint < min_seconds)
2064 transitions.back().timepoint = min_seconds;
2065 }
2066 return transitions;
2067}
2068
2069static
2070std::vector<std::uint8_t>

Callers

nothing calls this directly

Calls 1

maybe_reverse_bytesFunction · 0.85

Tested by

no test coverage detected