MCPcopy Create free account
hub / github.com/apache/cloudberry / UriEncode

Function UriEncode

gpcontrib/gpcloud/src/s3utils.cpp:286–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284 /* F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
285
286string UriEncode(const string &src) {
287 auto srcStr = src.begin();
288
289 string retStr;
290
291 const char uriRmapping[16 + 1] = "0123456789ABCDEF";
292
293 while (srcStr != src.end()) {
294 char c = *srcStr;
295 if (UriReserved[(int)c]) {
296 retStr.push_back(c);
297 } else {
298 retStr.push_back('%');
299 retStr.push_back(uriRmapping[c >> 4]);
300 retStr.push_back(uriRmapping[c & 0x0F]);
301 }
302
303 srcStr++;
304 }
305
306 return retStr;
307}
308
309string UriDecode(const string &src) {
310 signed char dec1, dec2;

Callers 4

TESTFunction · 0.85
constructReaderParamsMethod · 0.85
listBucketMethod · 0.85
extractEncodedPrefixMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68