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

Method SetFieldByName

lib/base/array.cpp:371–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void Array::SetFieldByName(const String& field, const Value& value, const DebugInfo& debugInfo)
372{
373 ObjectLock olock(this);
374
375 int index = Convert::ToLong(field);
376
377 if (index < 0)
378 BOOST_THROW_EXCEPTION(ScriptError("Array index '" + Convert::ToString(index) + "' is out of bounds.", debugInfo));
379
380 if (static_cast<size_t>(index) >= GetLength())
381 Resize(index + 1);
382
383 Set(index, value);
384}
385
386Array::Iterator icinga::begin(const Array::Ptr& x)
387{

Callers 4

SetMethod · 0.45
SetFieldMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 1

ScriptErrorClass · 0.85

Tested by

no test coverage detected