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

Function UriEscape

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

Source from the content-addressed store, hash-verified

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