| 492 | // Split map of format: {a=12,b=13} |
| 493 | template<typename T> |
| 494 | static bool splitCStringMap(const char* input, uint64_t len, T& state, const CSVOption* option) { |
| 495 | auto end = input + len; |
| 496 | bool closeBracket = false; |
| 497 | |
| 498 | skipWhitespace(input, end); |
| 499 | if (input == end || *input != '{') { // start with { |
| 500 | return false; |
| 501 | } |
| 502 | skipWhitespace(++input, end); |
| 503 | if (input == end) { |
| 504 | return false; |
| 505 | } |
| 506 | if (*input == '}') { |
| 507 | skipWhitespace(++input, end); // empty |
| 508 | return input == end; |
| 509 | } |
| 510 | |
| 511 | while (input < end) { |
| 512 | if (!parseKeyOrValue(input, end, state, true, closeBracket, option)) { |
| 513 | return false; |
| 514 | } |
| 515 | skipWhitespace(++input, end); |
| 516 | if (!parseKeyOrValue(input, end, state, false, closeBracket, option)) { |
| 517 | return false; |
| 518 | } |
| 519 | skipWhitespace(++input, end); |
| 520 | if (closeBracket) { |
| 521 | return (input == end); |
| 522 | } |
| 523 | } |
| 524 | return false; |
| 525 | } |
| 526 | |
| 527 | template<> |
| 528 | void CastStringHelper::cast(const char* input, uint64_t len, map_entry_t& /*result*/, |
no test coverage detected