aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/string_utils
diff options
context:
space:
mode:
authorden <den@yandex-team.ru>2022-02-10 16:49:43 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:43 +0300
commit0beaf5069375bfa9589dbf4c281fbfcc7b11f71d (patch)
tree2a9075fe9636ba84e8db3369d5d39589cccac932 /library/cpp/string_utils
parent64b907678a38848c4af3d0270ccee688c5d7752c (diff)
downloadydb-0beaf5069375bfa9589dbf4c281fbfcc7b11f71d.tar.gz
Restoring authorship annotation for <den@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils')
-rw-r--r--library/cpp/string_utils/base64/base64.cpp2
-rw-r--r--library/cpp/string_utils/base64/base64_ut.cpp4
-rw-r--r--library/cpp/string_utils/quote/quote.cpp26
3 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/string_utils/base64/base64.cpp b/library/cpp/string_utils/base64/base64.cpp
index 05c201f0de..10469773b6 100644
--- a/library/cpp/string_utils/base64/base64.cpp
+++ b/library/cpp/string_utils/base64/base64.cpp
@@ -130,7 +130,7 @@ static inline char* Base64EncodeImpl(char* outstr, const unsigned char* instr, s
if (idx + 1 < len) {
*outstr++ = base64_etab[GetBase64EncodedIndex1(instr[idx], instr[idx + 1])];
*outstr++ = base64_etab[GetBase64EncodedIndex2(instr[idx + 1], '\0')];
- } else {
+ } else {
*outstr++ = base64_etab[GetBase64EncodedIndex1(instr[idx], '\0')];
*outstr++ = pad;
}
diff --git a/library/cpp/string_utils/base64/base64_ut.cpp b/library/cpp/string_utils/base64/base64_ut.cpp
index bcc1e65879..5512d896e8 100644
--- a/library/cpp/string_utils/base64/base64_ut.cpp
+++ b/library/cpp/string_utils/base64/base64_ut.cpp
@@ -8,7 +8,7 @@
#include <contrib/libs/base64/ssse3/libbase64.h>
#include <library/cpp/testing/unittest/registar.h>
-
+
#include <util/generic/vector.h>
#include <util/random/fast.h>
#include <util/system/cpu_id.h>
@@ -202,7 +202,7 @@ Y_UNIT_TEST_SUITE(TBase64) {
UNIT_ASSERT_VALUES_EQUAL(Base64Encode("12"), "MTI=");
UNIT_ASSERT_VALUES_EQUAL(Base64Encode("1"), "MQ==");
}
-
+
Y_UNIT_TEST(TestIntoString) {
{
TString str;
diff --git a/library/cpp/string_utils/quote/quote.cpp b/library/cpp/string_utils/quote/quote.cpp
index e523350b80..a685267d98 100644
--- a/library/cpp/string_utils/quote/quote.cpp
+++ b/library/cpp/string_utils/quote/quote.cpp
@@ -72,45 +72,45 @@ static inline const char* FixZero(const char* s) noexcept {
return s ? s : "";
}
-// we escape:
+// we escape:
// '\"', '|', '(', ')',
-// '%', '&', '+', ',',
+// '%', '&', '+', ',',
// '#', '<', '=', '>',
-// '[', '\\',']', '?',
+// '[', '\\',']', '?',
// ':', '{', '}',
-// all below ' ' (0x20) and above '~' (0x7E).
+// all below ' ' (0x20) and above '~' (0x7E).
// ' ' converted to '+'
-static const bool chars_to_url_escape[256] = {
+static const bool chars_to_url_escape[256] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //0
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //1
0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, //2
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, //3
-
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //4
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, //5
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //6
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, //7
-
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //8
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //9
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //A
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //B
-
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //C
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //D
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //E
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, //F
-};
-
+};
+
template <class It1, class It2, class It3>
static inline It1 Escape(It1 to, It2 from, It3 end, const bool* escape_map = chars_to_url_escape) {
while (from != end) {
if (escape_map[(unsigned char)*from]) {
- *to++ = '%';
+ *to++ = '%';
*to++ = d2x((unsigned char)*from >> 4);
*to++ = d2x((unsigned char)*from & 0xF);
- } else {
+ } else {
*to++ = (*from == ' ' ? '+' : *from);
}
@@ -121,7 +121,7 @@ static inline It1 Escape(It1 to, It2 from, It3 end, const bool* escape_map = cha
return to;
}
-
+
template <class It1, class It2, class It3, class FromHex>
static inline It1 Unescape(It1 to, It2 from, It3 end, FromHex fromHex) {
(void)fromHex;