void JsonWriter::Visit(const JsonArray &value) { *m_output << "["; string default_separator = ", "; if (value.IsComplexType()) { m_indent += DEFAULT_INDENT; *m_output << "\n" << string(m_indent, ' '); default_separator = ",\n"; default_separator.append(m_indent, ' '); } string separator; for (unsigned int i = 0; i < value.Size(); i++) { *m_output << separator; value.ElementAt(i)->Accept(this); separator = default_separator; } if (value.IsComplexType()) { *m_output << "\n"; m_indent -= DEFAULT_INDENT; *m_output << string(m_indent, ' '); } *m_output << "]"; }