Merge branch 'master' into example_parsebyparts
This commit is contained in:
commit
f44961ff9b
21
appveyor.yml
21
appveyor.yml
@ -1,3 +1,4 @@
|
|||||||
|
os: Visual Studio 2015 CTP
|
||||||
version: 1.0.2.{build}
|
version: 1.0.2.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
@ -6,13 +7,25 @@ configuration:
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- VS_VERSION: 11
|
# - VS_VERSION: 9 2008
|
||||||
|
# VS_PLATFORM: win32
|
||||||
|
# - VS_VERSION: 9 2008
|
||||||
|
# VS_PLATFORM: x64
|
||||||
|
- VS_VERSION: 10 2010
|
||||||
VS_PLATFORM: win32
|
VS_PLATFORM: win32
|
||||||
- VS_VERSION: 11
|
- VS_VERSION: 10 2010
|
||||||
VS_PLATFORM: x64
|
VS_PLATFORM: x64
|
||||||
- VS_VERSION: 12
|
- VS_VERSION: 11 2012
|
||||||
VS_PLATFORM: win32
|
VS_PLATFORM: win32
|
||||||
- VS_VERSION: 12
|
- VS_VERSION: 11 2012
|
||||||
|
VS_PLATFORM: x64
|
||||||
|
- VS_VERSION: 12 2013
|
||||||
|
VS_PLATFORM: win32
|
||||||
|
- VS_VERSION: 12 2013
|
||||||
|
VS_PLATFORM: x64
|
||||||
|
- VS_VERSION: 14 2015
|
||||||
|
VS_PLATFORM: win32
|
||||||
|
- VS_VERSION: 14 2015
|
||||||
VS_PLATFORM: x64
|
VS_PLATFORM: x64
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
|
@ -2254,7 +2254,7 @@ public:
|
|||||||
|
|
||||||
template <unsigned parseFlags>
|
template <unsigned parseFlags>
|
||||||
GenericDocument& Parse(const std::basic_string<Ch>& str) {
|
GenericDocument& Parse(const std::basic_string<Ch>& str) {
|
||||||
return Parse<parseFlags, Encoding>(str);
|
return Parse<parseFlags, Encoding>(str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericDocument& Parse(const std::basic_string<Ch>& str) {
|
GenericDocument& Parse(const std::basic_string<Ch>& str) {
|
||||||
@ -2462,9 +2462,9 @@ private:
|
|||||||
ValueType& value_;
|
ValueType& value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Helper class for accessing Value of array type.
|
//! Helper class for accessing Value of object type.
|
||||||
/*!
|
/*!
|
||||||
Instance of this helper class is obtained by \c GenericValue::GetArray().
|
Instance of this helper class is obtained by \c GenericValue::GetObject().
|
||||||
In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1.
|
In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1.
|
||||||
*/
|
*/
|
||||||
template <bool Const, typename ValueT>
|
template <bool Const, typename ValueT>
|
||||||
|
@ -20,6 +20,11 @@ RAPIDJSON_DIAG_PUSH
|
|||||||
RAPIDJSON_DIAG_OFF(padded)
|
RAPIDJSON_DIAG_OFF(padded)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
RAPIDJSON_DIAG_PUSH
|
||||||
|
RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized
|
||||||
|
#endif
|
||||||
|
|
||||||
RAPIDJSON_NAMESPACE_BEGIN
|
RAPIDJSON_NAMESPACE_BEGIN
|
||||||
|
|
||||||
//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept.
|
//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept.
|
||||||
@ -98,7 +103,7 @@ private:
|
|||||||
typedef BasicIStreamWrapper<std::istream> IStreamWrapper;
|
typedef BasicIStreamWrapper<std::istream> IStreamWrapper;
|
||||||
typedef BasicIStreamWrapper<std::wistream> WIStreamWrapper;
|
typedef BasicIStreamWrapper<std::wistream> WIStreamWrapper;
|
||||||
|
|
||||||
#ifdef __clang__
|
#if defined(__clang__) || defined(_MSC_VER)
|
||||||
RAPIDJSON_DIAG_POP
|
RAPIDJSON_DIAG_POP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ RAPIDJSON_NAMESPACE_END
|
|||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for)
|
#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for)
|
||||||
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
|
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
|
||||||
(defined(_MSC_VER) && _MSC_VER >= 1600)
|
(defined(_MSC_VER) && _MSC_VER >= 1700)
|
||||||
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
|
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
|
||||||
#else
|
#else
|
||||||
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0
|
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0
|
||||||
|
@ -192,7 +192,12 @@ TEST(Document, Parse_Encoding) {
|
|||||||
#if RAPIDJSON_HAS_STDSTRING
|
#if RAPIDJSON_HAS_STDSTRING
|
||||||
// Parse<unsigned, SourceEncoding>(std::string)
|
// Parse<unsigned, SourceEncoding>(std::string)
|
||||||
doc.SetNull();
|
doc.SetNull();
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||||
|
doc.Parse<kParseDefaultFlags, UTF8<> >(s2.c_str()); // VS2010 or below cannot handle templated function overloading. Use const char* instead.
|
||||||
|
#else
|
||||||
doc.Parse<kParseDefaultFlags, UTF8<> >(s2);
|
doc.Parse<kParseDefaultFlags, UTF8<> >(s2);
|
||||||
|
#endif
|
||||||
EXPECT_FALSE(doc.HasParseError());
|
EXPECT_FALSE(doc.HasParseError());
|
||||||
EXPECT_EQ(0, StrCmp(doc[L"hello"].GetString(), L"world"));
|
EXPECT_EQ(0, StrCmp(doc[L"hello"].GetString(), L"world"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -666,10 +666,12 @@ TEST(Value, IsLosslessDouble) {
|
|||||||
EXPECT_TRUE(Value(12.34).IsLosslessDouble());
|
EXPECT_TRUE(Value(12.34).IsLosslessDouble());
|
||||||
EXPECT_TRUE(Value(-123).IsLosslessDouble());
|
EXPECT_TRUE(Value(-123).IsLosslessDouble());
|
||||||
EXPECT_TRUE(Value(2147483648u).IsLosslessDouble());
|
EXPECT_TRUE(Value(2147483648u).IsLosslessDouble());
|
||||||
EXPECT_TRUE(Value(static_cast<int64_t>(-RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble());
|
EXPECT_TRUE(Value(-static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble());
|
||||||
|
#if !(defined(_MSC_VER) && _MSC_VER < 1800) // VC2010 has problem
|
||||||
EXPECT_TRUE(Value(RAPIDJSON_UINT64_C2(0xA0000000, 0x00000000)).IsLosslessDouble());
|
EXPECT_TRUE(Value(RAPIDJSON_UINT64_C2(0xA0000000, 0x00000000)).IsLosslessDouble());
|
||||||
|
#endif
|
||||||
|
|
||||||
EXPECT_FALSE(Value(static_cast<int64_t>(-RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble());
|
EXPECT_FALSE(Value(-static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble());
|
||||||
EXPECT_FALSE(Value(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)).IsLosslessDouble());
|
EXPECT_FALSE(Value(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)).IsLosslessDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user