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

Function parseTUnit

plugins/thresholds.cpp:209–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209Tunit parseTUnit(const std::wstring& str) {
210 std::wstring wstr = to_lower_copy(str);
211
212 if (wstr == L"ms")
213 return TunitMS;
214 if (wstr == L"s")
215 return TunitS;
216 if (wstr == L"m")
217 return TunitM;
218 if (wstr == L"h")
219 return TunitH;
220
221 throw std::invalid_argument("Unknown unit type");
222}
223
224std::wstring TunitStr(const Tunit& unit)
225{

Callers 1

parseArgumentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected