MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / urlEncodeQueryParam

Function urlEncodeQueryParam

src/Client/BuzzHouse/Generator/FuzzConfig.cpp:39–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39String urlEncodeQueryParam(const String & s)
40{
41 String out;
42 out.reserve(s.size() * 3);
43 for (const unsigned char c : s)
44 {
45 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '-' || c == '_' || c == '.' || c == '~')
46 {
47 out += static_cast<char>(c);
48 }
49 else if (c == ' ')
50 {
51 out += '+';
52 }
53 else
54 {
55 static constexpr const char hex[] = "0123456789ABCDEF";
56 out += '%';
57 out += hex[c >> 4];
58 out += hex[c & 0xF];
59 }
60 }
61 return out;
62}
63
64void SystemTable::setName(ExprSchemaTable * est) const
65{

Callers 2

tableOrFunctionRefMethod · 0.85
joinedTableOrFunctionMethod · 0.85

Calls 2

reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected