| 481 | } |
| 482 | |
| 483 | int64_t parseMonthText(const char* cur, const char* end, Date& date) { |
| 484 | if ((end - cur) >= 3) { |
| 485 | auto it = monthMap.find(std::string_view(cur, 3)); |
| 486 | if (it != monthMap.end()) { |
| 487 | date.month = it->second.second; |
| 488 | if (end - cur >= it->second.first.size() + 3) { |
| 489 | if (std::strncmp( |
| 490 | cur + 3, it->second.first.data(), it->second.first.size()) == |
| 491 | 0) { |
| 492 | return it->second.first.size() + 3; |
| 493 | } |
| 494 | } |
| 495 | // If the suffix didn't match, still ok. Return a prefix match. |
| 496 | return 3; |
| 497 | } |
| 498 | } |
| 499 | return -1; |
| 500 | } |
| 501 | |
| 502 | int64_t parseDayOfWeekText(const char* cur, const char* end, Date& date) { |
| 503 | if ((end - cur) >= 3) { |
no test coverage detected