| 395 | } |
| 396 | |
| 397 | static inline |
| 398 | void ProcessTimeRaw(const String& in, const tm *reference, tm *out) |
| 399 | { |
| 400 | *out = *reference; |
| 401 | |
| 402 | auto hd (in.Split(":")); |
| 403 | |
| 404 | switch (hd.size()) { |
| 405 | case 2: |
| 406 | out->tm_sec = 0; |
| 407 | break; |
| 408 | case 3: |
| 409 | out->tm_sec = Convert::ToLong(hd[2]); |
| 410 | break; |
| 411 | default: |
| 412 | BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid time specification: " + in)); |
| 413 | } |
| 414 | |
| 415 | out->tm_hour = Convert::ToLong(hd[0]); |
| 416 | out->tm_min = Convert::ToLong(hd[1]); |
| 417 | } |
| 418 | |
| 419 | void LegacyTimePeriod::ProcessTimeRangeRaw(const String& timerange, const tm *reference, tm *begin, tm *end) |
| 420 | { |
no test coverage detected