diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:55 +0300 |
commit | 1d125034f06575234f83f24f08677955133f140e (patch) | |
tree | ec05fbbd61dc118d5de37f206ab978cff58774bd /util/folder | |
parent | 3a7a498715ef1b66f5054455421b845e45e3a653 (diff) | |
download | ydb-1d125034f06575234f83f24f08677955133f140e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r-- | util/folder/path.cpp | 34 | ||||
-rw-r--r-- | util/folder/path.h | 6 |
2 files changed, 20 insertions, 20 deletions
diff --git a/util/folder/path.cpp b/util/folder/path.cpp index bfe0c67d68..a8b3a4535a 100644 --- a/util/folder/path.cpp +++ b/util/folder/path.cpp @@ -258,23 +258,23 @@ void TFsPath::ListNames(TVector<TString>& children) const { } } -bool TFsPath::Contains(const TString& component) const { - if (!IsDefined()) { - return false; - } - - TFsPath path = *this; - while (path.Parent() != path) { - if (path.GetName() == component) { - return true; - } - - path = path.Parent(); - } - - return false; -} - +bool TFsPath::Contains(const TString& component) const { + if (!IsDefined()) { + return false; + } + + TFsPath path = *this; + while (path.Parent() != path) { + if (path.GetName() == component) { + return true; + } + + path = path.Parent(); + } + + return false; +} + void TFsPath::List(TVector<TFsPath>& files) const { TVector<TString> names; ListNames(names); diff --git a/util/folder/path.h b/util/folder/path.h index 2fb4d6b4ef..74785492dd 100644 --- a/util/folder/path.h +++ b/util/folder/path.h @@ -155,9 +155,9 @@ public: void List(TVector<TFsPath>& children) const; void ListNames(TVector<TString>& children) const; - // Check, if path contains at least one component with a specific name. - bool Contains(const TString& component) const; - + // Check, if path contains at least one component with a specific name. + bool Contains(const TString& component) const; + // fails to delete non-empty directory void DeleteIfExists() const; // delete recursively. Does nothing if not exists |