MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / serialization_example1

Function serialization_example1

examples_boost/serialization_examples.cpp:14–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace boost_mp = boost::multiprecision;
13
14void serialization_example1()
15{
16 json val = json::parse(R"(
17{
18 "sfm_data_version": "0.2",
19 "root_path": "D:\\Lagring\\Plugg\\Examensarbete\\Data\\images",
20 "views": [],
21 "intrinsics": [],
22 "extrinsics": [
23 {
24 "key": 0,
25 "value": {
26 "rotation": [
27 [
28 0.89280214808572156,
29 0.35067276062587932,
30 -0.28272413998197254
31 ],
32 [
33 -0.090429686592667424,
34 0.75440463553446824,
35 0.65015084224113584
36 ],
37 [
38 0.44127859245183554,
39 -0.5548894131618759,
40 0.70524530697098287
41 ]
42 ],
43 "center": [
44 -0.60959634064871249,
45 0.24123645392011658,
46 0.57783384588917808
47 ]
48 }
49 }
50 ]
51}
52
53)");
54
55 std::cout << "Default pretty print" << std::endl;
56 std::cout << pretty_print(val) << std::endl;
57
58
59 std::cout << "array_array_line_splits(line_split_kind::new_line)" << std::endl;
60 std::cout << "array_object_line_splits(line_split_kind::new_line)" << std::endl;
61
62 auto options = json_options{}
63 .array_array_line_splits(line_split_kind::new_line)
64 .array_object_line_splits(line_split_kind::new_line);
65 std::cout << pretty_print(val,options) << std::endl;
66}
67
68void serialization_example2()
69{

Callers 1

mainFunction · 0.85

Calls 4

parseFunction · 0.85
pretty_printFunction · 0.85

Tested by

no test coverage detected