MCPcopy Create free account
hub / github.com/chen3feng/toft / DoEncodeAppend

Function DoEncodeAppend

encoding/percent.cpp:27–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27static void DoEncodeAppend(
28 const StringPiece& input,
29 const ByteSet& unchanged,
30 std::string* output)
31{
32 for (size_t i = 0; i < input.size(); ++i) {
33 if (unchanged.Find((uint8_t)input[i]))
34 {
35 output->push_back(input[i]);
36 } else {
37 output->push_back('%');
38 output->push_back(CharToHex((uint8_t)input[i] >> 4));
39 output->push_back(CharToHex((uint8_t)input[i] % 16));
40 }
41 }
42}
43
44///////////////////////////////////////////////////////////////////////////
45// encode

Callers 3

EncodeAppendMethod · 0.85
EncodeUriAppendMethod · 0.85

Calls 4

CharToHexFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected