Debian Codegraph @

include/jwt/json/test_json.cc

raw
1 #include <iostream>
2 #include <string>
3 #if defined( CPP_JWT_USE_VENDORED_NLOHMANN_JSON)
4 #include "./json.hpp"
5 #else
6 #include "nlohmann/json.hpp"
7 #endif
8 using json = nlohmann::json;
9
10 void basic_json_test()
11 {
12 json obj = json::object();
13 obj["test"] = "value-test";
14 obj["test-int"] = 42;
15
16 std::string jstr = obj.dump(0);
17 std::cout << jstr << std::endl;
18 }
19
20 int main() {
21 basic_json_test();
22
23 return 0;
24 }