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

Function Quote

library/cpp/string_utils/quote/quote.cpp:183–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181
182template <class It1, class It2, class It3>
183static inline It1 Quote(It1 to, It2 from, It3 end, const char* safe) {
184 bool escape_map[256];
185 memcpy(escape_map, chars_to_url_escape, 256);
186 // RFC 3986 Uniform Resource Identifiers (URI): Generic Syntax
187 // lists following reserved characters:
188 const char* reserved = ":/?#[]@!$&\'()*+,;=";
189 for (const char* p = reserved; *p; ++p) {
190 escape_map[(unsigned char)*p] = true;
191 }
192 // characters we think are safe at the moment
193 for (const char* p = safe; *p; ++p) {
194 escape_map[(unsigned char)*p] = false;
195 }
196
197 return Escape(to, from, end, escape_map);
198}
199
200char* Quote(char* to, const char* from, const char* safe) {
201 return Quote(to, FixZero(from), TCStringEndIterator(), safe);

Callers 3

Y_UNIT_TESTFunction · 0.85
QuotedPrintMethod · 0.85
cow_string.hFile · 0.85

Calls 7

FixZeroFunction · 0.85
TCStringEndIteratorClass · 0.85
CgiEscapeBufLenFunction · 0.85
EscapeFunction · 0.70
dataMethod · 0.45
sizeMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected