MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ProcessTimeRangeRaw

Method ProcessTimeRangeRaw

lib/icinga/legacytimeperiod.cpp:419–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void LegacyTimePeriod::ProcessTimeRangeRaw(const String& timerange, const tm *reference, tm *begin, tm *end)
420{
421 std::vector<String> times = timerange.Split("-");
422
423 if (times.size() != 2)
424 BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid timerange: " + timerange));
425
426 ProcessTimeRaw(times[0], reference, begin);
427 ProcessTimeRaw(times[1], reference, end);
428
429 if (begin->tm_hour * 3600 + begin->tm_min * 60 + begin->tm_sec >=
430 end->tm_hour * 3600 + end->tm_min * 60 + end->tm_sec)
431 end->tm_hour += 24;
432}
433
434Dictionary::Ptr LegacyTimePeriod::ProcessTimeRange(const String& timestamp, const tm *reference)
435{

Callers

nothing calls this directly

Calls 3

ProcessTimeRawFunction · 0.85
SplitMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected