ENH: tags.data writes one entry per line.

This makes it easier to compare and merge the tags file from different machines.

Signed-off-by: Quazgar <quazgar@posteo.de>
This commit is contained in:
Quazgar 2020-06-29 09:54:09 +02:00 committed by lauft
parent 13a116a301
commit ca10d52927

View file

@ -108,7 +108,7 @@ std::string TagInfoDatabase::toJson ()
std::stringstream json; std::stringstream json;
bool first = true; bool first = true;
json << "{"; json << "{\n";
for (auto& pair : _tagInformation) for (auto& pair : _tagInformation)
{ {
@ -116,15 +116,15 @@ std::string TagInfoDatabase::toJson ()
if (tagInfo.hasCount ()) if (tagInfo.hasCount ())
{ {
json << (first ? "" : ",") json << (first ? "" : ",\n")
<< "\"" << escape(pair.first, '"') << "\":" << " \"" << escape(pair.first, '"') << "\":"
<< tagInfo.toJson (); << tagInfo.toJson ();
first = (first ? false : first); first = (first ? false : first);
} }
} }
json << "}"; json << "\n}";
return json.str (); return json.str ();
} }