8000 Merge branch 'master' into 6.x · java64/ArduinoJson@b11ad40 · GitHub
[go: up one dir, main page]

Skip to content

Commit b11ad40

Browse files
committed
Merge branch 'master' into 6.x
2 parents 5dc7dc1 + 0d4a930 commit b11ad40

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,19 @@ matrix:
9797
- compiler: gcc
9898
env: SCRIPT=coverage
9999
- os: osx
100-
osx_image: xcode6.4
100+
osx_image: xcode7.3
101101
compiler: clang
102102
env: SCRIPT=cmake
103103
- os: osx
104-
osx_image: xcode7.3
104+
osx_image: xcode8.3
105+
compiler: clang
106+
env: SCRIPT=cmake
107+
- os: osx
108+
osx_image: xcode9.4
109+
compiler: clang
110+
env: SCRIPT=cmake
111+
- os: osx
112+
osx_image: xcode10
105113
compiler: clang
106114
env: SCRIPT=cmake SANITIZE=address
107115
- env: SCRIPT=arduino VERSION=1.6.7 BOARD=arduino:avr:uno

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ HEAD
99
* Fixed object keys not being duplicated
1010
* `JsonPair::key()` now returns a `JsonKey`
1111
* Increased the default capacity of `DynamicJsonDocument`
12+
* Fixed `JsonVariant::is<String>()` (closes #763)
1213

1314
v6.4.0-beta (2018-09-11)
1415
-----------
@@ -87,6 +88,7 @@ v6.2.0-beta (2018-07-12)
8788
-----------
8889
8990
* Disabled lazy number deserialization (issue #772)
91+
* Fixed `JsonVariant::is<int>()` that returned true for empty strings
9092
* Improved float serialization when `-fsingle-precision-constant` is used
9193
* Renamed function `RawJson()` to `serialized()`
9294
* `serializeMsgPack()` now supports values marked with `serialized()`

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 6.0.1.{build}
1+
version: 6.4.0.{build}
22
environment:
33
matrix:
44
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

src/ArduinoJson/JsonVariant.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,13 @@ class JsonVariant : public JsonVariantBase<JsonVariant> {
305305
//
306306
// bool is<const char*>() const;
307307
// bool is<char*>() const;
308+
// bool is<std::string>() const;
309+
// bool is<String>() const;
308310
template <typename T>
309-
FORCE_INLINE typename enable_if<
310-
is_same<T, const char *>::value || is_same<T, char *>::value, bool>::type
311+
FORCE_INLINE typename enable_if<is_same<T, const char *>::value ||
312+
is_same<T, char *>::value ||
313+
IsWriteableString<T>::value,
314+
bool>::type
311315
is() const {
312316
return _data && (_data->type == JSON_LINKED_STRING ||
313317
_data->type == JSON_OWNED_STRING);

test/JsonVariant/is.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void checkIsString(const char *value) {
7979
var.set(value);
8080

8181
REQUIRE(var.is<const char *>());
82+
REQUIRE(var.is<std::string>());
8283

8384
REQUIRE_FALSE(var.is<bool>());
8485
REQUIRE_FALSE(var.is<int>());

0 commit comments

Comments
 (0)
0