std::string SkillInfo::to_json(bool pretty) const { rapidjson::Document d; to_json_value(d, d); rapidjson::StringBuffer buffer; if (pretty) { rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buffer); d.Accept(writer); } else { rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); d.Accept(writer); } return buffer.GetString(); }
bool to_json_document(Document* d, const T& t, ParseStatus* status) { return to_json_value(d, &d->GetAllocator(), t, status); }