dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 615 forks source link

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

Closed pengweichu closed 8 years ago

pengweichu commented 8 years ago

Hi, it's possible has such method ?

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

artwyman commented 8 years ago

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