MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / quote

Function quote

lib/core/utils.cc:138–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138std::string quote(const std::string& s)
139{
140 bool spaces = s.find(' ') != std::string::npos;
141 if (!spaces && (s.find('\\') == std::string::npos) &&
142 (s.find('\'') == std::string::npos) &&
143 (s.find('"') == std::string::npos))
144 return s;
145
146 std::stringstream ss;
147 if (spaces)
148 ss << '"';
149
150 for (char c : s)
151 {
152 if ((c == '\\') || (c == '\"') || (c == '!'))
153 ss << '\\';
154 ss << (char)c;
155 }
156
157 if (spaces)
158 ss << '"';
159 return ss.str();
160}
161
162std::string unhex(const std::string& s)
163{

Callers 5

checkOptionValidMethod · 0.85
mainLsFunction · 0.85
mainGetFileInfoFunction · 0.85
mainGetDiskInfoFunction · 0.85
OnBrowserInfoButtonMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected