Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

How to detect a key is exists or not? #48

Closed
pengweichu opened this issue Jan 5, 2016 · 1 comment
Closed

How to detect a key is exists or not? #48

pengweichu opened this issue Jan 5, 2016 · 1 comment

Comments

@pengweichu
Copy link

Hi, it's possible has such method ?

if (json["k1"].exists())
{
// do sth
}

@artwyman
Copy link
Contributor

artwyman commented Jan 5, 2016

Just call object_items() which returns a std::map, and use the normal methods there (like find() or count() in this case).

@artwyman artwyman closed this as completed Jan 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants