File indexing completed on 2025-01-18 09:27:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_IMPL_H_
0016 #define ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_IMPL_H_
0017
0018 #include <memory>
0019 #include <string>
0020
0021 #include "absl/base/config.h"
0022 #include "absl/time/internal/cctz/include/cctz/civil_time.h"
0023 #include "absl/time/internal/cctz/include/cctz/time_zone.h"
0024 #include "time_zone_if.h"
0025 #include "time_zone_info.h"
0026
0027 namespace absl {
0028 ABSL_NAMESPACE_BEGIN
0029 namespace time_internal {
0030 namespace cctz {
0031
0032
0033 class time_zone::Impl {
0034 public:
0035
0036 static time_zone UTC();
0037
0038
0039
0040 static bool LoadTimeZone(const std::string& name, time_zone* tz);
0041
0042
0043
0044 static void ClearTimeZoneMapTestOnly();
0045
0046
0047 const std::string& Name() const {
0048
0049 return name_;
0050 }
0051
0052
0053 time_zone::absolute_lookup BreakTime(const time_point<seconds>& tp) const {
0054 return zone_->BreakTime(tp);
0055 }
0056
0057
0058
0059
0060 time_zone::civil_lookup MakeTime(const civil_second& cs) const {
0061 return zone_->MakeTime(cs);
0062 }
0063
0064
0065 bool NextTransition(const time_point<seconds>& tp,
0066 time_zone::civil_transition* trans) const {
0067 return zone_->NextTransition(tp, trans);
0068 }
0069 bool PrevTransition(const time_point<seconds>& tp,
0070 time_zone::civil_transition* trans) const {
0071 return zone_->PrevTransition(tp, trans);
0072 }
0073
0074
0075 std::string Version() const { return zone_->Version(); }
0076
0077
0078 std::string Description() const { return zone_->Description(); }
0079
0080 private:
0081 Impl();
0082 explicit Impl(const std::string& name);
0083 Impl(const Impl&) = delete;
0084 Impl& operator=(const Impl&) = delete;
0085
0086 static const Impl* UTCImpl();
0087
0088 const std::string name_;
0089 std::unique_ptr<TimeZoneIf> zone_;
0090 };
0091
0092 }
0093 }
0094 ABSL_NAMESPACE_END
0095 }
0096
0097 #endif