| 55 | } |
| 56 | |
| 57 | int CRaceHelper::TimeFromStr(const char *pStr) |
| 58 | { |
| 59 | static constexpr const char *MINUTES_STR = " minute(s) "; |
| 60 | static constexpr const char *SECONDS_STR = " second(s)"; |
| 61 | |
| 62 | const char *pSeconds = str_find(pStr, SECONDS_STR); |
| 63 | if(!pSeconds) |
| 64 | return -1; |
| 65 | |
| 66 | const char *pMinutes = str_find(pStr, MINUTES_STR); |
| 67 | if(pMinutes) |
| 68 | { |
| 69 | while(*pStr == ' ') // skip leading spaces |
| 70 | pStr++; |
| 71 | int SecondsTime = TimeFromSecondsStr(pMinutes + str_length(MINUTES_STR)); |
| 72 | if(SecondsTime == -1 || !isdigit(*pStr)) |
| 73 | return -1; |
| 74 | return str_toint(pStr) * 60 * 1000 + SecondsTime; |
| 75 | } |
| 76 | else |
| 77 | return TimeFromSecondsStr(pStr); |
| 78 | } |
| 79 | |
| 80 | int CRaceHelper::TimeFromFinishMessage(const char *pStr, char *pNameBuf, int NameBufSize) |
| 81 | { |
nothing calls this directly
no test coverage detected