diff options
author | smikler <smikler@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
commit | 0e68ae909d3b76a5a001a07880eb0010dec6b2ea (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util | |
parent | e4f0fd4ab53ca40eb91e750cf3e7f76c21e930db (diff) | |
download | ydb-0e68ae909d3b76a5a001a07880eb0010dec6b2ea.tar.gz |
Restoring authorship annotation for <smikler@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/draft/enum.h | 2 | ||||
-rw-r--r-- | util/folder/dirut.cpp | 10 | ||||
-rw-r--r-- | util/folder/dirut.h | 10 | ||||
-rw-r--r-- | util/folder/dirut_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/input.cpp | 10 | ||||
-rw-r--r-- | util/stream/input.h | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/util/draft/enum.h b/util/draft/enum.h index a60ef21fed..18002b7df2 100644 --- a/util/draft/enum.h +++ b/util/draft/enum.h @@ -118,7 +118,7 @@ inline void SetEnumFlags(const std::pair<const char*, E>* str2Enum, TStringBuf o } } } - + // for enums generated with GENERATE_ENUM_SERIALIZATION template <class E, size_t B> inline void SetEnumFlags(TStringBuf optSpec, std::bitset<B>& flags, bool allIfEmpty = true) { diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp index 5fde8eef03..ffc9b09f96 100644 --- a/util/folder/dirut.cpp +++ b/util/folder/dirut.cpp @@ -614,8 +614,8 @@ TString ResolvePath(const char* path, bool isDir) { TString StripFileComponent(const TString& fileName) { TString dir = IsDir(fileName) ? fileName : GetDirName(fileName); - if (!dir.empty() && dir.back() != GetDirectorySeparator()) { - dir.append(GetDirectorySeparator()); - } - return dir; -} + if (!dir.empty() && dir.back() != GetDirectorySeparator()) { + dir.append(GetDirectorySeparator()); + } + return dir; +} diff --git a/util/folder/dirut.h b/util/folder/dirut.h index f52b66106d..2537027b12 100644 --- a/util/folder/dirut.h +++ b/util/folder/dirut.h @@ -47,8 +47,8 @@ void MakeDirIfNotExist(const char* path, int mode = 0777); inline void MakeDirIfNotExist(const TString& path, int mode = 0777) { MakeDirIfNotExist(path.data(), mode); -} - +} + /// Create path making parent directories as needed void MakePathIfNotExist(const char* path, int mode = 0777); @@ -65,8 +65,8 @@ const char* GetFileNameComponent(const char* f); inline TString GetFileNameComponent(const TString& f) { return GetFileNameComponent(f.data()); -} - +} + /// RealPath doesn't guarantee trailing separator to be stripped or left in place for directories. TString RealPath(const TString& path); // throws TString RealLocation(const TString& path); /// throws; last file name component doesn't need to exist @@ -88,7 +88,7 @@ TString GetDirName(const TString& path); TString GetBaseName(const TString& path); TString StripFileComponent(const TString& fileName); - + class TExistenceChecker { public: TExistenceChecker(bool strict = false) diff --git a/util/folder/dirut_ut.cpp b/util/folder/dirut_ut.cpp index ddda451611..45ebfc842c 100644 --- a/util/folder/dirut_ut.cpp +++ b/util/folder/dirut_ut.cpp @@ -127,7 +127,7 @@ Y_UNIT_TEST_SUITE(TDirutTest) { UNIT_ASSERT_EQUAL(StripFileComponent(tmpDir), tmpDir + GetDirectorySeparatorS()); UNIT_ASSERT_EQUAL(StripFileComponent(tmpSubDir), tmpSubDir + GetDirectorySeparatorS()); UNIT_ASSERT_EQUAL(StripFileComponent(tmpFile), tmpDir + GetDirectorySeparatorS()); - + RemoveDirWithContents(tmpDir); } }; diff --git a/util/stream/input.cpp b/util/stream/input.cpp index dbded82306..6e8170f2f9 100644 --- a/util/stream/input.cpp +++ b/util/stream/input.cpp @@ -72,12 +72,12 @@ size_t IInputStream::Load(void* buf_in, size_t len) { } void IInputStream::LoadOrFail(void* buf, size_t len) { - const size_t realLen = Load(buf, len); + const size_t realLen = Load(buf, len); if (Y_UNLIKELY(realLen != len)) { - ythrow yexception() << "Failed to read required number of bytes from stream! Expected: " << len << ", gained: " << realLen << "!"; - } -} - + ythrow yexception() << "Failed to read required number of bytes from stream! Expected: " << len << ", gained: " << realLen << "!"; + } +} + size_t IInputStream::ReadLine(TString& st) { const size_t ret = ReadTo(st, '\n'); diff --git a/util/stream/input.h b/util/stream/input.h index ed2b98c33f..f0d5807ed2 100644 --- a/util/stream/input.h +++ b/util/stream/input.h @@ -82,7 +82,7 @@ public: * signals end of stream. */ size_t Load(void* buf, size_t len); - + /** * Reads the requested amount of data from the stream, or fails with an * exception if unable to do so. |