diff options
author | ilezhankin <ilezhankin@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:56 +0300 |
commit | 62a805381e41500fbc7914c37c71ab040a098f4e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/folder | |
parent | 1d125034f06575234f83f24f08677955133f140e (diff) | |
download | ydb-62a805381e41500fbc7914c37c71ab040a098f4e.tar.gz |
Restoring authorship annotation for <ilezhankin@yandex-team.ru>. Commit 2 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 a8b3a4535a..bfe0c67d68 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 74785492dd..2fb4d6b4ef 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 |