diff options
author | maslov <maslov@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
commit | 7429d8be0f619d00069466e159d8ecd43a60f61a (patch) | |
tree | ee12c5d6eea3a9caf55ff0a8dca140340ec15605 /library/cpp/cgiparam/cgiparam.cpp | |
parent | 6238988d0cc5068b8e6f61abe8dac4c6817720ad (diff) | |
download | ydb-7429d8be0f619d00069466e159d8ecd43a60f61a.tar.gz |
Restoring authorship annotation for <maslov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/cgiparam/cgiparam.cpp')
-rw-r--r-- | library/cpp/cgiparam/cgiparam.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/cgiparam/cgiparam.cpp b/library/cpp/cgiparam/cgiparam.cpp index f3277b8e4b..948f1060c3 100644 --- a/library/cpp/cgiparam/cgiparam.cpp +++ b/library/cpp/cgiparam/cgiparam.cpp @@ -28,8 +28,8 @@ bool TCgiParameters::Erase(const TStringBuf name, size_t pos) { } return false; -} - +} + bool TCgiParameters::Erase(const TStringBuf name, const TStringBuf val) { const auto pair = equal_range(name); @@ -82,17 +82,17 @@ void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf va static inline TString DoUnescape(const TStringBuf s) { TString res; - + res.reserve(CgiUnescapeBufLen(s.size())); res.ReserveAndResize(CgiUnescape(res.begin(), s).size()); return res; } - + void TCgiParameters::InsertEscaped(const TStringBuf name, const TStringBuf value) { InsertUnescaped(DoUnescape(name), DoUnescape(value)); } - + template <bool addAll, class F> static inline void DoScan(const TStringBuf s, F& f) { ScanKeyValue<addAll, '&', '='>(s, f); @@ -115,8 +115,8 @@ void TCgiParameters::ScanAdd(const TStringBuf query) { TAddEscaped f = {this}; DoScan<false>(query, f); -} - +} + void TCgiParameters::ScanAddUnescaped(const TStringBuf query) { auto f = [this](const TStringBuf key, const TStringBuf val) { this->InsertUnescaped(key, val); @@ -147,8 +147,8 @@ TString TCgiParameters::Print() const { res.ReserveAndResize(end - res.data()); return res; -} - +} + char* TCgiParameters::Print(char* res) const { if (empty()) { return res; @@ -214,8 +214,8 @@ TCgiParameters::const_iterator TCgiParameters::Find(const TStringBuf name, size_ } return end(); -} - +} + bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const noexcept { const auto pair = equal_range(name); @@ -226,7 +226,7 @@ bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const no } return false; -} +} TQuickCgiParam::TQuickCgiParam(const TStringBuf cgiParamStr) { UnescapeBuf.reserve(CgiUnescapeBufLen(cgiParamStr.size())); |