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

Function second_example_a

examples/src/examples.cpp:150–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void second_example_a()
151{
152 try
153 {
154 json books(json_array_arg);
155
156 {
157 json book;
158 book["title"] = "Kafka on the Shore";
159 book["author"] = "Haruki Murakami";
160 book["price"] = 25.17;
161 books.push_back(std::move(book));
162 }
163
164 {
165 json book;
166 book["title"] = "Women: A Novel";
167 book["author"] = "Charles Bukowski";
168 book["price"] = 12.00;
169 books.push_back(std::move(book));
170 }
171
172 {
173 json book;
174 book["title"] = "Cutter's Way";
175 book["author"] = "Ivan Passer";
176 books.push_back(std::move(book));
177 }
178
179 std::cout << pretty_print(books) << '\n';
180 }
181 catch (const std::exception& e)
182 {
183 std::cerr << e.what() << '\n';
184 }
185}
186
187void object_range_based_for_loop()
188{

Callers 1

mainFunction · 0.85

Calls 3

pretty_printFunction · 0.85
push_backMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected