Export of internal Abseil changes.

--
aa9e2bff92652605b8244677058be787c872f99c by Abseil Team <absl-team@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 202702969

--
d26c857c203589892a84bc44d789f2a15a60f234 by Abseil Team <absl-team@google.com>:

Cleans up the FixedArray code (formatting, renames, etc) without changing the functionality

PiperOrigin-RevId: 202538159
GitOrigin-RevId: aa9e2bff92652605b8244677058be787c872f99c
Change-Id: I6561257232c6cc8e1cbf51d7e26bae5f8760551e
This commit is contained in:
Abseil Team 2018-06-29 14:00:35 -07:00 committed by Titus Winters
parent ba8d6cf077
commit 134496a31d
16 changed files with 452 additions and 262 deletions

View file

@ -61,20 +61,43 @@ int __system_property_get(const char* name, char* value) {
#endif
std::string time_zone::name() const {
return time_zone::Impl::get(*this).name();
return effective_impl().Name();
}
time_zone::absolute_lookup time_zone::lookup(
const time_point<seconds>& tp) const {
return time_zone::Impl::get(*this).BreakTime(tp);
return effective_impl().BreakTime(tp);
}
time_zone::civil_lookup time_zone::lookup(const civil_second& cs) const {
return time_zone::Impl::get(*this).MakeTime(cs);
return effective_impl().MakeTime(cs);
}
bool operator==(time_zone lhs, time_zone rhs) {
return &time_zone::Impl::get(lhs) == &time_zone::Impl::get(rhs);
bool time_zone::next_transition(const time_point<seconds>& tp,
civil_transition* trans) const {
return effective_impl().NextTransition(tp, trans);
}
bool time_zone::prev_transition(const time_point<seconds>& tp,
civil_transition* trans) const {
return effective_impl().PrevTransition(tp, trans);
}
std::string time_zone::version() const {
return effective_impl().Version();
}
std::string time_zone::description() const {
return effective_impl().Description();
}
const time_zone::Impl& time_zone::effective_impl() const {
if (impl_ == nullptr) {
// Dereferencing an implicit-UTC time_zone is expected to be
// rare, so we don't mind paying a small synchronization cost.
return *time_zone::Impl::UTC().impl_;
}
return *impl_;
}
bool load_time_zone(const std::string& name, time_zone* tz) {