summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorEgor Kochetov <[email protected]>2022-02-10 16:50:36 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:50:36 +0300
commit40896b241c91572ea1369526ee1e6ae0ba340f34 (patch)
treecb6d8f482e66c136ec128a42417cd5f858520d12 /util
parent3889d4c01a589a555fbc33d66279be23e267ab3b (diff)
Restoring authorship annotation for Egor Kochetov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/stream/str.h14
-rw-r--r--util/stream/str_ut.cpp16
-rw-r--r--util/string/hex.h40
-rw-r--r--util/string/hex_ut.cpp2
-rw-r--r--util/string/subst_ut.cpp6
-rw-r--r--util/system/file.cpp10
6 files changed, 44 insertions, 44 deletions
diff --git a/util/stream/str.h b/util/stream/str.h
index 028bd572c03..6c43fe96077 100644
--- a/util/stream/str.h
+++ b/util/stream/str.h
@@ -143,13 +143,13 @@ public:
~TStringStream() override;
/**
- * @returns Whether @c this contains any data
- */
- explicit operator bool() const noexcept {
- return !Empty();
- }
-
- /**
+ * @returns Whether @c this contains any data
+ */
+ explicit operator bool() const noexcept {
+ return !Empty();
+ }
+
+ /**
* @returns String that this stream is writing into.
*/
inline TString& Str() noexcept {
diff --git a/util/stream/str_ut.cpp b/util/stream/str_ut.cpp
index fc6b46c31a4..a7d075d5fa4 100644
--- a/util/stream/str_ut.cpp
+++ b/util/stream/str_ut.cpp
@@ -67,15 +67,15 @@ Y_UNIT_TEST_SUITE(TStringInputOutputTest) {
UNIT_ASSERT_VALUES_EQUAL(string2, string1.substr(5));
}
-
+
Y_UNIT_TEST(OperatorBool) {
- TStringStream str;
- UNIT_ASSERT(!str);
- str << "data";
- UNIT_ASSERT(str);
- str.Clear();
- UNIT_ASSERT(!str);
- }
+ TStringStream str;
+ UNIT_ASSERT(!str);
+ str << "data";
+ UNIT_ASSERT(str);
+ str.Clear();
+ UNIT_ASSERT(!str);
+ }
Y_UNIT_TEST(TestReadTo) {
TString s("0123456789abc");
diff --git a/util/string/hex.h b/util/string/hex.h
index af3d2d528fa..0cef23cfff0 100644
--- a/util/string/hex.h
+++ b/util/string/hex.h
@@ -2,7 +2,7 @@
#include <util/generic/string.h>
#include <util/generic/yexception.h>
-#include <util/system/yassert.h>
+#include <util/system/yassert.h>
inline static char DigitToChar(unsigned char digit) {
if (digit < 10) {
@@ -20,7 +20,7 @@ inline static int Char2Digit(char ch) {
return result;
}
-//! Convert a hex string of exactly 2 chars to int
+//! Convert a hex string of exactly 2 chars to int
/*! @example String2Byte("10") => 16 */
inline static int String2Byte(const char* s) {
return Char2Digit(*s) * 16 + Char2Digit(*(s + 1));
@@ -34,26 +34,26 @@ inline TString HexEncode(const TStringBuf h) {
return HexEncode(h.data(), h.size());
}
-//! Convert a hex string @c in of @c len chars (case-insensitive) to array of ints stored at @c ptr and return this array.
-/*! @note len must be even (len % 2 == 0), otherwise an exception will be thrown.
- * @return @c ptr, which is an array of chars, where each char holds the numeric value
- * equal to the corresponding 2 digits of the input stream.
- * @warning You must ensure that @c ptr has (len/2) allocated bytes, otherwise SIGSEGV will happen.
- *
- * @example HexDecode("beef", 4, ptr) => {190, 239}
- */
-void* HexDecode(const void* in, size_t len, void* ptr);
-
-//! Convert a hex string @c in of @c len chars (case-insensitive) to array of ints and return this array.
-/*! @note len must be even (len % 2 == 0), otherwise an exception will be thrown.
- * @return an array of chars, where each char holds the numeric value equal to the corresponding 2 digits
- * of the input stream.
- *
- * @example HexDecode("beef", 4) => {190, 239}
- */
+//! Convert a hex string @c in of @c len chars (case-insensitive) to array of ints stored at @c ptr and return this array.
+/*! @note len must be even (len % 2 == 0), otherwise an exception will be thrown.
+ * @return @c ptr, which is an array of chars, where each char holds the numeric value
+ * equal to the corresponding 2 digits of the input stream.
+ * @warning You must ensure that @c ptr has (len/2) allocated bytes, otherwise SIGSEGV will happen.
+ *
+ * @example HexDecode("beef", 4, ptr) => {190, 239}
+ */
+void* HexDecode(const void* in, size_t len, void* ptr);
+
+//! Convert a hex string @c in of @c len chars (case-insensitive) to array of ints and return this array.
+/*! @note len must be even (len % 2 == 0), otherwise an exception will be thrown.
+ * @return an array of chars, where each char holds the numeric value equal to the corresponding 2 digits
+ * of the input stream.
+ *
+ * @example HexDecode("beef", 4) => {190, 239}
+ */
TString HexDecode(const void* in, size_t len);
-//! Convert an ASCII hex-string (case-insensitive) to the binary form. Note that h.Size() must be even (+h % 2 == 0).
+//! Convert an ASCII hex-string (case-insensitive) to the binary form. Note that h.Size() must be even (+h % 2 == 0).
inline TString HexDecode(const TStringBuf h) {
return HexDecode(h.data(), h.size());
}
diff --git a/util/string/hex_ut.cpp b/util/string/hex_ut.cpp
index 39a83d5e62b..33c9d9091b3 100644
--- a/util/string/hex_ut.cpp
+++ b/util/string/hex_ut.cpp
@@ -13,7 +13,7 @@ Y_UNIT_TEST_SUITE(THexCodingTest) {
Y_UNIT_TEST(TestDecodeCase) {
UNIT_ASSERT_EQUAL(HexDecode("12ABCDEF"), HexDecode("12abcdef"));
- UNIT_ASSERT_EXCEPTION(HexDecode("Hello"), yexception); //< incorrect chars
+ UNIT_ASSERT_EXCEPTION(HexDecode("Hello"), yexception); //< incorrect chars
UNIT_ASSERT_EXCEPTION(HexDecode("123"), yexception); //< odd length
}
}
diff --git a/util/string/subst_ut.cpp b/util/string/subst_ut.cpp
index 21eccef7795..5fcf91d4238 100644
--- a/util/string/subst_ut.cpp
+++ b/util/string/subst_ut.cpp
@@ -133,9 +133,9 @@ Y_UNIT_TEST_SUITE(TStringSubst) {
s = "abcdefbcbcdfb";
SubstGlobal(s, "bc", "bbc", 2);
UNIT_ASSERT_EQUAL(s, TString("abcdefbbcbbcdfb"));
- s = "Москва ~ Париж";
- SubstGlobal(s, " ~ ", " ");
- UNIT_ASSERT_EQUAL(s, TString("Москва Париж"));
+ s = "Москва ~ Париж";
+ SubstGlobal(s, " ~ ", " ");
+ UNIT_ASSERT_EQUAL(s, TString("Москва Париж"));
}
Y_UNIT_TEST(TestSubstGlobalOldRet) {
diff --git a/util/system/file.cpp b/util/system/file.cpp
index 4a261d020cb..7092c6c32fb 100644
--- a/util/system/file.cpp
+++ b/util/system/file.cpp
@@ -58,15 +58,15 @@
#define HAVE_SYNC_FILE_RANGE 0
#endif
-static bool IsStupidFlagCombination(EOpenMode oMode) {
- // ForAppend will actually not be applied in the following combinations:
+static bool IsStupidFlagCombination(EOpenMode oMode) {
+ // ForAppend will actually not be applied in the following combinations:
return (oMode & (CreateAlways | ForAppend)) == (CreateAlways | ForAppend) || (oMode & (TruncExisting | ForAppend)) == (TruncExisting | ForAppend) || (oMode & (CreateNew | ForAppend)) == (CreateNew | ForAppend);
-}
-
+}
+
TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
ui32 fcMode = 0;
EOpenMode createMode = oMode & MaskCreation;
- Y_VERIFY(!IsStupidFlagCombination(oMode), "oMode %d makes no sense", static_cast<int>(oMode));
+ Y_VERIFY(!IsStupidFlagCombination(oMode), "oMode %d makes no sense", static_cast<int>(oMode));
if (!(oMode & MaskRW)) {
oMode |= RdWr;
}