Escape the contents of object keys when writing JSON

This commit is contained in:
Thomas Goyne 2013-05-27 07:42:42 -07:00
parent 7deca9f43c
commit ad695cf0a5

View file

@ -61,7 +61,9 @@ void Writer::Write(Object const& object) {
Object::const_iterator it(object.begin()), itend(object.end());
while (it != itend) {
m_ostr << std::string(tab_depth, '\t') << '"' << it->first << "\" : ";
m_ostr << std::string(tab_depth, '\t');
Write(it->first);
m_ostr << " : ";
Write(it->second);
if (++it != itend)