Skip to content

Suggestion: Support tabs for indentation when serializing to stream. #520

@timmcd69

Description

@timmcd69

With very slight modification to json.hpp, it can support setting the fill char on the output stream to '\t', and then using this fill char as the indent char instead of space. It works well, for example:

nlohman::json jsonval(...);
std::ofstream ofs(path);
ofs << std::setfill('\t') << std::setw(1) << jsonval;

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions