aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder
diff options
context:
space:
mode:
authorspacelord <spacelord@yandex-team.ru>2022-02-10 16:48:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:15 +0300
commit16747e4f77455cca4932df21eb76f12cb0a97a5c (patch)
tree4dd6da4102d99d0d69dec53c1050d290a850a9f2 /util/folder
parenta817f5de12611ec73085eba17f8ec7740a46bdb7 (diff)
downloadydb-16747e4f77455cca4932df21eb76f12cb0a97a5c.tar.gz
Restoring authorship annotation for <spacelord@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r--util/folder/dirut.cpp30
-rw-r--r--util/folder/iterator.h2
-rw-r--r--util/folder/path.cpp4
-rw-r--r--util/folder/path.h12
-rw-r--r--util/folder/path_ut.cpp2
-rw-r--r--util/folder/pathsplit.cpp32
-rw-r--r--util/folder/pathsplit.h4
7 files changed, 43 insertions, 43 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp
index ffc9b09f96..72cb802a9c 100644
--- a/util/folder/dirut.cpp
+++ b/util/folder/dirut.cpp
@@ -124,13 +124,13 @@ bool resolvepath(TString& folder, const TString& home) {
#else
-using dir_type = enum {
- dt_empty,
- dt_error,
- dt_up,
- dt_dir
-};
-
+using dir_type = enum {
+ dt_empty,
+ dt_error,
+ dt_up,
+ dt_dir
+};
+
// precondition: *ptr != '\\' || *ptr == 0 (cause dt_error)
// postcondition: *ptr != '\\'
template <typename T>
@@ -181,14 +181,14 @@ static int next_dir(T*& ptr) {
return dt_error;
}
-using disk_type = enum {
- dk_noflags = 0,
- dk_unc = 1,
- dk_hasdrive = 2,
- dk_fromroot = 4,
- dk_error = 8
-};
-
+using disk_type = enum {
+ dk_noflags = 0,
+ dk_unc = 1,
+ dk_hasdrive = 2,
+ dk_fromroot = 4,
+ dk_error = 8
+};
+
// root slash (if any) - part of disk
template <typename T>
static int skip_disk(T*& ptr) {
diff --git a/util/folder/iterator.h b/util/folder/iterator.h
index 69e025b9c4..3463d87b50 100644
--- a/util/folder/iterator.h
+++ b/util/folder/iterator.h
@@ -25,7 +25,7 @@ public:
}
};
- using TCompare = int (*)(const FTSENT**, const FTSENT**);
+ using TCompare = int (*)(const FTSENT**, const FTSENT**);
struct TOptions {
inline TOptions() {
diff --git a/util/folder/path.cpp b/util/folder/path.cpp
index bfe0c67d68..02e9883171 100644
--- a/util/folder/path.cpp
+++ b/util/folder/path.cpp
@@ -164,8 +164,8 @@ TString TFsPath::GetName() const {
TString TFsPath::GetExtension() const {
return TString(GetSplit().Extension());
-}
-
+}
+
bool TFsPath::IsAbsolute() const {
return GetSplit().IsAbsolute;
}
diff --git a/util/folder/path.h b/util/folder/path.h
index 2fb4d6b4ef..e2ccac8775 100644
--- a/util/folder/path.h
+++ b/util/folder/path.h
@@ -78,13 +78,13 @@ public:
/// last component of path, or "/" if root
TString GetName() const;
- /**
- * "a.b.tmp" -> "tmp"
- * "a.tmp" -> "tmp"
- * ".tmp" -> ""
- */
+ /**
+ * "a.b.tmp" -> "tmp"
+ * "a.tmp" -> "tmp"
+ * ".tmp" -> ""
+ */
TString GetExtension() const;
-
+
bool IsAbsolute() const;
bool IsRelative() const;
diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp
index e6a3451016..d79b8da97c 100644
--- a/util/folder/path_ut.cpp
+++ b/util/folder/path_ut.cpp
@@ -137,7 +137,7 @@ Y_UNIT_TEST_SUITE(TFsPathTests) {
UNIT_ASSERT_VALUES_EQUAL("zlib", d.Child("file.zlib").GetExtension());
UNIT_ASSERT_VALUES_EQUAL("zlib", d.Child("file.ylib.zlib").GetExtension());
}
-
+
Y_UNIT_TEST(TestRename) {
TTestDirectory xx("TestRename");
TFsPath f1 = xx.Child("f1");
diff --git a/util/folder/pathsplit.cpp b/util/folder/pathsplit.cpp
index 81d439a727..7c6414749e 100644
--- a/util/folder/pathsplit.cpp
+++ b/util/folder/pathsplit.cpp
@@ -118,9 +118,9 @@ void TPathSplitStore::AppendComponent(const TStringBuf comp) {
}
TStringBuf TPathSplitStore::Extension() const {
- return size() > 0 ? CutExtension(back()) : TStringBuf();
-}
-
+ return size() > 0 ? CutExtension(back()) : TStringBuf();
+}
+
template <>
void Out<TPathSplit>(IOutputStream& o, const TPathSplit& ps) {
o << ps.Reconstruct();
@@ -133,19 +133,19 @@ TString JoinPaths(const TPathSplit& p1, const TPathSplit& p2) {
return TPathSplit(p1).AppendMany(p2.begin(), p2.end()).Reconstruct();
}
-
+
TStringBuf CutExtension(const TStringBuf fileName) {
if (fileName.empty()) {
- return fileName;
- }
-
- TStringBuf name;
- TStringBuf extension;
- fileName.RSplit('.', name, extension);
+ return fileName;
+ }
+
+ TStringBuf name;
+ TStringBuf extension;
+ fileName.RSplit('.', name, extension);
if (name.empty()) {
- // dot at a start or not found
- return name;
- } else {
- return extension;
- }
-}
+ // dot at a start or not found
+ return name;
+ } else {
+ return extension;
+ }
+}
diff --git a/util/folder/pathsplit.h b/util/folder/pathsplit.h
index d134338e35..d40e81b0d1 100644
--- a/util/folder/pathsplit.h
+++ b/util/folder/pathsplit.h
@@ -91,7 +91,7 @@ public:
return *this;
}
-
+
template <class It>
inline TPathSplitBase& AppendMany(It b, It e) {
this->AppendHint(e - b);
@@ -109,5 +109,5 @@ using TPathSplitUnix = TPathSplitBase<TPathSplitTraitsUnix>;
using TPathSplitWindows = TPathSplitBase<TPathSplitTraitsWindows>;
TString JoinPaths(const TPathSplit& p1, const TPathSplit& p2);
-
+
TStringBuf CutExtension(const TStringBuf fileName);