aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cctz/src/time_zone_if.cc
diff options
context:
space:
mode:
authorpetrk <petrk@yandex-team.ru>2022-02-10 16:47:26 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:26 +0300
commitaf66956edf116b93d5a07894ccb61dd4447d0b34 (patch)
tree7b4cde47a2b3630f5a3048855949c4d46b893fc0 /contrib/libs/cctz/src/time_zone_if.cc
parentdc5feacd15e76abe98d23fe0d4ea3c02cb8de60f (diff)
downloadydb-af66956edf116b93d5a07894ccb61dd4447d0b34.tar.gz
Restoring authorship annotation for <petrk@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cctz/src/time_zone_if.cc')
-rw-r--r--contrib/libs/cctz/src/time_zone_if.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/contrib/libs/cctz/src/time_zone_if.cc b/contrib/libs/cctz/src/time_zone_if.cc
index a80dbcd60d..e2b5381e2c 100644
--- a/contrib/libs/cctz/src/time_zone_if.cc
+++ b/contrib/libs/cctz/src/time_zone_if.cc
@@ -1,36 +1,36 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
+// Copyright 2016 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "time_zone_if.h"
-#include "time_zone_info.h"
-#include "time_zone_libc.h"
-
-namespace cctz {
-
-std::unique_ptr<TimeZoneIf> TimeZoneIf::Load(const std::string& name) {
- // Support "libc:localtime" and "libc:*" to access the legacy
- // localtime and UTC support respectively from the C library.
- if (name.compare(0, 5, "libc:") == 0) {
- return std::unique_ptr<TimeZoneIf>(new TimeZoneLibC(name.substr(5)));
- }
-
- // Otherwise use the "zoneinfo" implementation by default.
- std::unique_ptr<TimeZoneInfo> tz(new TimeZoneInfo);
- if (!tz->Load(name)) tz.reset();
- return std::unique_ptr<TimeZoneIf>(tz.release());
-}
-
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "time_zone_if.h"
+#include "time_zone_info.h"
+#include "time_zone_libc.h"
+
+namespace cctz {
+
+std::unique_ptr<TimeZoneIf> TimeZoneIf::Load(const std::string& name) {
+ // Support "libc:localtime" and "libc:*" to access the legacy
+ // localtime and UTC support respectively from the C library.
+ if (name.compare(0, 5, "libc:") == 0) {
+ return std::unique_ptr<TimeZoneIf>(new TimeZoneLibC(name.substr(5)));
+ }
+
+ // Otherwise use the "zoneinfo" implementation by default.
+ std::unique_ptr<TimeZoneInfo> tz(new TimeZoneInfo);
+ if (!tz->Load(name)) tz.reset();
+ return std::unique_ptr<TimeZoneIf>(tz.release());
+}
+
// Defined out-of-line to avoid emitting a weak vtable in all TUs.
TimeZoneIf::~TimeZoneIf() {}
@@ -42,4 +42,4 @@ std::int_fast64_t TimePointToUnixSeconds(const time_point<seconds>& tp) {
return ToUnixSeconds(tp);
}
-} // namespace cctz
+} // namespace cctz