parse__contiguouscontainer__parser_callback_t.cpp 358 B

123456789101112131415
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <nlohmann/json.hpp>
  4. using json = nlohmann::json;
  5. int main()
  6. {
  7. // a JSON text given as std::vector
  8. std::vector<uint8_t> text = {'[', '1', ',', '2', ',', '3', ']', '\0'};
  9. // parse and serialize JSON
  10. json j_complete = json::parse(text);
  11. std::cout << std::setw(4) << j_complete << "\n\n";
  12. }