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

Method CustomVariableValuesAccessor

lib/livestatus/contactstable.cpp:203–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203Value ContactsTable::CustomVariableValuesAccessor(const Value& row)
204{
205 User::Ptr user = static_cast<User::Ptr>(row);
206
207 if (!user)
208 return Empty;
209
210 Dictionary::Ptr vars = user->GetVars();
211
212 ArrayData result;
213
214 if (vars) {
215 ObjectLock olock(vars);
216 for (const Dictionary::Pair& kv : vars) {
217 if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>())
218 result.push_back(JsonEncode(kv.second));
219 else
220 result.push_back(kv.second);
221 }
222 }
223
224 return new Array(std::move(result));
225}
226
227Value ContactsTable::CustomVariablesAccessor(const Value& row)
228{

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected