| 1011 | } |
| 1012 | |
| 1013 | Value HostsTable::CustomVariableNamesAccessor(const Value& row) |
| 1014 | { |
| 1015 | Host::Ptr host = static_cast<Host::Ptr>(row); |
| 1016 | |
| 1017 | if (!host) |
| 1018 | return Empty; |
| 1019 | |
| 1020 | Dictionary::Ptr vars = host->GetVars(); |
| 1021 | |
| 1022 | ArrayData result; |
| 1023 | |
| 1024 | if (vars) { |
| 1025 | ObjectLock olock(vars); |
| 1026 | for (const Dictionary::Pair& kv : vars) { |
| 1027 | result.push_back(kv.first); |
| 1028 | } |
| 1029 | } |
| 1030 | |
| 1031 | return new Array(std::move(result)); |
| 1032 | } |
| 1033 | |
| 1034 | Value HostsTable::CustomVariableValuesAccessor(const Value& row) |
| 1035 | { |