MCPcopy Create free account
hub / github.com/apache/arrow / UriEscape

Function UriEscape

cpp/src/arrow/util/uri.cc:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59} // namespace
60
61std::string UriEscape(std::string_view s) {
62 if (s.empty()) {
63 // Avoid passing null pointer to uriEscapeExA
64 return std::string(s);
65 }
66 std::string escaped;
67 escaped.resize(3 * s.length());
68
69 auto end = uriEscapeExA(s.data(), s.data() + s.length(), &escaped[0],
70 /*spaceToPlus=*/URI_FALSE, /*normalizeBreaks=*/URI_FALSE);
71 escaped.resize(end - &escaped[0]);
72 return escaped;
73}
74
75std::string UriUnescape(std::string_view s) {
76 std::string result(s);

Callers 5

FormatValuesMethod · 0.85
EXPECT_OK_AND_ASSIGNFunction · 0.85
TEST_FFunction · 0.85
MakeUriMethod · 0.85
TESTFunction · 0.85

Calls 4

resizeMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45

Tested by 3

EXPECT_OK_AND_ASSIGNFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68