diff options
author | kakabba <kakabba@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
commit | 9c914f41ba5e9f9365f404e892197553ac23809e (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/folder/path.cpp | |
parent | c8e3995898c443e78266f7420aac5fb3da15d413 (diff) | |
download | ydb-9c914f41ba5e9f9365f404e892197553ac23809e.tar.gz |
Restoring authorship annotation for <kakabba@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder/path.cpp')
-rw-r--r-- | util/folder/path.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/folder/path.cpp b/util/folder/path.cpp index c8f440d669..bfe0c67d68 100644 --- a/util/folder/path.cpp +++ b/util/folder/path.cpp @@ -77,29 +77,29 @@ TFsPath TFsPath::RelativeTo(const TFsPath& root) const { return TFsPath(split.Reconstruct()); } -TFsPath TFsPath::RelativePath(const TFsPath& root) const { - TSplit split = GetSplit(); - const TSplit& rsplit = root.GetSplit(); - size_t cnt = 0; +TFsPath TFsPath::RelativePath(const TFsPath& root) const { + TSplit split = GetSplit(); + const TSplit& rsplit = root.GetSplit(); + size_t cnt = 0; while (split.size() > cnt && rsplit.size() > cnt && split[cnt] == rsplit[cnt]) { ++cnt; } bool absboth = split.IsAbsolute && rsplit.IsAbsolute; if (cnt == 0 && !absboth) { - ythrow TIoException() << "No common parts in " << *this << " and " << root; + ythrow TIoException() << "No common parts in " << *this << " and " << root; } TString r; for (size_t i = 0; i < rsplit.size() - cnt; i++) { - r += i == 0 ? ".." : "/.."; + r += i == 0 ? ".." : "/.."; } for (size_t i = cnt; i < split.size(); i++) { r += (i == 0 || i == cnt && rsplit.size() - cnt == 0 ? "" : "/"); r += split[i]; } return r.size() ? TFsPath(r) : TFsPath(); -} - +} + TFsPath TFsPath::Parent() const { if (!IsDefined()) { return TFsPath(); @@ -314,11 +314,11 @@ TFsPath TFsPath::RealPath() const { return ::RealPath(*this); } -TFsPath TFsPath::RealLocation() const { - CheckDefined(); +TFsPath TFsPath::RealLocation() const { + CheckDefined(); return ::RealLocation(*this); -} - +} + TFsPath TFsPath::ReadLink() const { CheckDefined(); |