18 long parse10(
char const * & p1,
char * & p2,
char const * msg)
20 long v = std::strtol(p1, &p2, 10);
37 char const * p1 = buf;
41 long year = 1900, month = 1, day = 1;
42 long hour = 0, minute = 0, second = 0;
44 char const * errMsg =
"Cannot convert data to std::tm.";
46 a = parse10(p1, p2, errMsg);
48 b = parse10(p1, p2, errMsg);
49 c = parse10(p1, p2, errMsg);
59 hour = parse10(p1, p2, errMsg);
60 minute = parse10(p1, p2, errMsg);
61 second = parse10(p1, p2, errMsg);
85 t.tm_year = year - 1900;
99 int const converted = sscanf(buf,
"%lf%n", &t, &n);
100 if (converted == 1 && static_cast<std::size_t>(n) == strlen(buf))
void parse_std_tm(char const *buf, std::tm &t)
double string_to_double(char const *buf)