aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder
diff options
context:
space:
mode:
authorsmikler <smikler@yandex-team.ru>2022-02-10 16:49:33 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:33 +0300
commit0e68ae909d3b76a5a001a07880eb0010dec6b2ea (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/folder
parente4f0fd4ab53ca40eb91e750cf3e7f76c21e930db (diff)
downloadydb-0e68ae909d3b76a5a001a07880eb0010dec6b2ea.tar.gz
Restoring authorship annotation for <smikler@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r--util/folder/dirut.cpp10
-rw-r--r--util/folder/dirut.h10
-rw-r--r--util/folder/dirut_ut.cpp2
3 files changed, 11 insertions, 11 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp
index 5fde8eef03d..ffc9b09f967 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 f52b66106d5..2537027b12d 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 ddda451611a..45ebfc842ca 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);
}
};