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

Function ProcessTimeRaw

lib/icinga/legacytimeperiod.cpp:397–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397static inline
398void 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
419void LegacyTimePeriod::ProcessTimeRangeRaw(const String& timerange, const tm *reference, tm *begin, tm *end)
420{

Callers 1

ProcessTimeRangeRawMethod · 0.85

Calls 2

SplitMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected