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

Function parseBUnit

plugins/thresholds.cpp:174–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174Bunit parseBUnit(const std::wstring& str)
175{
176 std::wstring wstr = to_upper_copy(str);
177
178 if (wstr == L"B")
179 return BunitB;
180 if (wstr == L"KB")
181 return BunitkB;
182 if (wstr == L"MB")
183 return BunitMB;
184 if (wstr == L"GB")
185 return BunitGB;
186 if (wstr == L"TB")
187 return BunitTB;
188
189 throw std::invalid_argument("Unknown unit type");
190}
191
192std::wstring BunitStr(const Bunit& unit)
193{

Callers 3

parseArgumentsFunction · 0.85
parseArgumentsFunction · 0.85
parseArgumentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected