|
|
@ -1104,6 +1104,7 @@ bool AllowedExtendeeInProto3(const std::string& name) { |
|
|
|
return allowed_proto3_extendees->find(name) != |
|
|
|
return allowed_proto3_extendees->find(name) != |
|
|
|
allowed_proto3_extendees->end(); |
|
|
|
allowed_proto3_extendees->end(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} // anonymous namespace
|
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
// Contains tables specific to a particular file. These tables are not
|
|
|
|
// Contains tables specific to a particular file. These tables are not
|
|
|
@ -2681,6 +2682,7 @@ void Descriptor::CopyTo(DescriptorProto* proto) const { |
|
|
|
if (&options() != &MessageOptions::default_instance()) { |
|
|
|
if (&options() != &MessageOptions::default_instance()) { |
|
|
|
proto->mutable_options()->CopyFrom(options()); |
|
|
|
proto->mutable_options()->CopyFrom(options()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { |
|
|
|
void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { |
|
|
@ -2753,6 +2755,7 @@ void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { |
|
|
|
if (&options() != &FieldOptions::default_instance()) { |
|
|
|
if (&options() != &FieldOptions::default_instance()) { |
|
|
|
proto->mutable_options()->CopyFrom(options()); |
|
|
|
proto->mutable_options()->CopyFrom(options()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { |
|
|
|
void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { |
|
|
@ -3948,10 +3951,9 @@ class DescriptorBuilder { |
|
|
|
internal::FlatAllocator& alloc); |
|
|
|
internal::FlatAllocator& alloc); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Allocates an array of two strings, the first one is a copy of `proto_name`,
|
|
|
|
// Allocates an array of two strings, the first one is a copy of
|
|
|
|
// and the second one is the full name.
|
|
|
|
// `proto_name`, and the second one is the full name. Full proto name is
|
|
|
|
// Full proto name is "scope.proto_name" if scope is non-empty and
|
|
|
|
// "scope.proto_name" if scope is non-empty and "proto_name" otherwise.
|
|
|
|
// "proto_name" otherwise.
|
|
|
|
|
|
|
|
const std::string* AllocateNameStrings(const std::string& scope, |
|
|
|
const std::string* AllocateNameStrings(const std::string& scope, |
|
|
|
const std::string& proto_name, |
|
|
|
const std::string& proto_name, |
|
|
|
internal::FlatAllocator& alloc); |
|
|
|
internal::FlatAllocator& alloc); |
|
|
@ -4208,6 +4210,8 @@ class DescriptorBuilder { |
|
|
|
const OneofDescriptorProto& proto); |
|
|
|
const OneofDescriptorProto& proto); |
|
|
|
void ValidateFieldOptions(const FieldDescriptor* field, |
|
|
|
void ValidateFieldOptions(const FieldDescriptor* field, |
|
|
|
const FieldDescriptorProto& proto); |
|
|
|
const FieldDescriptorProto& proto); |
|
|
|
|
|
|
|
void ValidateFieldFeatures(const FieldDescriptor* field, |
|
|
|
|
|
|
|
const FieldDescriptorProto& proto); |
|
|
|
void ValidateEnumOptions(const EnumDescriptor* enm, |
|
|
|
void ValidateEnumOptions(const EnumDescriptor* enm, |
|
|
|
const EnumDescriptorProto& proto); |
|
|
|
const EnumDescriptorProto& proto); |
|
|
|
void ValidateEnumValueOptions(const EnumValueDescriptor* enum_value, |
|
|
|
void ValidateEnumValueOptions(const EnumValueDescriptor* enum_value, |
|
|
@ -5596,9 +5600,12 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Copy options.
|
|
|
|
// Copy options.
|
|
|
|
result->options_ = |
|
|
|
{ |
|
|
|
AllocateOptions(proto, result, DescriptorProto::kOptionsFieldNumber, |
|
|
|
MessageOptions* options = |
|
|
|
"google.protobuf.MessageOptions", alloc); |
|
|
|
AllocateOptions(proto, result, DescriptorProto::kOptionsFieldNumber, |
|
|
|
|
|
|
|
"google.protobuf.MessageOptions", alloc); |
|
|
|
|
|
|
|
result->options_ = options; // Set to default_instance later if necessary.
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); |
|
|
|
AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); |
|
|
|
|
|
|
|
|
|
|
@ -6088,9 +6095,12 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Copy options.
|
|
|
|
// Copy options.
|
|
|
|
result->options_ = |
|
|
|
{ |
|
|
|
AllocateOptions(proto, result, FieldDescriptorProto::kOptionsFieldNumber, |
|
|
|
FieldOptions* options = AllocateOptions( |
|
|
|
"google.protobuf.FieldOptions", alloc); |
|
|
|
proto, result, FieldDescriptorProto::kOptionsFieldNumber, |
|
|
|
|
|
|
|
"google.protobuf.FieldOptions", alloc); |
|
|
|
|
|
|
|
result->options_ = options; // Set to default_instance later if necessary.
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); |
|
|
|
AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); |
|
|
|
} |
|
|
|
} |
|
|
@ -7264,6 +7274,8 @@ void DescriptorBuilder::ValidateFieldOptions( |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ValidateFieldFeatures(field, proto); |
|
|
|
|
|
|
|
|
|
|
|
// Only message type fields may be lazy.
|
|
|
|
// Only message type fields may be lazy.
|
|
|
|
if (field->options().lazy() || field->options().unverified_lazy()) { |
|
|
|
if (field->options().lazy() || field->options().unverified_lazy()) { |
|
|
|
if (field->type() != FieldDescriptor::TYPE_MESSAGE) { |
|
|
|
if (field->type() != FieldDescriptor::TYPE_MESSAGE) { |
|
|
@ -7344,6 +7356,10 @@ void DescriptorBuilder::ValidateFieldOptions( |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DescriptorBuilder::ValidateFieldFeatures( |
|
|
|
|
|
|
|
const FieldDescriptor* field, const FieldDescriptorProto& proto) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DescriptorBuilder::ValidateEnumOptions(const EnumDescriptor* enm, |
|
|
|
void DescriptorBuilder::ValidateEnumOptions(const EnumDescriptor* enm, |
|
|
|
const EnumDescriptorProto& proto) { |
|
|
|
const EnumDescriptorProto& proto) { |
|
|
|
VALIDATE_OPTIONS_FROM_ARRAY(enm, value, EnumValue); |
|
|
|
VALIDATE_OPTIONS_FROM_ARRAY(enm, value, EnumValue); |
|
|
|