MCPcopy Create free account
hub / github.com/a2flo/floor / escape_string

Function escape_string

core/core.cpp:267–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267string escape_string(const string& str) {
268 if(str.size() == 0) return str;
269
270 string ret = str;
271 size_t pos = 0;
272 for(;;) {
273 if((pos = ret.find_first_of("\'\"\\", pos)) == string::npos) break;
274 ret.insert(pos, "\\");
275 pos += 2;
276 }
277 return ret;
278}
279
280map<string, file_io::FILE_TYPE> get_file_list(const string& directory,
281 const string file_extension,

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected