Menu

Commit [r278]  Maximize  Restore  History

Comment reading/write improvements

This patch fixes some aspects of reading and writing comments:
- Multiple C++-style comments before a Json value had extra newlines appended to them. This patch removes the addition of those newlines.
- Comments written before Json values in the StyledWriter were not indented to match the indentation level of the value. This patch adds indentation to comments.
- Fixed inconsistency in newlines following C- and C++-style comments being saved as part of the comment. All newlines at the end of a comment are now removed.
- Added an additional test of comments.

https://sourceforge.net/p/jsoncpp/patches/25/

christopherdunn 2014-04-19

changed /trunk/jsoncpp/src/lib_json/json_reader.cpp
changed /trunk/jsoncpp/src/lib_json/json_writer.cpp
added /trunk/jsoncpp/test/data/test_comment_02.expected
added /trunk/jsoncpp/test/data/test_comment_02.json
/trunk/jsoncpp/src/lib_json/json_reader.cpp Diff Switch to side-by-side view
Loading...
/trunk/jsoncpp/src/lib_json/json_writer.cpp Diff Switch to side-by-side view
Loading...
/trunk/jsoncpp/test/data/test_comment_02.expected Diff Switch to side-by-side view
Loading...
/trunk/jsoncpp/test/data/test_comment_02.json Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.