Skip to content

Commit 40af486

Browse files
committed
Fixed merge issues for linux
1 parent 2845170 commit 40af486

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

Release/include/cpprest/json.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,8 +1389,6 @@ namespace web { namespace json
13891389
}
13901390
return reserveSize;
13911391
}
1392-
1393-
template<typename CharType> friend class web::json::details::JSON_Parser;
13941392
};
13951393
} // namespace details
13961394

Release/src/json/json.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,20 +313,24 @@ bool web::json::number::is_int64() const
313313
}
314314
}
315315

316+
struct has_escape_chars_impl {
317+
static const char* escapes8;
318+
static const wchar_t* escapes16;
319+
320+
static bool impl(const std::string& s) {
321+
return s.find_first_of(escapes8) != std::string::npos;
322+
}
323+
static bool impl(const std::wstring& s) {
324+
return s.find_first_of(escapes16) != std::wstring::npos;
325+
}
326+
};
327+
328+
const char* has_escape_chars_impl::escapes8 = "\"\\\b\f\r\n\t";
329+
const wchar_t* has_escape_chars_impl::escapes16 = L"\"\\\b\f\r\n\t";
330+
316331
bool web::json::details::_String::has_escape_chars(const _String &str)
317332
{
318-
struct escapes {
319-
static const char* escapes8 = "\"\\\b\f\r\n\t";
320-
static const wchar_t* escapes16 = L"\"\\\b\f\r\n\t";
321-
322-
static bool impl(const std::string& s) {
323-
return s.find_first_of(escapes8) != std::string::npos;
324-
}
325-
static bool impl(const std::wstring& s) {
326-
return s.find_first_of(escapes16) != std::wstring::npos;
327-
}
328-
};
329-
return escapes::impl(str.m_string);
333+
return has_escape_chars_impl::impl(str.m_string);
330334
}
331335

332336
web::json::details::_Object::_Object(const _Object& other):web::json::details::_Value(other)
@@ -489,4 +493,4 @@ const web::json::value& web::json::value::operator[](size_t index) const
489493
#endif
490494
}
491495
return m_value->cnst_index(index);
492-
}
496+
}

Release/tests/Functional/json/to_as_and_operators_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,14 @@ TEST(floating_number_serialize)
321321
value.serialize(ss);
322322
VERIFY_ARE_EQUAL(len, ss.str().length());
323323

324+
#ifdef _MS_WINDOWS
324325
// Check wide string implementation
325326
std::basic_stringstream<wchar_t> wss;
326327
value.serialize(wss);
327328
VERIFY_ARE_EQUAL(len, wss.str().length());
329+
#endif
328330
}
329331

330332
} // SUITE(to_as_and_operators_tests)
331333

332-
}}}
334+
}}}

0 commit comments

Comments
 (0)