mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
- metadata will be printed before node value, fixes #1678
This commit is contained in:
@@ -42,6 +42,8 @@ void JsonWriter::writeContainer(Iterator begin, Iterator end)
|
||||
|
||||
void JsonWriter::writeEntry(JsonMap::const_iterator entry)
|
||||
{
|
||||
if (!entry->second.meta.empty())
|
||||
out << prefix << " // " << entry->second.meta << "\n";
|
||||
out << prefix;
|
||||
writeString(entry->first);
|
||||
out << " : ";
|
||||
@@ -50,6 +52,8 @@ void JsonWriter::writeEntry(JsonMap::const_iterator entry)
|
||||
|
||||
void JsonWriter::writeEntry(JsonVector::const_iterator entry)
|
||||
{
|
||||
if (!entry->meta.empty())
|
||||
out << prefix << " // " << entry->meta << "\n";
|
||||
out << prefix;
|
||||
writeNode(*entry);
|
||||
}
|
||||
@@ -104,8 +108,6 @@ void JsonWriter::writeNode(const JsonNode &node)
|
||||
writeContainer(node.Struct().begin(), node.Struct().end());
|
||||
out << prefix << "}";
|
||||
}
|
||||
if (!node.meta.empty()) // write metainf as comment
|
||||
out << " //" << node.meta;
|
||||
}
|
||||
|
||||
JsonWriter::JsonWriter(std::ostream &output, const JsonNode &node):
|
||||
|
Reference in New Issue
Block a user