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

Function array_example

examples/src/bson_examples.cpp:140–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void array_example()
141{
142 json a(jsoncons::json_array_arg);
143 a.push_back("hello");
144 a.push_back("world");
145
146 json j(jsoncons::json_object_arg);
147 j["array"] = std::move(a);
148
149 std::vector<char> buffer;
150 bson::encode_bson(j, buffer);
151
152 std::cout << jsoncons::byte_string_view(buffer) << "\n\n";
153}
154
155void utf8_string_example()
156{

Callers 1

mainFunction · 0.85

Calls 3

encode_bsonFunction · 0.85
byte_string_viewClass · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected