summaryrefslogtreecommitdiff
path: root/absl/time/internal/cctz/src/time_zone_libc.h
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2023-09-07 13:16:09 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2023-09-07 13:16:09 -0400
commit6fdbff8bbce2a1debdc060df381f39e3dcfb65af (patch)
tree71f1ef38477a65d5cce472fc042c90087c2bb351 /absl/time/internal/cctz/src/time_zone_libc.h
parent8d4a80fe37176b1170d7dce0772dea9584ec3e32 (diff)
parent29bf8085f3bf17b84d30e34b3d7ff8248fda404e (diff)
Merge new upstream LTS 20230802.0
Diffstat (limited to 'absl/time/internal/cctz/src/time_zone_libc.h')
-rw-r--r--absl/time/internal/cctz/src/time_zone_libc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_libc.h b/absl/time/internal/cctz/src/time_zone_libc.h
index 1da9039a..ae210737 100644
--- a/absl/time/internal/cctz/src/time_zone_libc.h
+++ b/absl/time/internal/cctz/src/time_zone_libc.h
@@ -15,6 +15,7 @@
#ifndef ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_LIBC_H_
#define ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_LIBC_H_
+#include <memory>
#include <string>
#include "absl/base/config.h"
@@ -27,10 +28,10 @@ namespace cctz {
// A time zone backed by gmtime_r(3), localtime_r(3), and mktime(3),
// and which therefore only supports UTC and the local time zone.
-// TODO: Add support for fixed offsets from UTC.
class TimeZoneLibC : public TimeZoneIf {
public:
- explicit TimeZoneLibC(const std::string& name);
+ // Factory.
+ static std::unique_ptr<TimeZoneLibC> Make(const std::string& name);
// TimeZoneIf implementations.
time_zone::absolute_lookup BreakTime(
@@ -44,6 +45,10 @@ class TimeZoneLibC : public TimeZoneIf {
std::string Description() const override;
private:
+ explicit TimeZoneLibC(const std::string& name);
+ TimeZoneLibC(const TimeZoneLibC&) = delete;
+ TimeZoneLibC& operator=(const TimeZoneLibC&) = delete;
+
const bool local_; // localtime or UTC
};