MCPcopy Create free account
hub / github.com/catboost/catboost / Escape

Function Escape

library/cpp/string_utils/quote/quote.cpp:105–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104template <class It1, class It2, class It3>
105static inline It1 Escape(It1 to, It2 from, It3 end, const bool* escape_map = chars_to_url_escape) {
106 while (from != end) {
107 if (escape_map[(unsigned char)*from]) {
108 *to++ = '%';
109 *to++ = d2x((unsigned char)*from >> 4);
110 *to++ = d2x((unsigned char)*from & 0xF);
111 } else {
112 *to++ = (*from == ' ' ? '+' : *from);
113 }
114
115 ++from;
116 }
117
118 *to = 0;
119
120 return to;
121}
122
123template <class It1, class It2, class It3, class FromHex>
124static inline It1 Unescape(It1 to, It2 from, It3 end, FromHex fromHex) {

Callers 5

CGIEscapeFunction · 0.70
QuoteFunction · 0.70
BenchEncodeFunction · 0.50
BenchEncodeUrlFunction · 0.50
BenchDecodeFunction · 0.50

Calls 1

d2xFunction · 0.85

Tested by

no test coverage detected