Comments (7)
Both Generator::JsonObject
and Parser::JsonObject
have the following public method:
bool containsKey(const char* key);
which returns true
if the key is present, and false
if not.
from arduinojson.
I'll give this a look when I get back to my computer. If i can figure out
how to make it work, it will greatly ease my coding burden on this
project. Is there any full documentation on this library? I like it's
footprint over aJSON...
On Aug 25, 2014 2:39 AM, "Benoît Blanchon" [email protected] wrote:
Both Generator::JsonObject and Parser::JsonObject have the following
public method:bool containsKey(const char* key);
which returns true if the key is present, and false if not.
—
Reply to this email directly or view it on GitHub
#12 (comment)
.
from arduinojson.
Please have a look at the README files:
https://github.com/bblanchon/ArduinoJson/blob/master/README.md
https://github.com/bblanchon/ArduinoJson/blob/master/JsonGenerator/README.md
https://github.com/bblanchon/ArduinoJson/blob/master/JsonParser/README.md
from arduinojson.
I believe I have it figured out. I haven’t actually run the code yet but the line:
bool containsKey(const char* Pool);
seems to pass the verify built into the IDE. No guarantee it will do what I want it to do though. Is it possible to check for a nested key or do I need to check for the first key (Pool in this case) and then check for subkeys under it? I realize this is an Arduino library and code space is a premium. I’m just ecstatic to have a library to handle JSON that doesn’t eat up too much memory.
Mike
From: Benoît Blanchon [mailto:[email protected]]
Sent: Monday, August 25, 2014 2:39 AM
To: bblanchon/ArduinoJson
Cc: MYeager1967
Subject: Re: [ArduinoJson] has_key? (#12)
Both Generator::JsonObject and Parser::JsonObject have the following public method:
bool containsKey(const char* key);
which returns true if the key is present, and false if not.
—
Reply to this email directly or view it on GitHub #12 (comment) .
from arduinojson.
Ok. It didn’t do what I expected….
From: Benoît Blanchon [mailto:[email protected]]
Sent: Monday, August 25, 2014 2:39 AM
To: bblanchon/ArduinoJson
Cc: MYeager1967
Subject: Re: [ArduinoJson] has_key? (#12)
Both Generator::JsonObject and Parser::JsonObject have the following public method:
bool containsKey(const char* key);
which returns true if the key is present, and false if not.
—
Reply to this email directly or view it on GitHub #12 (comment) .
from arduinojson.
Ok. With a little time to think and pull my head out of my ass, I figured it out. Thank you for not replying too quick with an answer… I’d still like to know if it’s possible to check for nested keys without testing at multiple levels. Like I said, if not, it’s no big deal. My life is already easier….
From: Benoît Blanchon [mailto:[email protected]]
Sent: Monday, August 25, 2014 9:39 AM
To: bblanchon/ArduinoJson
Cc: MYeager1967
Subject: Re: [ArduinoJson] has_key? (#12)
Please have a look at the README files:
https://github.com/bblanchon/ArduinoJson/blob/master/README.md
https://github.com/bblanchon/ArduinoJson/blob/master/JsonGenerator/README.md
https://github.com/bblanchon/ArduinoJson/blob/master/JsonParser/README.md
—
Reply to this email directly or view it on GitHub #12 (comment) .
from arduinojson.
You could just try to get the value and see if it exists.
Like this:
json["key1"]["key2"].success()
from arduinojson.
Related Issues (20)
- `doc[var]` doesn't work when `var` contains a string
- JsonArray.add(JsonObject) adds partial JsonObject when the JsonDocument is full HOT 6
- ArduinoJson.h: No such file or directory HOT 3
- JsonVariant tests false for both a value that doesn't exist and for a value that is zero HOT 7
- How do i create JSON array of objects using ArduinoJson library. HOT 1
- Identifying JsonVariant type of a deserialized document HOT 4
- Example code results in compiler error: no match for 'operator+=' HOT 3
- Passing JsonDocument by reference HOT 4
- In Memory Deserialization HOT 4
- v7 equivalent of validateJson HOT 2
- conversion from ‘ArduinoJson::V704HB42::detail::enable_if<true, ArduinoJson::V704HB42::JsonVariantConst>::type’ {aka ‘ArduinoJson::V704HB42::JsonVariantConst’} to ‘ArduinoJson::V704HB42::JsonDocument’ is ambiguous HOT 1
- Assertion `poolIndex < count_' failed HOT 1
- Maximum string length of 13 characters HOT 2
- V6 Documentation ArduinoJson PubSubClient with StreamUtils HOT 1
- deserialize file from LittleFS crash HOT 6
- Trying to compile a 2021 program HOT 2
- Bring back zero-copy mode in v7 HOT 6
- MQTT Publish destroying Json HOT 2
- Error compiling example code SimpleParser on Arduino Web Editor NodeMCU 0.9 HOT 1
- JSON output is truncated. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinojson.