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

Function requireQuotes

src/function/export/export_csv_function.cpp:49–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static bool requireQuotes(const ExportCSVBindData& exportCSVBindData, const uint8_t* str,
50 uint64_t len, std::atomic<bool>& parallelFlag) {
51 // Check if the string is equal to the null string.
52 if (len == strlen(ExportCSVConstants::DEFAULT_NULL_STR) &&
53 memcmp(str, ExportCSVConstants::DEFAULT_NULL_STR, len) == 0) {
54 return true;
55 }
56 for (auto i = 0u; i < len; i++) {
57 if (str[i] == ExportCSVConstants::DEFAULT_CSV_NEWLINE[0] ||
58 str[i] == ExportCSVConstants::DEFAULT_CSV_NEWLINE[1]) {
59 parallelFlag.store(false, std::memory_order_relaxed);
60 return true;
61 }
62 if (str[i] == exportCSVBindData.exportOption.quoteChar ||
63 str[i] == exportCSVBindData.exportOption.delimiter) {
64 return true;
65 }
66 }
67 return false;
68}
69
70static void writeString(BufferWriter* serializer, const ExportFuncBindData& bindData,
71 const uint8_t* strData, uint64_t strLen, bool forceQuote, std::atomic<bool>& parallelFlag) {

Callers 1

writeStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected