MCPcopy Create free account
hub / github.com/bytedance/bolt / parseDayOfWeekText

Function parseDayOfWeekText

bolt/functions/lib/DateTimeFormatter.cpp:502–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502int64_t parseDayOfWeekText(const char* cur, const char* end, Date& date) {
503 if ((end - cur) >= 3) {
504 auto it = dayOfWeekMap.find(std::string_view(cur, 3));
505 if (it != dayOfWeekMap.end()) {
506 date.dayOfWeek = it->second.second;
507 if (end - cur >= it->second.first.size() + 3) {
508 if (std::strncmp(
509 cur + 3, it->second.first.data(), it->second.first.size()) ==
510 0) {
511 return it->second.first.size() + 3;
512 }
513 }
514 return 3;
515 }
516 }
517 return -1;
518}
519
520int64_t parseHalfDayOfDay(const char* cur, const char* end, Date& date) {
521 if ((end - cur) >= 2) {

Callers 1

parseFromPatternFunction · 0.85

Calls 4

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected