| 458 | |
| 459 | template<typename T> |
| 460 | static bool parseKeyOrValue(const char*& input, const char* end, T& state, bool isKey, |
| 461 | bool& closeBracket, const CSVOption* option) { |
| 462 | auto start = input; |
| 463 | uint64_t lvl = 0; |
| 464 | |
| 465 | while (input < end) { |
| 466 | if (*input == '"' || *input == '\'') { |
| 467 | if (!skipToCloseQuotes(input, end)) { |
| 468 | return false; |
| 469 | } |
| 470 | } else if (*input == '{') { |
| 471 | if (!skipToClose(input, end, lvl, '}', option)) { |
| 472 | return false; |
| 473 | } |
| 474 | } else if (*input == CopyConstants::DEFAULT_CSV_LIST_BEGIN_CHAR) { |
| 475 | if (!skipToClose(input, end, lvl, CopyConstants::DEFAULT_CSV_LIST_END_CHAR, option)) { |
| 476 | return false; |
| 477 | } |
| 478 | } else if (isKey && *input == '=') { |
| 479 | return state.handleKey(start, input, option); |
| 480 | } else if (!isKey && (*input == ',' || *input == '}')) { |
| 481 | state.handleValue(start, input, option); |
| 482 | if (*input == '}') { |
| 483 | closeBracket = true; |
| 484 | } |
| 485 | return true; |
| 486 | } |
| 487 | input++; |
| 488 | } |
| 489 | return false; |
| 490 | } |
| 491 | |
| 492 | // Split map of format: {a=12,b=13} |
| 493 | template<typename T> |
no test coverage detected