Пример #1
0
Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
{
	Command::Ptr command = static_cast<Command::Ptr>(row);

	if (!command)
		return Empty;

	Dictionary::Ptr vars = command->GetVars();

	ArrayData keys;

	if (vars) {
		ObjectLock xlock(vars);
		for (const auto& kv : vars) {
			keys.push_back(kv.second);
		}
	}

	return new Array(std::move(keys));
}
Пример #2
0
Value CommandsTable::CustomVariablesAccessor(const Value& row)
{
	Command::Ptr command = static_cast<Command::Ptr>(row);

	if (!command)
		return Empty;

	Dictionary::Ptr vars = command->GetVars();

	ArrayData result;

	if (vars) {
		ObjectLock xlock(vars);
		for (const auto& kv : vars) {
			result.push_back(new Array({
				kv.first,
				kv.second
			}));
		}
	}

	return new Array(std::move(result));
}