File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ String JSON_API valueToString(
354
354
PrecisionType precisionType = PrecisionType::significantDigits);
355
355
String JSON_API valueToString (bool value);
356
356
String JSON_API valueToQuotedString (const char * value);
357
+ String JSON_API valueToQuotedString (const char * value, size_t length);
357
358
358
359
// / \brief Output using the StyledStreamWriter.
359
360
// / \see Json::operator>>()
Original file line number Diff line number Diff line change @@ -353,6 +353,10 @@ String valueToQuotedString(const char* value) {
353
353
return valueToQuotedStringN (value, strlen (value));
354
354
}
355
355
356
+ String valueToQuotedString (const char * value, size_t length) {
357
+ return valueToQuotedStringN (value, length);
358
+ }
359
+
356
360
// Class Writer
357
361
// //////////////////////////////////////////////////////////////////
358
362
Writer::~Writer () = default ;
@@ -490,7 +494,7 @@ void StyledWriter::writeValue(const Value& value) {
490
494
const String& name = *it;
491
495
const Value& childValue = value[name];
492
496
writeCommentBeforeValue (childValue);
493
- writeWithIndent (valueToQuotedString (name.c_str ()));
497
+ writeWithIndent (valueToQuotedString (name.c_str (),name. size () ));
494
498
document_ += " : " ;
495
499
writeValue (childValue);
496
500
if (++it == members.end ()) {
@@ -708,7 +712,7 @@ void StyledStreamWriter::writeValue(const Value& value) {
708
712
const String& name = *it;
709
713
const Value& childValue = value[name];
710
714
writeCommentBeforeValue (childValue);
711
- writeWithIndent (valueToQuotedString (name.c_str ()));
715
+ writeWithIndent (valueToQuotedString (name.c_str (),name. size () ));
712
716
*document_ << " : " ;
713
717
writeValue (childValue);
714
718
if (++it == members.end ()) {
You can’t perform that action at this time.
0 commit comments