| 221 | } |
| 222 | |
| 223 | static bool skipToClose(const char*& input, const char* end, uint64_t& lvl, char target, |
| 224 | const CSVOption* option) { |
| 225 | input++; |
| 226 | while (input != end) { |
| 227 | if (*input == '\'') { |
| 228 | if (!skipToCloseQuotes(input, end)) { |
| 229 | return false; |
| 230 | } |
| 231 | } else if (*input == '{') { // must have closing brackets {, ] if they are not quoted |
| 232 | if (!skipToClose(input, end, lvl, '}', option)) { |
| 233 | return false; |
| 234 | } |
| 235 | } else if (*input == CopyConstants::DEFAULT_CSV_LIST_BEGIN_CHAR) { |
| 236 | if (!skipToClose(input, end, lvl, CopyConstants::DEFAULT_CSV_LIST_END_CHAR, option)) { |
| 237 | return false; |
| 238 | } |
| 239 | lvl++; // nested one more level |
| 240 | } else if (*input == target) { |
| 241 | if (target == CopyConstants::DEFAULT_CSV_LIST_END_CHAR) { |
| 242 | lvl--; |
| 243 | } |
| 244 | return true; |
| 245 | } |
| 246 | input++; |
| 247 | } |
| 248 | return false; // no corresponding closing bracket |
| 249 | } |
| 250 | |
| 251 | static bool isNull(std::string_view& str) { |
| 252 | auto start = str.data(); |
no test coverage detected