diff options
author | smikler <smikler@yandex-team.ru> | 2022-02-10 16:49:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:32 +0300 |
commit | e4f0fd4ab53ca40eb91e750cf3e7f76c21e930db (patch) | |
tree | afee3c8173a0960bf439959f26e7624d1212e11a /util/folder | |
parent | 1503061b80644305b2e6dd1327b57118e35ebd31 (diff) | |
download | ydb-e4f0fd4ab53ca40eb91e750cf3e7f76c21e930db.tar.gz |
Restoring authorship annotation for <smikler@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder')
-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 |
3 files changed, 11 insertions, 11 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp index ffc9b09f96..5fde8eef03 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 2537027b12..f52b66106d 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 45ebfc842c..ddda451611 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); } }; |