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

Function ShellQuote

encoding/shell.cpp:16–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16std::string ShellQuote(const std::string& str, char quote_char)
17{
18 std::string result;
19 result += quote_char;
20 for (size_t i = 0; i < str.size(); ++i) {
21 if (str[i] == quote_char)
22 result += '\\';
23 result += str[i];
24 }
25 result += quote_char;
26 return result;
27}
28
29std::string ShellQuoteIfNeed(const std::string& str, char quote_char)
30{

Callers 2

TESTFunction · 0.85
ShellQuoteIfNeedFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68