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

Function escape_string

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected