diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /util/draft | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'util/draft')
-rw-r--r-- | util/draft/date.cpp | 6 | ||||
-rw-r--r-- | util/draft/date.h | 10 | ||||
-rw-r--r-- | util/draft/datetime.cpp | 2 | ||||
-rw-r--r-- | util/draft/datetime.h | 10 | ||||
-rw-r--r-- | util/draft/datetime_ut.cpp | 12 | ||||
-rw-r--r-- | util/draft/enum.h | 8 | ||||
-rw-r--r-- | util/draft/holder_vector.h | 4 | ||||
-rw-r--r-- | util/draft/holder_vector_ut.cpp | 4 | ||||
-rw-r--r-- | util/draft/ip.h | 6 |
9 files changed, 31 insertions, 31 deletions
diff --git a/util/draft/date.cpp b/util/draft/date.cpp index a290c46050..645edad013 100644 --- a/util/draft/date.cpp +++ b/util/draft/date.cpp @@ -44,7 +44,7 @@ TDate::TDate(const char* yyyymmdd) { } -TDate::TDate(const TString& yyyymmdd) +TDate::TDate(const TString& yyyymmdd) : Timestamp(GetDateStart(ParseDate(yyyymmdd.c_str()))) { } @@ -54,7 +54,7 @@ TDate::TDate(time_t ts) { } -TDate::TDate(const TString& date, const TString& format) +TDate::TDate(const TString& date, const TString& format) : Timestamp(GetDateStart(ParseDate(date.data(), format.data()))) { } @@ -82,7 +82,7 @@ time_t TDate::GetStartUTC() const { return TimeGM(&dateTm); } -TString TDate::ToStroka(const char* format) const { +TString TDate::ToStroka(const char* format) const { tm dateTm; localtime_r(&Timestamp, &dateTm); return Strftime(format, &dateTm); diff --git a/util/draft/date.h b/util/draft/date.h index e3eb616fe5..b973a8d197 100644 --- a/util/draft/date.h +++ b/util/draft/date.h @@ -2,7 +2,7 @@ #include <util/stream/output.h> #include <util/stream/input.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/datetime/constants.h> #include <ctime> @@ -28,9 +28,9 @@ public: } TDate(const char* yyyymmdd); - TDate(const TString& yyyymmdd); + TDate(const TString& yyyymmdd); TDate(unsigned year, unsigned month, unsigned monthDay); // month from 01, monthDay from 01 - TDate(const TString& date, const TString& format); + TDate(const TString& date, const TString& format); explicit TDate(time_t t); @@ -40,7 +40,7 @@ public: time_t GetStartUTC() const; - TString ToStroka(const char* format = "%Y%m%d") const; + TString ToStroka(const char* format = "%Y%m%d") const; TDate& operator++() { Timestamp = GetDateStart(Timestamp + 3 * (SECONDS_IN_DAY / 2)); @@ -117,7 +117,7 @@ inline int operator-(const TDate& left, const TDate& right) { } inline IInputStream& operator>>(IInputStream& left, TDate& right) { - TString stroka; + TString stroka; left >> stroka; TDate date(stroka.c_str()); right = date; diff --git a/util/draft/datetime.cpp b/util/draft/datetime.cpp index 5cbe7d8847..5365dd737a 100644 --- a/util/draft/datetime.cpp +++ b/util/draft/datetime.cpp @@ -178,7 +178,7 @@ namespace NDatetime { } } - TString TSimpleTM::ToString(const char* fmt) const { + TString TSimpleTM::ToString(const char* fmt) const { struct tm t = *this; return Strftime(fmt, &t); } diff --git a/util/draft/datetime.h b/util/draft/datetime.h index 8a387ea6f1..5bf0ee7156 100644 --- a/util/draft/datetime.h +++ b/util/draft/datetime.h @@ -1,7 +1,7 @@ #pragma once #include <util/generic/algorithm.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/yexception.h> #include <util/generic/ymath.h> #include <util/datetime/base.h> @@ -70,7 +70,7 @@ namespace NDatetime { // keeps the object consistent TSimpleTM& Add(EField f, i32 amount = 1); - TString ToString(const char* fmt = "%a, %d %b %Y %H:%M:%S %z") const; + TString ToString(const char* fmt = "%a, %d %b %Y %H:%M:%S %z") const; TSimpleTM& ToUTC() { return *this = New(AsTimeT()); @@ -133,16 +133,16 @@ namespace NDatetime { }; } -inline TString date2str(const time_t date) { +inline TString date2str(const time_t date) { struct tm dateTm; memset(&dateTm, 0, sizeof(dateTm)); localtime_r(&date, &dateTm); char buf[9]; strftime(buf, sizeof(buf), "%Y%m%d", &dateTm); - return TString(buf); + return TString(buf); } -inline time_t str2date(const TString& dateStr) { +inline time_t str2date(const TString& dateStr) { struct tm dateTm; memset(&dateTm, 0, sizeof(tm)); strptime(dateStr.data(), "%Y%m%d", &dateTm); diff --git a/util/draft/datetime_ut.cpp b/util/draft/datetime_ut.cpp index a5e065ef6e..2af8430977 100644 --- a/util/draft/datetime_ut.cpp +++ b/util/draft/datetime_ut.cpp @@ -5,19 +5,19 @@ #include <util/string/builder.h> Y_UNIT_TEST_SUITE(TSimpleTMTest) { - TString PrintMarker(const TString& test, int line) { + TString PrintMarker(const TString& test, int line) { return TStringBuilder() << "test " << test << " at line " << line; } - TString JoinMarker(const TString& marker, time_t t) { + TString JoinMarker(const TString& marker, time_t t) { return TStringBuilder() << marker << " (tstamp=" << t << ")"; } - TString PrintMarker(const TString& test, int line, time_t t) { + TString PrintMarker(const TString& test, int line, time_t t) { return JoinMarker(PrintMarker(test, line), t); } - void AssertStructTmEqual(const TString& marker, const struct tm& tmt, const NDatetime::TSimpleTM& tms) { + void AssertStructTmEqual(const TString& marker, const struct tm& tmt, const NDatetime::TSimpleTM& tms) { UNIT_ASSERT_VALUES_EQUAL_C((int)tms.Sec, tmt.tm_sec, marker); UNIT_ASSERT_VALUES_EQUAL_C((int)tms.Min, tmt.tm_min, marker); UNIT_ASSERT_VALUES_EQUAL_C((int)tms.Hour, tmt.tm_hour, marker); @@ -32,10 +32,10 @@ Y_UNIT_TEST_SUITE(TSimpleTMTest) { #endif } - void AssertSimpleTM(const TString& mark, + void AssertSimpleTM(const TString& mark, const NDatetime::TSimpleTM& tms, time_t tstamp, ui32 year, ui32 mon, ui32 mday, ui32 hour, ui32 minu, ui32 sec) { - TString marker = JoinMarker(mark, tstamp); + TString marker = JoinMarker(mark, tstamp); struct tm tmt; Zero(tmt); GmTimeR(&tstamp, &tmt); diff --git a/util/draft/enum.h b/util/draft/enum.h index 18002b7df2..a7adc49c32 100644 --- a/util/draft/enum.h +++ b/util/draft/enum.h @@ -37,8 +37,8 @@ const V* FindEnumFromStringImpl(const char* key, const std::pair<const char*, V> } template <class K, class V> -TString PrintEnumItemsImpl(const std::pair<K, V>* entries, size_t arraySize) { - TString result; +TString PrintEnumItemsImpl(const std::pair<K, V>* entries, size_t arraySize) { + TString result; TStringOutput out(result); for (size_t i = 0; i < arraySize; i++) out << (i ? ", " : "") << "'" << entries[i].first << "'"; @@ -47,8 +47,8 @@ TString PrintEnumItemsImpl(const std::pair<K, V>* entries, size_t arraySize) { // special version for const char* template <class V> -TString PrintEnumItemsImpl(const std::pair<const char*, V>* entries, size_t arraySize) { - TString result; +TString PrintEnumItemsImpl(const std::pair<const char*, V>* entries, size_t arraySize) { + TString result; TStringOutput out(result); for (size_t i = 0; i < arraySize; i++) out << (i ? ", " : "") << "'" << (entries[i].first ? entries[i].first : "<null>") << "'"; diff --git a/util/draft/holder_vector.h b/util/draft/holder_vector.h index 1c62055bd9..b1d9b695d8 100644 --- a/util/draft/holder_vector.h +++ b/util/draft/holder_vector.h @@ -6,7 +6,7 @@ template <class T, class D = TDelete> class THolderVector: public TVector<T*>, public TNonCopyable { - using TBase = TVector<T*>; + using TBase = TVector<T*>; public: explicit THolderVector(size_t n = 0) @@ -30,7 +30,7 @@ public: return TBase::size(); } - // TVector takes ownership of T + // TVector takes ownership of T void PushBack(T* t) { try { TBase::push_back(t); diff --git a/util/draft/holder_vector_ut.cpp b/util/draft/holder_vector_ut.cpp index f64393860a..3acb823941 100644 --- a/util/draft/holder_vector_ut.cpp +++ b/util/draft/holder_vector_ut.cpp @@ -60,8 +60,8 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) { } Y_UNIT_TEST(TestUniquePtr) { - THolderVector<TString> v; - std::unique_ptr<TString> str(new TString("hello")); + THolderVector<TString> v; + std::unique_ptr<TString> str(new TString("hello")); v.PushBack(std::move(str)); UNIT_ASSERT(v.Size() == 1); UNIT_ASSERT(str.get() == nullptr); diff --git a/util/draft/ip.h b/util/draft/ip.h index eb947cd2cd..550bdbf8e5 100644 --- a/util/draft/ip.h +++ b/util/draft/ip.h @@ -80,10 +80,10 @@ static inline char* Ip6ToString(const TIp6& ip, char* buf, size_t len) { return buf; } -static inline TString Ip6ToString(const TIp6& ip) { +static inline TString Ip6ToString(const TIp6& ip) { char buf[INET6_ADDRSTRLEN]; - return TString(Ip6ToString(ip, buf, sizeof(buf))); + return TString(Ip6ToString(ip, buf, sizeof(buf))); } template <> @@ -106,7 +106,7 @@ static inline TIp4Or6 Ip4Or6FromString(const char* ipStr) { ythrow TSystemError() << "Failed to convert (" << ipStr << ") to ipv4 or ipv6 address"; } -static inline TString Ip4Or6ToString(const TIp4Or6& ip) { +static inline TString Ip4Or6ToString(const TIp4Or6& ip) { if (std::holds_alternative<TIp6>(ip)) { return Ip6ToString(std::get<TIp6>(ip)); } else { |