Added operator == to compare JsonVariant and strings (issue #402)

This commit is contained in:
Benoit Blanchon
2016-12-23 14:45:32 +01:00
parent 90e0cc6091
commit cecbcd1929
7 changed files with 158 additions and 62 deletions

View File

@ -48,6 +48,11 @@ void setup() {
// WARNING: the content of the String will be duplicated in the JsonBuffer.
root[String("sen") + "sor"] = String("gp") + "s";
// You can compare the content of a JsonObject with a String
if (root["sensor"] == sensor) {
// ...
}
// Lastly, you can print the resulting JSON to a String
String output;
root.printTo(output);