Create an overload of the `to_string` member function that handles indentation (spaces) and line breaks. ``` cpp const std::string to_string(int indent) const noexcept ```
Activity
sillykelvin commentedon Jan 6, 2015
Yeah, I think this is needed when saving a json object to file, it is a great mess if there is no indentation and line breaks.
implemented pretty printing (issue #13)
nlohmann commentedon Jan 6, 2015
I implemented a pretty-printing serialization. For that, I renamed the function
to_string()todump()and used the syntax of Pythonsjson.dumps()(see https://docs.python.org/2/library/json.html#json.dump).This function takes an integer as parameter:
Merge pull request nlohmann#13 from nlohmann/develop
Merge main into merge_to_eclipse-score (#13)