1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| World wd{};
auto age = World::GetDescriptor()->FindFieldByName("age");
auto age = wd.GetDescriptor()->FindFieldByName("age");
World::GetReflection->SetInt64(&wd, age, 10);
World::GetReflection()->AddString(&wd, tag, "a"); World::GetReflection()->AddString(&wd, tag, "b"); World::GetReflection()->SetRepeatedString(&wd, tag, 1, "c");
wd.mutable_sea()->set_name("pacific");
|