mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
jsoncpp: update to current version 1.8.3
Origin commit data
------------------
Branch: ni/coolstream
Commit: 9f6e78974b
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-09-21 (Thu, 21 Sep 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -10,13 +10,13 @@ The JsonCpp library's source code, including accompanying documentation,
|
||||
tests and demonstration applications, are licensed under the following
|
||||
conditions...
|
||||
|
||||
The author (Baptiste Lepilleur) explicitly disclaims copyright in all
|
||||
Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
|
||||
jurisdictions which recognize such a disclaimer. In such jurisdictions,
|
||||
this software is released into the Public Domain.
|
||||
|
||||
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
|
||||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
|
||||
released under the terms of the MIT License (see below).
|
||||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
|
||||
The JsonCpp Authors, and is released under the terms of the MIT License (see below).
|
||||
|
||||
In jurisdictions which recognize Public Domain property, the user of this
|
||||
software may choose to accept it either as 1) Public Domain, 2) under the
|
||||
@@ -31,7 +31,7 @@ described in clear, concise terms at:
|
||||
The full text of the MIT License follows:
|
||||
|
||||
========================================================================
|
||||
Copyright (c) 2007-2010 Baptiste Lepilleur
|
||||
Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
@@ -84,7 +84,7 @@ license you like.
|
||||
// Beginning of content of file: src/lib_json/json_tool.h
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2007-2010 Baptiste Lepilleur
|
||||
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
@@ -215,7 +215,7 @@ static inline void fixNumericLocaleInput(char* begin, char* end) {
|
||||
// Beginning of content of file: src/lib_json/json_reader.cpp
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2007-2011 Baptiste Lepilleur
|
||||
// Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors
|
||||
// Copyright (C) 2016 InfoTeCS JSC. All rights reserved.
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
@@ -229,7 +229,7 @@ static inline void fixNumericLocaleInput(char* begin, char* end) {
|
||||
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||
#include <utility>
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
//#include <cassert>
|
||||
#include <cstring>
|
||||
#include <istream>
|
||||
#include <sstream>
|
||||
@@ -298,7 +298,7 @@ Features Features::strictMode() {
|
||||
// Implementation of class Reader
|
||||
// ////////////////////////////////
|
||||
|
||||
static bool containsNewLine(Reader::Location begin, Reader::Location end) {
|
||||
bool Reader::containsNewLine(Reader::Location begin, Reader::Location end) {
|
||||
for (; begin < end; ++begin)
|
||||
if (*begin == '\n' || *begin == '\r')
|
||||
return true;
|
||||
@@ -320,8 +320,7 @@ Reader::Reader(const Features& features)
|
||||
|
||||
bool
|
||||
Reader::parse(const std::string& document, Value& root, bool collectComments) {
|
||||
JSONCPP_STRING documentCopy(document.data(), document.data() + document.capacity());
|
||||
std::swap(documentCopy, document_);
|
||||
document_.assign(document.begin(), document.end());
|
||||
const char* begin = document_.c_str();
|
||||
const char* end = begin + document_.length();
|
||||
return parse(begin, end, root, collectComments);
|
||||
@@ -354,7 +353,7 @@ bool Reader::parse(const char* beginDoc,
|
||||
current_ = begin_;
|
||||
lastValueEnd_ = 0;
|
||||
lastValue_ = 0;
|
||||
commentsBefore_ = "";
|
||||
commentsBefore_.clear();
|
||||
errors_.clear();
|
||||
while (!nodes_.empty())
|
||||
nodes_.pop();
|
||||
@@ -393,7 +392,7 @@ bool Reader::readValue() {
|
||||
|
||||
if (collectComments_ && !commentsBefore_.empty()) {
|
||||
currentValue().setComment(commentsBefore_, commentBefore);
|
||||
commentsBefore_ = "";
|
||||
commentsBefore_.clear();
|
||||
}
|
||||
|
||||
switch (token.type_) {
|
||||
@@ -587,7 +586,7 @@ bool Reader::readComment() {
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSONCPP_STRING normalizeEOL(Reader::Location begin, Reader::Location end) {
|
||||
JSONCPP_STRING Reader::normalizeEOL(Reader::Location begin, Reader::Location end) {
|
||||
JSONCPP_STRING normalized;
|
||||
normalized.reserve(static_cast<size_t>(end - begin));
|
||||
Reader::Location current = begin;
|
||||
@@ -691,7 +690,7 @@ bool Reader::readObject(Token& tokenStart) {
|
||||
break;
|
||||
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
|
||||
return true;
|
||||
name = "";
|
||||
name.clear();
|
||||
if (tokenName.type_ == tokenString) {
|
||||
if (!decodeString(tokenName, name))
|
||||
return recoverFromError(tokenObjectEnd);
|
||||
@@ -1236,6 +1235,9 @@ private:
|
||||
void addComment(Location begin, Location end, CommentPlacement placement);
|
||||
void skipCommentTokens(Token& token);
|
||||
|
||||
static JSONCPP_STRING normalizeEOL(Location begin, Location end);
|
||||
static bool containsNewLine(Location begin, Location end);
|
||||
|
||||
typedef std::stack<Value*> Nodes;
|
||||
Nodes nodes_;
|
||||
Errors errors_;
|
||||
@@ -1253,6 +1255,13 @@ private:
|
||||
|
||||
// complete copy of Read impl, for OurReader
|
||||
|
||||
bool OurReader::containsNewLine(OurReader::Location begin, OurReader::Location end) {
|
||||
for (; begin < end; ++begin)
|
||||
if (*begin == '\n' || *begin == '\r')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
OurReader::OurReader(OurFeatures const& features)
|
||||
: errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
|
||||
lastValue_(), commentsBefore_(),
|
||||
@@ -1273,7 +1282,7 @@ bool OurReader::parse(const char* beginDoc,
|
||||
current_ = begin_;
|
||||
lastValueEnd_ = 0;
|
||||
lastValue_ = 0;
|
||||
commentsBefore_ = "";
|
||||
commentsBefore_.clear();
|
||||
errors_.clear();
|
||||
while (!nodes_.empty())
|
||||
nodes_.pop();
|
||||
@@ -1315,7 +1324,7 @@ bool OurReader::readValue() {
|
||||
|
||||
if (collectComments_ && !commentsBefore_.empty()) {
|
||||
currentValue().setComment(commentsBefore_, commentBefore);
|
||||
commentsBefore_ = "";
|
||||
commentsBefore_.clear();
|
||||
}
|
||||
|
||||
switch (token.type_) {
|
||||
@@ -1562,6 +1571,25 @@ bool OurReader::readComment() {
|
||||
return true;
|
||||
}
|
||||
|
||||
JSONCPP_STRING OurReader::normalizeEOL(OurReader::Location begin, OurReader::Location end) {
|
||||
JSONCPP_STRING normalized;
|
||||
normalized.reserve(static_cast<size_t>(end - begin));
|
||||
OurReader::Location current = begin;
|
||||
while (current != end) {
|
||||
char c = *current++;
|
||||
if (c == '\r') {
|
||||
if (current != end && *current == '\n')
|
||||
// convert dos EOL
|
||||
++current;
|
||||
// convert Mac EOL
|
||||
normalized += '\n';
|
||||
} else {
|
||||
normalized += c;
|
||||
}
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
void
|
||||
OurReader::addComment(Location begin, Location end, CommentPlacement placement) {
|
||||
assert(collectComments_);
|
||||
@@ -1664,7 +1692,7 @@ bool OurReader::readObject(Token& tokenStart) {
|
||||
break;
|
||||
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
|
||||
return true;
|
||||
name = "";
|
||||
name.clear();
|
||||
if (tokenName.type_ == tokenString) {
|
||||
if (!decodeString(tokenName, name))
|
||||
return recoverFromError(tokenObjectEnd);
|
||||
@@ -2241,10 +2269,6 @@ JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
|
||||
JSONCPP_STRING errs;
|
||||
bool ok = parseFromStream(b, sin, &root, &errs);
|
||||
if (!ok) {
|
||||
fprintf(stderr,
|
||||
"Error from reader: %s",
|
||||
errs.c_str());
|
||||
|
||||
throwRuntimeError(errs);
|
||||
}
|
||||
return sin;
|
||||
@@ -2265,7 +2289,7 @@ JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
|
||||
// Beginning of content of file: src/lib_json/json_valueiterator.inl
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2007-2010 Baptiste Lepilleur
|
||||
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
@@ -2446,7 +2470,7 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) {
|
||||
// Beginning of content of file: src/lib_json/json_value.cpp
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2011 Baptiste Lepilleur
|
||||
// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
@@ -2460,7 +2484,7 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) {
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
//#include <cassert>
|
||||
#ifdef JSON_USE_CPPTL
|
||||
#include <cpptl/conststring.h>
|
||||
#endif
|
||||
@@ -2740,11 +2764,21 @@ void Value::CZString::swap(CZString& other) {
|
||||
std::swap(index_, other.index_);
|
||||
}
|
||||
|
||||
Value::CZString& Value::CZString::operator=(CZString other) {
|
||||
swap(other);
|
||||
Value::CZString& Value::CZString::operator=(const CZString& other) {
|
||||
cstr_ = other.cstr_;
|
||||
index_ = other.index_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if JSON_HAS_RVALUE_REFERENCES
|
||||
Value::CZString& Value::CZString::operator=(CZString&& other) {
|
||||
cstr_ = other.cstr_;
|
||||
index_ = other.index_;
|
||||
other.cstr_ = nullptr;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Value::CZString::operator<(const CZString& other) const {
|
||||
if (!cstr_) return index_ < other.index_;
|
||||
//return strcmp(cstr_, other.cstr_) < 0;
|
||||
@@ -2846,7 +2880,7 @@ Value::Value(double value) {
|
||||
|
||||
Value::Value(const char* value) {
|
||||
initBasic(stringValue, true);
|
||||
JSON_ASSERT_MESSAGE(value != NULL, "Null Value Passed to Value Constructor");
|
||||
JSON_ASSERT_MESSAGE(value != NULL, "Null Value Passed to Value Constructor");
|
||||
value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
|
||||
}
|
||||
|
||||
@@ -2971,6 +3005,12 @@ void Value::swapPayload(Value& other) {
|
||||
other.allocated_ = temp2 & 0x1;
|
||||
}
|
||||
|
||||
void Value::copyPayload(const Value& other) {
|
||||
type_ = other.type_;
|
||||
value_ = other.value_;
|
||||
allocated_ = other.allocated_;
|
||||
}
|
||||
|
||||
void Value::swap(Value& other) {
|
||||
swapPayload(other);
|
||||
std::swap(comments_, other.comments_);
|
||||
@@ -2978,6 +3018,13 @@ void Value::swap(Value& other) {
|
||||
std::swap(limit_, other.limit_);
|
||||
}
|
||||
|
||||
void Value::copy(const Value& other) {
|
||||
copyPayload(other);
|
||||
comments_ = other.comments_;
|
||||
start_ = other.start_;
|
||||
limit_ = other.limit_;
|
||||
}
|
||||
|
||||
ValueType Value::type() const { return type_; }
|
||||
|
||||
int Value::compare(const Value& other) const {
|
||||
@@ -3328,7 +3375,7 @@ bool Value::isConvertibleTo(ValueType other) const {
|
||||
case nullValue:
|
||||
return (isNumeric() && asDouble() == 0.0) ||
|
||||
(type_ == booleanValue && value_.bool_ == false) ||
|
||||
(type_ == stringValue && asString() == "") ||
|
||||
(type_ == stringValue && asString().empty()) ||
|
||||
(type_ == arrayValue && value_.map_->size() == 0) ||
|
||||
(type_ == objectValue && value_.map_->size() == 0) ||
|
||||
type_ == nullValue;
|
||||
@@ -3572,6 +3619,10 @@ Value const& Value::operator[](CppTL::ConstString const& key) const
|
||||
|
||||
Value& Value::append(const Value& value) { return (*this)[size()] = value; }
|
||||
|
||||
#if JSON_HAS_RVALUE_REFERENCES
|
||||
Value& Value::append(Value&& value) { return (*this)[size()] = std::move(value); }
|
||||
#endif
|
||||
|
||||
Value Value::get(char const* key, char const* cend, Value const& defaultValue) const
|
||||
{
|
||||
Value const* found = find(key, cend);
|
||||
@@ -3608,6 +3659,9 @@ bool Value::removeMember(JSONCPP_STRING const& key, Value* removed)
|
||||
{
|
||||
return removeMember(key.data(), key.data() + key.length(), removed);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
Value Value::removeMember(const char* key)
|
||||
{
|
||||
JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
|
||||
@@ -3623,6 +3677,7 @@ Value Value::removeMember(const JSONCPP_STRING& key)
|
||||
{
|
||||
return removeMember(key.c_str());
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
bool Value::removeIndex(ArrayIndex index, Value* removed) {
|
||||
if (type_ != arrayValue) {
|
||||
@@ -3808,11 +3863,23 @@ bool Value::isUInt64() const {
|
||||
}
|
||||
|
||||
bool Value::isIntegral() const {
|
||||
switch (type_) {
|
||||
case intValue:
|
||||
case uintValue:
|
||||
return true;
|
||||
case realValue:
|
||||
#if defined(JSON_HAS_INT64)
|
||||
return isInt64() || isUInt64();
|
||||
// Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
|
||||
// double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
|
||||
// require the value to be strictly less than the limit.
|
||||
return value_.real_ >= double(minInt64) && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
|
||||
#else
|
||||
return isInt() || isUInt();
|
||||
#endif
|
||||
return value_.real_ >= minInt && value_.real_ <= maxUInt && IsIntegral(value_.real_);
|
||||
#endif // JSON_HAS_INT64
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Value::isDouble() const { return type_ == intValue || type_ == uintValue || type_ == realValue; }
|
||||
@@ -3862,8 +3929,13 @@ ptrdiff_t Value::getOffsetStart() const { return start_; }
|
||||
ptrdiff_t Value::getOffsetLimit() const { return limit_; }
|
||||
|
||||
JSONCPP_STRING Value::toStyledString() const {
|
||||
StyledWriter writer;
|
||||
return writer.write(*this);
|
||||
StreamWriterBuilder builder;
|
||||
|
||||
JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : "";
|
||||
out += Json::writeString(builder, *this);
|
||||
out += "\n";
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Value::const_iterator Value::begin() const {
|
||||
@@ -3942,6 +4014,7 @@ Path::Path(const JSONCPP_STRING& path,
|
||||
const PathArgument& a4,
|
||||
const PathArgument& a5) {
|
||||
InArgs in;
|
||||
in.reserve(5);
|
||||
in.push_back(&a1);
|
||||
in.push_back(&a2);
|
||||
in.push_back(&a3);
|
||||
@@ -4077,7 +4150,7 @@ Value& Path::make(Value& root) const {
|
||||
// Beginning of content of file: src/lib_json/json_writer.cpp
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2011 Baptiste Lepilleur
|
||||
// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
@@ -4091,7 +4164,7 @@ Value& Path::make(Value& root) const {
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
//#include <cassert>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
@@ -4221,17 +4294,18 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
|
||||
char buffer[36];
|
||||
int len = -1;
|
||||
|
||||
char formatString[6];
|
||||
sprintf(formatString, "%%.%dg", precision);
|
||||
char formatString[15];
|
||||
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
|
||||
|
||||
// Print into the buffer. We need not request the alternative representation
|
||||
// that always has a decimal point because JSON doesn't distingish the
|
||||
// concepts of reals and integers.
|
||||
if (isfinite(value)) {
|
||||
len = snprintf(buffer, sizeof(buffer), formatString, value);
|
||||
|
||||
fixNumericLocale(buffer, buffer + len);
|
||||
|
||||
// try to ensure we preserve the fact that this was given to us as a double on input
|
||||
if (!strstr(buffer, ".") && !strstr(buffer, "e")) {
|
||||
if (!strchr(buffer, '.') && !strchr(buffer, 'e')) {
|
||||
strcat(buffer, ".0");
|
||||
}
|
||||
|
||||
@@ -4244,10 +4318,8 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
|
||||
} else {
|
||||
len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "Infinity" : "1e+9999");
|
||||
}
|
||||
// For those, we do not need to call fixNumLoc, but it is fast.
|
||||
}
|
||||
assert(len >= 0);
|
||||
fixNumericLocale(buffer, buffer + len);
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
@@ -4414,7 +4486,7 @@ void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
|
||||
void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
|
||||
|
||||
JSONCPP_STRING FastWriter::write(const Value& root) {
|
||||
document_ = "";
|
||||
document_.clear();
|
||||
writeValue(root);
|
||||
if (!omitEndingLineFeed_)
|
||||
document_ += "\n";
|
||||
@@ -4482,9 +4554,9 @@ StyledWriter::StyledWriter()
|
||||
: rightMargin_(74), indentSize_(3), addChildValues_() {}
|
||||
|
||||
JSONCPP_STRING StyledWriter::write(const Value& root) {
|
||||
document_ = "";
|
||||
document_.clear();
|
||||
addChildValues_ = false;
|
||||
indentString_ = "";
|
||||
indentString_.clear();
|
||||
writeCommentBeforeValue(root);
|
||||
writeValue(root);
|
||||
writeCommentAfterValueOnSameLine(root);
|
||||
@@ -4662,7 +4734,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
|
||||
while (iter != comment.end()) {
|
||||
document_ += *iter;
|
||||
if (*iter == '\n' &&
|
||||
(iter != comment.end() && *(iter + 1) == '/'))
|
||||
((iter+1) != comment.end() && *(iter + 1) == '/'))
|
||||
writeIndent();
|
||||
++iter;
|
||||
}
|
||||
@@ -4698,7 +4770,7 @@ StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
|
||||
void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
|
||||
document_ = &out;
|
||||
addChildValues_ = false;
|
||||
indentString_ = "";
|
||||
indentString_.clear();
|
||||
indented_ = true;
|
||||
writeCommentBeforeValue(root);
|
||||
if (!indented_) writeIndent();
|
||||
@@ -4878,7 +4950,7 @@ void StyledStreamWriter::writeCommentBeforeValue(const Value& root) {
|
||||
while (iter != comment.end()) {
|
||||
*document_ << *iter;
|
||||
if (*iter == '\n' &&
|
||||
(iter != comment.end() && *(iter + 1) == '/'))
|
||||
((iter+1) != comment.end() && *(iter + 1) == '/'))
|
||||
// writeIndent(); // would include newline
|
||||
*document_ << indentString_;
|
||||
++iter;
|
||||
@@ -4980,7 +5052,7 @@ int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
|
||||
sout_ = sout;
|
||||
addChildValues_ = false;
|
||||
indented_ = true;
|
||||
indentString_ = "";
|
||||
indentString_.clear();
|
||||
writeCommentBeforeValue(root);
|
||||
if (!indented_) writeIndent();
|
||||
indented_ = true;
|
||||
@@ -5166,7 +5238,7 @@ void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
|
||||
while (iter != comment.end()) {
|
||||
*sout_ << *iter;
|
||||
if (*iter == '\n' &&
|
||||
(iter != comment.end() && *(iter + 1) == '/'))
|
||||
((iter+1) != comment.end() && *(iter + 1) == '/'))
|
||||
// writeIndent(); // would write extra newline
|
||||
*sout_ << indentString_;
|
||||
++iter;
|
||||
@@ -5234,10 +5306,10 @@ StreamWriter* StreamWriterBuilder::newStreamWriter() const
|
||||
}
|
||||
JSONCPP_STRING nullSymbol = "null";
|
||||
if (dnp) {
|
||||
nullSymbol = "";
|
||||
nullSymbol.clear();
|
||||
}
|
||||
if (pre > 17) pre = 17;
|
||||
JSONCPP_STRING endingLineFeedSymbol = "";
|
||||
JSONCPP_STRING endingLineFeedSymbol;
|
||||
return new BuiltStyledStreamWriter(
|
||||
indentation, cs,
|
||||
colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
|
||||
|
Reference in New Issue
Block a user