MCPcopy Create free account
hub / github.com/DFHack/dfhack / Clear

Method Clear

depends/protobuf/google/protobuf/reflection_ops.cc:123–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void ReflectionOps::Clear(Message* message) {
124 const Reflection* reflection = message->GetReflection();
125
126 vector<const FieldDescriptor*> fields;
127 reflection->ListFields(*message, &fields);
128 for (int i = 0; i < fields.size(); i++) {
129 reflection->ClearField(message, fields[i]);
130 }
131
132 reflection->MutableUnknownFields(message)->Clear();
133}
134
135bool ReflectionOps::IsInitialized(const Message& message) {
136 const Descriptor* descriptor = message.GetDescriptor();

Callers 1

DiscardUnknownFieldsMethod · 0.45

Calls 4

ListFieldsMethod · 0.80
ClearFieldMethod · 0.80
MutableUnknownFieldsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected