Skip to content

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

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions