Example #1
0
json_string metashell::system_test::to_json_string(const frame& f_)
{
  rapidjson::StringBuffer buff;
  rapidjson::Writer<rapidjson::StringBuffer> w(buff);

  w.StartObject();

  w.Key("type");
  w.String("frame");

  w.Key("name");
  w.String(f_.name().name().c_str());

  if (f_.has_kind())
  {
    w.Key("kind");
    const std::string kind = to_string(f_.kind());
    w.String(kind.c_str());
  }

  w.EndObject();

  return json_string(buff.GetString());
}