livestatus: join csv arrays into comma seperated string

refs #4374
This commit is contained in:
Michael Friedrich 2013-07-12 16:32:13 +02:00
parent 6dc88e770b
commit 1b5f4dcde7
1 changed files with 16 additions and 1 deletions

View File

@ -280,8 +280,23 @@ void Query::PrintResultSet(std::ostream& fp, const std::vector<String>& columns,
else
fp << ";";
if (value.IsObjectType<Array>()) {
bool first_inner = true;
Array::Ptr arr = static_cast<Array::Ptr>(value);
ObjectLock rlock(arr);
BOOST_FOREACH(const Value& arr_val, arr) {
if (first_inner)
first_inner = false;
else
fp << ",";
fp << Convert::ToString(arr_val);
}
} else {
fp << Convert::ToString(value);
}
}
fp << "\n";
}