Skip to content

Commit 38bb491

Browse files
committed
JSONCPP_OSTRINGSTREAM
1 parent 724ba29 commit 38bb491

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

include/json/assertions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# define JSON_FAIL_MESSAGE(message) \
2727
{ \
28-
std::ostringstream oss; oss << message; \
28+
JSONCPP_OSTRINGSTREAM oss; oss << message; \
2929
Json::throwLogicError(oss.str()); \
3030
abort(); \
3131
}
@@ -38,7 +38,7 @@
3838
// release builds we abort, for a core-dump or debugger.
3939
# define JSON_FAIL_MESSAGE(message) \
4040
{ \
41-
std::ostringstream oss; oss << message; \
41+
JSONCPP_OSTRINGSTREAM oss; oss << message; \
4242
assert(false && oss.str().c_str()); \
4343
abort(); \
4444
}

src/jsontestrunner/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static std::string useStyledStreamWriter(
178178
Json::Value const& root)
179179
{
180180
Json::StyledStreamWriter writer;
181-
std::ostringstream sout;
181+
JSONCPP_OSTRINGSTREAM sout;
182182
writer.write(sout, root);
183183
return sout.str();
184184
}

src/lib_json/json_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ bool parseFromStream(
20102010
CharReader::Factory const& fact, std::istream& sin,
20112011
Value* root, std::string* errs)
20122012
{
2013-
std::ostringstream ssin;
2013+
JSONCPP_OSTRINGSTREAM ssin;
20142014
ssin << sin.rdbuf();
20152015
std::string doc = ssin.str();
20162016
char const* begin = doc.data();

src/lib_json/json_writer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ std::string valueToQuotedString(const char* value) {
217217
// sequence from occurring.
218218
default:
219219
if (isControlCharacter(*c)) {
220-
std::ostringstream oss;
220+
JSONCPP_OSTRINGSTREAM oss;
221221
oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
222222
<< std::setw(4) << static_cast<int>(*c);
223223
result += oss.str();
@@ -295,7 +295,7 @@ static std::string valueToQuotedStringN(const char* value, unsigned length) {
295295
// sequence from occurring.
296296
default:
297297
if ((isControlCharacter(*c)) || (*c == 0)) {
298-
std::ostringstream oss;
298+
JSONCPP_OSTRINGSTREAM oss;
299299
oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
300300
<< std::setw(4) << static_cast<int>(*c);
301301
result += oss.str();
@@ -1200,7 +1200,7 @@ void StreamWriterBuilder::setDefaults(Json::Value* settings)
12001200
}
12011201

12021202
std::string writeString(StreamWriter::Factory const& builder, Value const& root) {
1203-
std::ostringstream sout;
1203+
JSONCPP_OSTRINGSTREAM sout;
12041204
StreamWriterPtr const writer(builder.newStreamWriter());
12051205
writer->write(root, &sout);
12061206
return sout.str();

src/test_lib_json/jsontest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class TestResult {
8282

8383
// Generic operator that will work with anything ostream can deal with.
8484
template <typename T> TestResult& operator<<(const T& value) {
85-
std::ostringstream oss;
85+
JSONCPP_OSTRINGSTREAM oss;
8686
oss.precision(16);
8787
oss.setf(std::ios_base::floatfield);
8888
oss << value;

src/test_lib_json/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,13 +2480,13 @@ JSONTEST_FIXTURE(IteratorTest, const) {
24802480

24812481
for(int i = 9; i < 12; ++i)
24822482
{
2483-
std::ostringstream out;
2483+
JSONCPP_OSTRINGSTREAM out;
24842484
out << std::setw(2) << i;
24852485
std::string str = out.str();
24862486
value[str] = str;
24872487
}
24882488

2489-
std::ostringstream out;
2489+
JSONCPP_OSTRINGSTREAM out;
24902490
//in old code, this will get a compile error
24912491
Json::Value::const_iterator iter = value.begin();
24922492
for(; iter != value.end(); ++iter)

0 commit comments

Comments
 (0)