MCPcopy Create free account
hub / github.com/SmingHub/Sming / matchName

Function matchName

Sming/Core/DateTime.cpp:55–66  ·  view source on GitHub ↗

* @brief Match a day or month name against a list of values and set the required value * @param ptr Current string position * @param value On success, contains index of matched string * @isoNames Array of values * @nameCount Number of names in array * @retval bool false on failure * * Names are compared without case-sensitivity */

Source from the content-addressed store, hash-verified

53 * Names are compared without case-sensitivity
54 */
55bool matchName(const char*& ptr, uint8_t& value, const FourDigitName isoNames[], unsigned nameCount)
56{
57 FourDigitName name{{ptr[0], ptr[1], ptr[2]}};
58 for(unsigned i = 0; i < nameCount; ++i) {
59 if(isoNames[i] == name) {
60 value = i;
61 ptr += 3;
62 return true;
63 }
64 }
65 return false;
66}
67
68bool isLeapCentury(uint16_t year)
69{

Callers 1

fromHttpDateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected