More compact JSON formatting.
This commit is contained in:
parent
7eaf7764f7
commit
a8e86c3530
6 changed files with 16 additions and 5 deletions
|
@ -56,6 +56,8 @@ bool xmrig::Json::save(const char *fileName, const rapidjson::Document &doc)
|
|||
|
||||
rapidjson::OStreamWrapper osw(ofs);
|
||||
rapidjson::PrettyWriter<rapidjson::OStreamWrapper> writer(osw);
|
||||
writer.SetFormatOptions(rapidjson::kFormatSingleLineArray);
|
||||
|
||||
doc.Accept(writer);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -118,6 +118,8 @@ bool xmrig::Json::save(const char *fileName, const rapidjson::Document &doc)
|
|||
|
||||
OStreamWrapper osw(ofs);
|
||||
PrettyWriter<OStreamWrapper> writer(osw);
|
||||
writer.SetFormatOptions(kFormatSingleLineArray);
|
||||
|
||||
doc.Accept(writer);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -80,6 +80,8 @@ void xmrig::HttpApiResponse::end()
|
|||
StringBuffer buffer(nullptr, 4096);
|
||||
PrettyWriter<StringBuffer> writer(buffer);
|
||||
writer.SetMaxDecimalPlaces(10);
|
||||
writer.SetFormatOptions(kFormatSingleLineArray);
|
||||
|
||||
m_doc.Accept(writer);
|
||||
|
||||
HttpResponse::end(buffer.GetString(), buffer.GetSize());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue