diff options
author | somov <somov@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
commit | a5950576e397b1909261050b8c7da16db58f10b1 (patch) | |
tree | 7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc | |
parent | 81eddc8c0b55990194e112b02d127b87d54164a9 (diff) | |
download | ydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz |
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc')
-rw-r--r-- | contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc index c75e4ec21a..002e84c12e 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/time/format.cc @@ -19,12 +19,12 @@ #include "y_absl/strings/match.h" #include "y_absl/strings/string_view.h" -#include "y_absl/time/internal/cctz/include/cctz/time_zone.h" -#include "y_absl/time/time.h" +#include "y_absl/time/internal/cctz/include/cctz/time_zone.h" +#include "y_absl/time/time.h" -namespace cctz = y_absl::time_internal::cctz; +namespace cctz = y_absl::time_internal::cctz; -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN ABSL_DLL extern const char RFC3339_full[] = "%Y-%m-%d%ET%H:%M:%E*S%Ez"; @@ -51,7 +51,7 @@ inline cctz::time_point<cctz::seconds> unix_epoch() { // Splits a Time into seconds and femtoseconds, which can be used with CCTZ. // Requires that 't' is finite. See duration.cc for details about rep_hi and // rep_lo. -cctz_parts Split(y_absl::Time t) { +cctz_parts Split(y_absl::Time t) { const auto d = time_internal::ToUnixDuration(t); const int64_t rep_hi = time_internal::GetRepHi(d); const int64_t rep_lo = time_internal::GetRepLo(d); @@ -62,7 +62,7 @@ cctz_parts Split(y_absl::Time t) { // Joins the given seconds and femtoseconds into a Time. See duration.cc for // details about rep_hi and rep_lo. -y_absl::Time Join(const cctz_parts& parts) { +y_absl::Time Join(const cctz_parts& parts) { const int64_t rep_hi = (parts.sec - unix_epoch()).count(); const uint32_t rep_lo = parts.fem.count() / (1000 * 1000 / 4); const auto d = time_internal::MakeDuration(rep_hi, rep_lo); @@ -72,7 +72,7 @@ y_absl::Time Join(const cctz_parts& parts) { } // namespace TString FormatTime(y_absl::string_view format, y_absl::Time t, - y_absl::TimeZone tz) { + y_absl::TimeZone tz) { if (t == y_absl::InfiniteFuture()) return TString(kInfiniteFutureStr); if (t == y_absl::InfinitePast()) return TString(kInfinitePastStr); const auto parts = Split(t); @@ -80,23 +80,23 @@ TString FormatTime(y_absl::string_view format, y_absl::Time t, cctz::time_zone(tz)); } -TString FormatTime(y_absl::Time t, y_absl::TimeZone tz) { +TString FormatTime(y_absl::Time t, y_absl::TimeZone tz) { return FormatTime(RFC3339_full, t, tz); } -TString FormatTime(y_absl::Time t) { - return y_absl::FormatTime(RFC3339_full, t, y_absl::LocalTimeZone()); +TString FormatTime(y_absl::Time t) { + return y_absl::FormatTime(RFC3339_full, t, y_absl::LocalTimeZone()); } bool ParseTime(y_absl::string_view format, y_absl::string_view input, - y_absl::Time* time, TString* err) { - return y_absl::ParseTime(format, input, y_absl::UTCTimeZone(), time, err); + y_absl::Time* time, TString* err) { + return y_absl::ParseTime(format, input, y_absl::UTCTimeZone(), time, err); } // If the input string does not contain an explicit UTC offset, interpret // the fields with respect to the given TimeZone. bool ParseTime(y_absl::string_view format, y_absl::string_view input, - y_absl::TimeZone tz, y_absl::Time* time, TString* err) { + y_absl::TimeZone tz, y_absl::Time* time, TString* err) { auto strip_leading_space = [](y_absl::string_view* sv) { while (!sv->empty()) { if (!std::isspace(sv->front())) return; @@ -127,7 +127,7 @@ bool ParseTime(y_absl::string_view format, y_absl::string_view input, } } - TString error; + TString error; cctz_parts parts; const bool b = cctz::detail::parse(TString(format), TString(input), @@ -140,21 +140,21 @@ bool ParseTime(y_absl::string_view format, y_absl::string_view input, return b; } -// Functions required to support y_absl::Time flags. -bool AbslParseFlag(y_absl::string_view text, y_absl::Time* t, TString* error) { +// Functions required to support y_absl::Time flags. +bool AbslParseFlag(y_absl::string_view text, y_absl::Time* t, TString* error) { return y_absl::ParseTime(RFC3339_full, text, y_absl::UTCTimeZone(), t, error); } -TString AbslUnparseFlag(y_absl::Time t) { - return y_absl::FormatTime(RFC3339_full, t, y_absl::UTCTimeZone()); +TString AbslUnparseFlag(y_absl::Time t) { + return y_absl::FormatTime(RFC3339_full, t, y_absl::UTCTimeZone()); } -bool ParseFlag(const TString& text, y_absl::Time* t, TString* error) { - return y_absl::ParseTime(RFC3339_full, text, y_absl::UTCTimeZone(), t, error); +bool ParseFlag(const TString& text, y_absl::Time* t, TString* error) { + return y_absl::ParseTime(RFC3339_full, text, y_absl::UTCTimeZone(), t, error); } -TString UnparseFlag(y_absl::Time t) { - return y_absl::FormatTime(RFC3339_full, t, y_absl::UTCTimeZone()); +TString UnparseFlag(y_absl::Time t) { + return y_absl::FormatTime(RFC3339_full, t, y_absl::UTCTimeZone()); } ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl |