mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-14 02:35:09 +01:00
prefer std::string for setComment()
in case of embedded nulls
This commit is contained in:
parent
24682e37bf
commit
50069d72da
@ -512,6 +512,7 @@ Json::Value obj_value(Json::objectValue); // {}
|
|||||||
//# endif
|
//# endif
|
||||||
|
|
||||||
/// \deprecated Always pass len.
|
/// \deprecated Always pass len.
|
||||||
|
JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.")
|
||||||
void setComment(const char* comment, CommentPlacement placement);
|
void setComment(const char* comment, CommentPlacement placement);
|
||||||
/// Comments must be //... or /* ... */
|
/// Comments must be //... or /* ... */
|
||||||
void setComment(const char* comment, size_t len, CommentPlacement placement);
|
void setComment(const char* comment, size_t len, CommentPlacement placement);
|
||||||
|
@ -1542,7 +1542,7 @@ JSONTEST_FIXTURE(ValueTest, StaticString) {
|
|||||||
|
|
||||||
JSONTEST_FIXTURE(ValueTest, CommentBefore) {
|
JSONTEST_FIXTURE(ValueTest, CommentBefore) {
|
||||||
Json::Value val; // fill val
|
Json::Value val; // fill val
|
||||||
val.setComment("// this comment should appear before", Json::commentBefore);
|
val.setComment(std::string("// this comment should appear before"), Json::commentBefore);
|
||||||
Json::StreamWriterBuilder wbuilder;
|
Json::StreamWriterBuilder wbuilder;
|
||||||
wbuilder.settings_["commentStyle"] = "All";
|
wbuilder.settings_["commentStyle"] = "All";
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user