MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / addEscapes

Function addEscapes

src/function/export/export_csv_function.cpp:29–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27};
28
29static std::string addEscapes(char toEscape, char escape, const std::string& val) {
30 uint64_t i = 0;
31 std::string escapedStr = "";
32 auto found = val.find(toEscape);
33
34 while (found != std::string::npos) {
35 while (i < found) {
36 escapedStr += val[i];
37 i++;
38 }
39 escapedStr += escape;
40 found = val.find(toEscape, found + sizeof(escape));
41 }
42 while (i < val.length()) {
43 escapedStr += val[i];
44 i++;
45 }
46 return escapedStr;
47}
48
49static bool requireQuotes(const ExportCSVBindData& exportCSVBindData, const uint8_t* str,
50 uint64_t len, std::atomic<bool>& parallelFlag) {

Callers 1

writeStringFunction · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected