Example #1
0
std::pair<pt::ptree, Row> getSerializedRow(bool unordered_and_repeated) {
  Row r;
  ColumnNames cns = getSerializedRowColumnNames(unordered_and_repeated);
  pt::ptree arr;
  for (auto cn : cns) {
    std::string c_value = cn + "_value";
    r[cn] = c_value;
    arr.add<std::string>(cn, c_value);
  }
  return std::make_pair(arr, r);
}
Example #2
0
std::pair<JSON, Row> getSerializedRow(bool unordered_and_repeated) {
  auto cns = getSerializedRowColumnNames(unordered_and_repeated);

  Row r;
  auto doc = JSON::newObject();
  for (const auto& cn : cns) {
    auto c_value = cn + "_value";
    r[cn] = c_value;
    doc.addCopy(cn, c_value);
  }
  return std::make_pair(std::move(doc), r);
}