Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
26
thirdparty/json/docs/examples/operator_deserialize.cpp
vendored
Normal file
26
thirdparty/json/docs/examples/operator_deserialize.cpp
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create stream with serialized JSON
|
||||
std::stringstream ss;
|
||||
ss << R"({
|
||||
"number": 23,
|
||||
"string": "Hello, world!",
|
||||
"array": [1, 2, 3, 4, 5],
|
||||
"boolean": false,
|
||||
"null": null
|
||||
})";
|
||||
|
||||
// create JSON value and read the serialization from the stream
|
||||
json j;
|
||||
ss >> j;
|
||||
|
||||
// serialize JSON
|
||||
std::cout << std::setw(2) << j << '\n';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue