aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder
diff options
context:
space:
mode:
authormikari <mikari@yandex-team.ru>2022-02-10 16:48:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:47 +0300
commit2e0ed5ad2d70bf924ccd3cbbfab508784ab36325 (patch)
treec407f44de8fd4579bf0ceffc822d243ff76cfd26 /util/folder
parentab32245a89d56835833808c7e644b3da277d7085 (diff)
downloadydb-2e0ed5ad2d70bf924ccd3cbbfab508784ab36325.tar.gz
Restoring authorship annotation for <mikari@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r--util/folder/path.h36
-rw-r--r--util/folder/path_ut.cpp16
2 files changed, 26 insertions, 26 deletions
diff --git a/util/folder/path.h b/util/folder/path.h
index 2fb4d6b4ef..d3075d8dbd 100644
--- a/util/folder/path.h
+++ b/util/folder/path.h
@@ -13,8 +13,8 @@
#include <util/system/sysstat.h>
#include <util/system/yassert.h>
-#include <utility>
-
+#include <utility>
+
/**
* Class behaviour is platform-dependent.
* It uses platform-dependent separators for path-reconstructing operations.
@@ -212,20 +212,20 @@ private:
mutable TSimpleIntrusivePtr<TSplit> Split_;
};
-namespace NPrivate {
- inline void AppendToFsPath(TFsPath&) {
- }
-
- template <class T, class... Ts>
- void AppendToFsPath(TFsPath& fsPath, const T& arg, Ts&&... args) {
- fsPath /= TFsPath(arg);
- AppendToFsPath(fsPath, std::forward<Ts>(args)...);
- }
-}
-
-template <class... Ts>
+namespace NPrivate {
+ inline void AppendToFsPath(TFsPath&) {
+ }
+
+ template <class T, class... Ts>
+ void AppendToFsPath(TFsPath& fsPath, const T& arg, Ts&&... args) {
+ fsPath /= TFsPath(arg);
+ AppendToFsPath(fsPath, std::forward<Ts>(args)...);
+ }
+}
+
+template <class... Ts>
TString JoinFsPaths(Ts&&... args) {
- TFsPath fsPath;
- ::NPrivate::AppendToFsPath(fsPath, std::forward<Ts>(args)...);
- return fsPath.GetPath();
-}
+ TFsPath fsPath;
+ ::NPrivate::AppendToFsPath(fsPath, std::forward<Ts>(args)...);
+ return fsPath.GetPath();
+}
diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp
index e6a3451016..9bec439442 100644
--- a/util/folder/path_ut.cpp
+++ b/util/folder/path_ut.cpp
@@ -396,17 +396,17 @@ Y_UNIT_TEST_SUITE(TFsPathTests) {
Y_UNIT_TEST(TestJoinFsPaths) {
#ifdef _win_
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", "c\\d"), "a\\b\\c\\d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", "..\\c"), "a\\b\\..\\c");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c", "d"), "a\\c\\d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a\\b\\c\\d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c"), "a\\b\\..\\c");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", "..\\c"), "a\\b\\..\\c");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c", "d"), "a\\c\\d");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a\\b\\c\\d");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c"), "a\\b\\..\\c");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", ""), "a\\b");
#else
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "c/d"), "a/b/c/d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "../c"), "a/b/../c");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c", "d"), "a/c/d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a/b/c/d");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c"), "a/b/../c");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "../c"), "a/b/../c");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c", "d"), "a/c/d");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a/b/c/d");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c"), "a/b/../c");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", ""), "a/b");
#endif
}