| 1032 | } |
| 1033 | |
| 1034 | Value HostsTable::CustomVariableValuesAccessor(const Value& row) |
| 1035 | { |
| 1036 | Host::Ptr host = static_cast<Host::Ptr>(row); |
| 1037 | |
| 1038 | if (!host) |
| 1039 | return Empty; |
| 1040 | |
| 1041 | Dictionary::Ptr vars = host->GetVars(); |
| 1042 | |
| 1043 | ArrayData result; |
| 1044 | |
| 1045 | if (vars) { |
| 1046 | ObjectLock olock(vars); |
| 1047 | for (const Dictionary::Pair& kv : vars) { |
| 1048 | if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>()) |
| 1049 | result.push_back(JsonEncode(kv.second)); |
| 1050 | else |
| 1051 | result.push_back(kv.second); |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | return new Array(std::move(result)); |
| 1056 | } |
| 1057 | |
| 1058 | Value HostsTable::CustomVariablesAccessor(const Value& row) |
| 1059 | { |