MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / print_member

Function print_member

example/get_and_set.cpp:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using member_itr_type = typename sonic_json::Document::MemberIterator;
7
8void print_member(member_itr_type m) {
9 const sonic_json::Node& key = m->name;
10 sonic_json::Node& value = m->value;
11 if (key.IsString()) {
12 std::cout << "Key is: " << key.GetString() << std::endl;
13 } else {
14 std::cout << "Incoreect key type!\n";
15 return;
16 }
17 if (value.IsInt64()) {
18 std::cout << "Value is " << value.GetInt64() << std::endl;
19 }
20
21 return;
22}
23
24void set_new_value(member_itr_type m) {
25 sonic_json::Node& value = m->value;

Callers 1

mainFunction · 0.85

Calls 2

IsStringMethod · 0.80
IsInt64Method · 0.80

Tested by

no test coverage detected