📝 added documentation
This commit is contained in:
parent
56f6d1d68e
commit
22c733e6fe
18 changed files with 233 additions and 56 deletions
17
doc/examples/contains.cpp
Normal file
17
doc/examples/contains.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create some JSON values
|
||||
json j_object = R"( {"key": "value"} )"_json;
|
||||
json j_array = R"( [1, 2, 3] )"_json;
|
||||
|
||||
// call contains
|
||||
std::cout << std::boolalpha <<
|
||||
"j_object contains 'key': " << j_object.contains("key") << '\n' <<
|
||||
"j_object contains 'another': " << j_object.contains("another") << '\n' <<
|
||||
"j_array contains 'key': " << j_array.contains("key") << std::endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue