| 561 | } |
| 562 | |
| 563 | static bool parseStructFieldValue(const char*& input, const char* end, const CSVOption* option, |
| 564 | bool& closeBrack) { |
| 565 | uint64_t lvl = 0; |
| 566 | while (input < end) { |
| 567 | if (*input == '"' || *input == '\'') { |
| 568 | if (!skipToCloseQuotes(input, end)) { |
| 569 | return false; |
| 570 | } |
| 571 | } else if (*input == '{') { |
| 572 | if (!skipToClose(input, end, lvl, '}', option)) { |
| 573 | return false; |
| 574 | } |
| 575 | } else if (*input == CopyConstants::DEFAULT_CSV_LIST_BEGIN_CHAR) { |
| 576 | if (!skipToClose(input, end, ++lvl, CopyConstants::DEFAULT_CSV_LIST_END_CHAR, option)) { |
| 577 | return false; |
| 578 | } |
| 579 | } else if (*input == ',' || *input == '}') { |
| 580 | if (*input == '}') { |
| 581 | closeBrack = true; |
| 582 | } |
| 583 | return (lvl == 0); |
| 584 | } |
| 585 | input++; |
| 586 | } |
| 587 | return false; |
| 588 | } |
| 589 | |
| 590 | static bool tryCastStringToStruct(const char* input, uint64_t len, ValueVector* vector, |
| 591 | uint64_t rowToAdd, const CSVOption* option) { |
no test coverage detected