aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/uri/encode.cpp
diff options
context:
space:
mode:
authortrifon <trifon@yandex-team.ru>2022-02-10 16:50:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:51 +0300
commite3135d62bbcf321d86fff8258f5cdc5b2f57bde5 (patch)
treea5eeb758718dafefc9e215dae39f45cb61309f34 /library/cpp/uri/encode.cpp
parent252a6c9fbded23dfee8729dc34c97159962216a7 (diff)
downloadydb-e3135d62bbcf321d86fff8258f5cdc5b2f57bde5.tar.gz
Restoring authorship annotation for <trifon@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/uri/encode.cpp')
-rw-r--r--library/cpp/uri/encode.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/uri/encode.cpp b/library/cpp/uri/encode.cpp
index 584fb1bac9..34ca130ab8 100644
--- a/library/cpp/uri/encode.cpp
+++ b/library/cpp/uri/encode.cpp
@@ -1,7 +1,7 @@
#include "encode.h"
-
+
#include <util/generic/singleton.h>
-
+
namespace NUri {
namespace NEncode {
// http://tools.ietf.org/html/rfc3986#section-2.2
@@ -9,9 +9,9 @@ namespace NUri {
#define SUBDELIMS0 "!$&'()*+,;="
// http://tools.ietf.org/html/rfc3986#section-2.3
#define UNRESERVED "-._~"
-
+
// now find subsets which can sometimes be decoded
-
+
// remove '#' which can't ever be decoded
// don't mark anything allowed for pass (pass is completely encoded)
// safe in path, qry, frag
@@ -73,7 +73,7 @@ namespace NUri {
GetMutable('&').EncodeFld |= TField::FlagQuery;
GetMutable('+').EncodeFld |= TField::FlagQuery;
}
-
+
// should we decode an encoded character
bool TCharFlags::IsDecode(ui32 fldmask, ui64 flags) const {
const ui64 myflags = flags & FeatFlags;
@@ -162,7 +162,7 @@ namespace NUri {
Encode(out, val[i]);
return out;
}
-
+
IOutputStream& TEncoder::EncodeNotAlnum(IOutputStream& out, const TStringBuf& val) {
for (size_t i = 0; i != val.length(); ++i) {
const char c = val[i];
@@ -186,7 +186,7 @@ namespace NUri {
}
return out;
}
-
+
IOutputStream& TEncoder::EncodeField(
IOutputStream& out, const TStringBuf& val, TField::EField fld, ui64 flags) {
const ui32 fldmask = ui32(1) << fld;
@@ -199,10 +199,10 @@ namespace NUri {
}
return out;
}
-
+
void TEncoder::Do(unsigned char ch, int res) {
OutFlags |= GetFlags(ch).FeatFlags;
-
+
bool escapepct = false;
if (0 < res) // definitely encode
escapepct = FldDst.Enabled();
@@ -217,4 +217,4 @@ namespace NUri {
Hex(Out, ch);
}
}
-}
+}