Go to the documentation of this file.
39 #include <unordered_map>
59 using internal::WireFormat;
63 typedef std::unordered_map<std::string, FieldDescriptorProto::Type> TypeNameMap;
65 TypeNameMap MakeTypeNameTable() {
89 const TypeNameMap kTypeNames = MakeTypeNameTable();
95 static const char kSuffix[] =
"Entry";
96 result.reserve(field_name.size() +
sizeof(kSuffix));
98 for (
int i = 0;
i < field_name.size(); ++
i) {
99 if (field_name[
i] ==
'_') {
101 }
else if (cap_next) {
103 if (
'a' <= field_name[
i] && field_name[
i] <=
'z') {
104 result.push_back(field_name[
i] -
'a' +
'A');
106 result.push_back(field_name[
i]);
110 result.push_back(field_name[
i]);
113 result.append(kSuffix);
117 bool IsUppercase(
char c) {
return c >=
'A' && c <=
'Z'; }
119 bool IsLowercase(
char c) {
return c >=
'a' && c <=
'z'; }
121 bool IsNumber(
char c) {
return c >=
'0' && c <=
'9'; }
123 bool IsUpperCamelCase(
const string&
name) {
128 if (!IsUppercase(
name[0])) {
132 for (
int i = 1;
i <
name.length();
i++) {
133 if (
name[
i] ==
'_') {
140 bool IsUpperUnderscore(
const string&
name) {
141 for (
int i = 0;
i <
name.length();
i++) {
142 const char c =
name[
i];
143 if (!IsUppercase(c) && c !=
'_' && !IsNumber(c)) {
150 bool IsLowerUnderscore(
const string&
name) {
151 for (
int i = 0;
i <
name.length();
i++) {
152 const char c =
name[
i];
153 if (!IsLowercase(c) && c !=
'_' && !IsNumber(c)) {
160 bool IsNumberFollowUnderscore(
const string&
name) {
161 for (
int i = 1;
i <
name.length();
i++) {
162 const char c =
name[
i];
163 if (IsNumber(c) &&
name[
i - 1] ==
'_') {
175 #define DO(STATEMENT) \
185 source_location_table_(
NULL),
188 stop_after_syntax_identifier_(
false) {
227 AddError(
"Expected \"" +
string(text) +
"\".");
261 bool is_negative =
false;
269 if (is_negative)
value *= -1;
308 *
output = std::numeric_limits<double>::infinity();
312 *
output = std::numeric_limits<double>::quiet_NaN();
341 std::vector<std::string> detached;
350 location->AttachComments(&leading, &trailing, &detached);
351 }
else if (strcmp(text,
"}") == 0) {
359 detached.begin(), detached.end());
373 AddError(
"Expected \"" +
string(text) +
"\".");
402 source_code_info_(
parser->source_code_info_),
403 location_(
parser_->source_code_info_->add_location()) {
415 Init(parent, source_code_info);
426 int path1,
int path2) {
438 location_->mutable_path()->CopyFrom(parent.
location_->
path());
440 location_->add_span(
parser_->input_->current().line);
441 location_->add_span(
parser_->input_->current().column);
445 if (location_->span_size() <= 2) {
446 EndAt(
parser_->input_->previous());
451 location_->add_path(path_component);
455 location_->set_span(0, token.
line);
456 location_->set_span(1, token.
column);
465 if (token.
line != location_->span(0)) {
466 location_->add_span(token.
line);
475 parser_->source_location_table_->Add(
482 if (
parser_->source_location_table_ !=
nullptr) {
483 parser_->source_location_table_->AddImport(
489 return location_->path_size();
498 if (!leading->empty()) {
499 location_->mutable_leading_comments()->swap(*leading);
501 if (!trailing->empty()) {
502 location_->mutable_trailing_comments()->swap(*trailing);
548 bool has_allow_alias =
false;
549 bool allow_alias =
false;
551 for (
int i = 0;
i < proto->
options().uninterpreted_option_size();
i++) {
556 if (!option.
name(0).is_extension() &&
557 option.
name(0).name_part() ==
"allow_alias") {
558 has_allow_alias =
true;
566 if (has_allow_alias && !allow_alias) {
568 "\"" + proto->
name() +
569 "\" declares 'option allow_alias = false;' which has no effect. "
570 "Please remove the declaration.";
576 std::set<int> used_values;
577 bool has_duplicates =
false;
580 if (used_values.find(enum_value.
number()) != used_values.end()) {
581 has_duplicates =
true;
584 used_values.insert(enum_value.
number());
587 if (allow_alias && !has_duplicates) {
589 "\"" + proto->
name() +
590 "\" declares support for enum aliases but no enum values share field "
591 "numbers. Please remove the unnecessary 'option allow_alias = true;' "
602 for (
const auto& enum_value : proto->
value()) {
603 if (!IsUpperUnderscore(enum_value.name())) {
605 "Enum constant should be in UPPER_CASE. Found: " +
607 ". See https://developers.google.com/protocol-buffers/docs/style");
648 <<
". Please use 'syntax = \"proto2\";' "
649 <<
"or 'syntax = \"proto3\";' to specify a syntax "
650 <<
"version. (Defaulted to proto2 syntax.)";
674 assert(file !=
NULL);
684 "File must begin with a syntax statement, e.g. 'syntax = \"proto2\";'."));
693 if (syntax !=
"proto2" && syntax !=
"proto3" &&
696 "Unrecognized syntax identifier \"" + syntax +
698 "only recognizes \"proto2\" and \"proto3\".");
743 AddError(
"Expected top-level statement (e.g. \"message\").");
761 if (!IsUpperCamelCase(
message->name())) {
763 "Message name should be in UpperCamelCase. Found: " +
765 ". See https://developers.google.com/protocol-buffers/docs/style");
774 const int kMaxRangeSentinel = -1;
778 for (
int i = 0;
i <
options.uninterpreted_option_size(); ++
i) {
781 uninterpreted.
name(0).name_part() ==
"message_set_wire_format" &&
793 const bool is_message_set = IsMessageSetWireFormatMessage(*
message);
794 const int max_extension_number =
796 for (
int i = 0;
i <
message->extension_range_size(); ++
i) {
797 if (
message->extension_range(
i).end() == kMaxRangeSentinel) {
798 message->mutable_extension_range(
i)->set_end(max_extension_number);
807 const bool is_message_set = IsMessageSetWireFormatMessage(*
message);
808 const int max_field_number =
810 for (
int i = 0;
i <
message->reserved_range_size(); ++
i) {
811 if (
message->reserved_range(
i).end() == kMaxRangeSentinel) {
812 message->mutable_reserved_range(
i)->set_end(max_field_number);
826 AddError(
"Reached end of input in message definition (missing '}').");
837 if (
message->extension_range_size() > 0) {
838 AdjustExtensionRangesWithMaxEndNumber(
message);
840 if (
message->reserved_range_size() > 0) {
841 AdjustReservedRangesWithMaxEndNumber(
message);
874 message->mutable_nested_type(), message_location,
883 int oneof_index =
message->oneof_decl_size();
888 oneof_location, message_location, containing_file);
894 message->add_field(),
message->mutable_nested_type(), message_location,
902 int location_field_number_for_nested_type,
914 "Explicit 'optional' labels are disallowed in the Proto3 syntax. "
915 "To define 'optional' fields in Proto3, simply remove the "
916 "'optional' label, as fields are 'optional' by default.");
922 location_field_number_for_nested_type,
923 field_location, containing_file);
929 int location_field_number_for_nested_type,
938 bool type_parsed =
false;
954 if (
field->has_oneof_index()) {
955 AddError(
"Map fields are not allowed in oneofs.");
958 if (
field->has_label()) {
960 "Field labels (required/optional/repeated) are not allowed on "
964 if (
field->has_extendee()) {
965 AddError(
"Map fields are not allowed to be extensions.");
982 if (!
field->has_label()) {
983 AddError(
"Expected \"required\", \"optional\", or \"repeated\".");
994 if (type_name.empty()) {
999 field->set_type_name(type_name);
1012 if (!IsLowerUnderscore(
field->name())) {
1014 "Field name should be lowercase. Found: " +
field->name() +
1015 ". See: https://developers.google.com/protocol-buffers/docs/style");
1017 if (IsNumberFollowUnderscore(
field->name())) {
1019 "Number should not come right after an underscore. Found: " +
1021 ". See: https://developers.google.com/protocol-buffers/docs/style");
1024 DO(
Consume(
"=",
"Missing field number."));
1045 group_location.
StartAt(field_location);
1046 group_location.
AddPath(location_field_number_for_nested_type);
1073 if (
group->name()[0] <
'A' ||
'Z' <
group->name()[0]) {
1075 "Group names must start with a capital letter.");
1103 field->set_type_name(entry_name);
1144 for (
int i = 0;
i <
field->options().uninterpreted_option_size(); ++
i) {
1146 field->options().uninterpreted_option(
i);
1148 option.
name(0).name_part() ==
"enforce_utf8" &&
1149 !option.
name(0).is_extension()) {
1194 if (
field->has_default_value()) {
1195 AddError(
"Already set option \"default\".");
1196 field->clear_default_value();
1208 if (!
field->has_type()) {
1223 switch (
field->type()) {
1246 "Expected integer for field default value."));
1264 AddError(
"Unsigned field can't have negative default value.");
1269 "Expected integer for field default value."));
1295 AddError(
"Expected \"true\" or \"false\".");
1305 "Expected string for field default "
1316 "Expected enum identifier for field "
1322 AddError(
"Messages can't have default values.");
1332 if (
field->has_json_name()) {
1333 AddError(
"Already set option \"json_name\".");
1334 field->clear_json_name();
1350 "Expected string for JSON name."));
1369 name->mutable_name_part()->append(identifier);
1373 name->mutable_name_part()->append(
".");
1375 name->mutable_name_part()->append(identifier);
1380 name->set_is_extension(
true);
1385 name->mutable_name_part()->append(identifier);
1386 name->set_is_extension(
false);
1396 int brace_depth = 1;
1402 if (brace_depth == 0) {
1412 AddError(
"Unexpected end of stream while parsing aggregate value.");
1424 options->GetDescriptor()->FindFieldByName(
"uninterpreted_option");
1426 <<
"No field named \"uninterpreted_option\" in the Options proto.";
1431 options_location, uninterpreted_option_field->
number(),
1439 down_cast<UninterpretedOption*>(
options->GetReflection()->AddMessage(
1440 options, uninterpreted_option_field));
1478 GOOGLE_LOG(
FATAL) <<
"Trying to read value before any tokens have been read.";
1482 AddError(
"Unexpected end of stream while parsing option value.");
1489 AddError(
"Invalid '-' symbol before identifier.");
1527 AddError(
"Invalid '-' symbol before string.");
1543 AddError(
"Expected option value.");
1563 int old_range_size =
message->extension_range_size();
1568 message->extension_range_size());
1591 end = kMaxRangeSentinel - 1;
1598 end_location.
StartAt(start_token);
1599 end_location.
EndAt(start_token);
1617 message->mutable_extension_range(old_range_size)->mutable_options();
1621 extensions_location, 0 ,
1636 for (
int i = old_range_size + 1;
i <
message->extension_range_size();
i++) {
1637 message->mutable_extension_range(
i)->mutable_options()->CopyFrom(
1641 for (
int i = old_range_size;
i <
message->extension_range_size();
i++) {
1643 if (info.
location(j).path_size() == range_number_index + 1) {
1650 dest->set_path(range_number_index,
i);
1703 :
"Expected field number range.")));
1713 end = kMaxRangeSentinel - 1;
1720 end_location.
StartAt(start_token);
1721 end_location.
EndAt(start_token);
1773 message->add_reserved_range();
1781 (
first ?
"Expected enum value or number range."
1782 :
"Expected enum number range.")));
1798 end_location.
StartAt(start_token);
1799 end_location.
EndAt(start_token);
1815 int location_field_number_for_nested_type,
1829 bool is_first =
true;
1833 AddError(
"Reached end of input in extend definition (missing '}').");
1845 extendee_location.
StartAt(extendee_start);
1846 extendee_location.
EndAt(extendee_end);
1855 field->set_extendee(extendee);
1858 location_field_number_for_nested_type,
location,
1886 AddError(
"Reached end of input in oneof definition (missing '}').");
1905 "Fields in oneofs must not have labels (required / optional "
1918 field->set_oneof_index(oneof_index);
1921 containing_type_location,
1923 field_location, containing_file)) {
1963 AddError(
"Reached end of input in enum definition (missing '}').");
2005 location.RecordLegacyLocation(enum_value,
2008 "Expected enum constant name."));
2011 DO(
Consume(
"=",
"Missing numeric value for enum constant."));
2017 location.RecordLegacyLocation(enum_value,
2064 location.RecordLegacyLocation(service,
2080 AddError(
"Reached end of input in service definition (missing '}').");
2133 method->set_client_streaming(
true);
2155 method->set_server_streaming(
true);
2170 method->mutable_options()));
2181 const int optionsFieldNumber,
2187 AddError(
"Reached end of input in method options (missing '}').");
2227 if (iter != kTypeNames.end()) {
2228 *
type = iter->second;
2240 if (iter != kTypeNames.end()) {
2245 AddError(
"Expected message type.");
2259 type_name->append(identifier);
2263 type_name->append(
".");
2265 type_name->append(identifier);
2276 if (file->has_package()) {
2277 AddError(
"Multiple package definitions.");
2309 dependency->
size());
2316 public_dependency->
size());
2318 *public_dependency->
Add() = dependency->
size();
2322 weak_dependency->
size());
2325 *weak_dependency->
Add() = dependency->
size();
2330 "Expected a string naming the file to import."));
2331 *dependency->
Add() = import_file;
2332 location.RecordLegacyImportLocation(containing_file, import_file);
2347 int* column)
const {
2348 const std::pair<int, int>* result =
2350 if (result ==
NULL) {
2355 *line = result->first;
2356 *column = result->second;
2362 const string&
name,
int* line,
2363 int* column)
const {
2364 const std::pair<int, int>* result =
2366 if (result ==
nullptr) {
2371 *line = result->first;
2372 *column = result->second;
2382 std::make_pair(line, column);
2386 const string&
name,
int line,
int column) {
2388 std::make_pair(line, column);
bool ParseOption(Message *options, const LocationRecorder &options_location, const FileDescriptorProto *containing_file, OptionStyle style)
bool ParsePackage(FileDescriptorProto *file, const LocationRecorder &root_location, const FileDescriptorProto *containing_file)
const std::string & name() const
bool ConsumeIdentifier(std::string *output, const char *error)
PROTOBUF_NAMESPACE_ID::DescriptorProto * add_message_type()
void Init(const LocationRecorder &parent, SourceCodeInfo *source_code_info)
bool ParseExtensions(DescriptorProto *message, const LocationRecorder &extensions_location, const FileDescriptorProto *containing_file)
bool ParseLabel(FieldDescriptorProto::Label *label, const FileDescriptorProto *containing_file)
GLuint const GLchar * name
bool ConsumeNumber(double *output, const char *error)
const Descriptor::ReservedRange value
@ kDoubleValueFieldNumber
@ kIdentifierValueFieldNumber
static constexpr Type TYPE_ENUM
void AddImport(const Message *descriptor, const string &name, int line, int column)
static constexpr Type TYPE_SINT32
std::string syntax_identifier_
string SimpleDtoa(double value)
io::ErrorCollector * error_collector_
bool ConsumeSignedInteger(int *output, const char *error)
std::string upcoming_doc_comments_
SourceCodeInfo * source_code_info_
std::unique_ptr< io::Tokenizer > input_
void Add(const Message *descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int line, int column)
bool ParseExtend(RepeatedPtrField< FieldDescriptorProto > *extensions, RepeatedPtrField< DescriptorProto > *messages, const LocationRecorder &parent_location, int location_field_number_for_nested_type, const LocationRecorder &extend_location, const FileDescriptorProto *containing_file)
const PROTOBUF_NAMESPACE_ID::EnumOptions & options() const
string StrCat(const AlphaNum &a, const AlphaNum &b)
static bool ParseInteger(const std::string &text, uint64 max_value, uint64 *output)
PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto * add_service()
bool require_syntax_identifier_
bool ParseReservedNumbers(DescriptorProto *message, const LocationRecorder &parent_location)
const std::string & name() const
@ kAggregateValueFieldNumber
@ kExtensionRangeFieldNumber
static constexpr Type TYPE_FLOAT
void set_syntax(const std::string &value)
void GenerateMapEntry(const MapField &map_field, FieldDescriptorProto *field, RepeatedPtrField< DescriptorProto > *messages)
void set_number(::PROTOBUF_NAMESPACE_ID::int32 value)
GLuint GLsizei const GLchar * label
bool ParseEnumConstantOptions(EnumValueDescriptorProto *value, const LocationRecorder &enum_value_location, const FileDescriptorProto *containing_file)
std::string * mutable_dependency(int index)
string CEscape(const string &src)
void AddWarning(const string &warning)
bool NextWithComments(std::string *prev_trailing_comments, std::vector< std::string > *detached_comments, std::string *next_leading_comments)
bool ParseFieldOptions(FieldDescriptorProto *field, const LocationRecorder &field_location, const FileDescriptorProto *containing_file)
void AddPath(int path_component)
static int Init(CMessage *self, PyObject *args, PyObject *kwargs)
bool ValidateEnum(const EnumDescriptorProto *proto)
::PROTOBUF_NAMESPACE_ID::int32 number() const
bool ConsumeInteger(int *output, const char *error)
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > * mutable_public_dependency()
virtual void AddError(int line, ColumnNumber column, const std::string &message)=0
bool ParseMessageStatement(DescriptorProto *message, const LocationRecorder &message_location, const FileDescriptorProto *containing_file)
GLsizei const GLchar *const * string
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > * mutable_weak_dependency()
bool ParseImport(RepeatedPtrField< std::string > *dependency, RepeatedField< int32 > *public_dependency, RepeatedField< int32 > *weak_dependency, const LocationRecorder &root_location, const FileDescriptorProto *containing_file)
void RecordLegacyImportLocation(const Message *descriptor, const string &name)
bool stop_after_syntax_identifier_
bool ParseEnumDefinition(EnumDescriptorProto *enum_type, const LocationRecorder &enum_location, const FileDescriptorProto *containing_file)
int location_size() const
zend_class_entry * enum_type
void EndAt(const io::Tokenizer::Token &token)
void Add(const Element &value)
bool FindImport(const Message *descriptor, const string &name, int *line, int *column) const
static constexpr Type TYPE_FIXED32
PROTOBUF_NAMESPACE_ID::FieldDescriptorProto * mutable_extension(int index)
PROTOBUF_NAMESPACE_ID::DescriptorProto * mutable_nested_type(int index)
PROTOBUF_NAMESPACE_ID::MethodDescriptorProto * add_method()
std::string value_type_name
FieldDescriptorProto_Type
static constexpr Type TYPE_BOOL
bool TryConsume(const char *text)
static constexpr Type TYPE_DOUBLE
::PROTOBUF_NAMESPACE_ID::int32 path(int index) const
static const int kMaxNumber
int message_type_size() const
std::unique_ptr< Parser > parser_
bool ParseEnumBlock(EnumDescriptorProto *enum_type, const LocationRecorder &enum_location, const FileDescriptorProto *containing_file)
bool require_syntax_identifier_
std::string key_type_name
bool ParseSyntaxIdentifier(const LocationRecorder &parent)
const Collection::value_type::second_type * FindOrNull(const Collection &collection, const typename Collection::value_type::first_type &key)
std::string * mutable_name()
static constexpr Type TYPE_SFIXED32
bool TryConsumeEndOfDeclaration(const char *text, const LocationRecorder *location)
const PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto & value(int index) const
FieldDescriptorProto::Type value_type
PROTOBUF_NAMESPACE_ID::FieldOptions * mutable_options()
PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type type() const
::PROTOBUF_NAMESPACE_ID::int32 span(int index) const
PROTOBUF_NAMESPACE_ID::FieldDescriptorProto * add_field()
virtual void AddWarning(int line, ColumnNumber column, const std::string &message)
PROTOBUF_NAMESPACE_ID::ServiceOptions * mutable_options()
std::string * mutable_name()
bool ParseEnumStatement(EnumDescriptorProto *message, const LocationRecorder &enum_location, const FileDescriptorProto *containing_file)
bool ParseMethodOptions(const LocationRecorder &parent_location, const FileDescriptorProto *containing_file, const int optionsFieldNumber, Message *mutable_options)
SourceCodeInfo::Location * location_
bool Consume(const char *text, const char *error)
FieldDescriptorProto_Label
static double ParseFloat(const std::string &text)
void set_label(PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value)
@ kNegativeIntValueFieldNumber
bool ParseType(FieldDescriptorProto::Type *type, std::string *type_name)
void AddError(int line, int column, const std::string &error)
#define GOOGLE_LOG(LEVEL)
const PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location & location(int index) const
@ kClientStreamingFieldNumber
bool ConsumeEndOfDeclaration(const char *text, const LocationRecorder *location)
std::string * mutable_name()
static constexpr Type TYPE_FIXED64
int CurrentPathSize() const
const char * detached_comments[10]
static const LogLevel WARNING
static constexpr Label LABEL_OPTIONAL
bool ParseMessageDefinition(DescriptorProto *message, const LocationRecorder &message_location, const FileDescriptorProto *containing_file)
void set_double_value(double value)
static constexpr Type TYPE_BYTES
PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location * add_location()
static void ParseStringAppend(const std::string &text, std::string *output)
void add_span(::PROTOBUF_NAMESPACE_ID::int32 value)
void RecordLegacyLocation(const Message *descriptor, DescriptorPool::ErrorCollector::ErrorLocation location)
std::string * mutable_package()
const FieldDescriptor * field
bool ParseMessageField(FieldDescriptorProto *field, RepeatedPtrField< DescriptorProto > *messages, const LocationRecorder &parent_location, int location_field_number_for_nested_type, const LocationRecorder &field_location, const FileDescriptorProto *containing_file)
static constexpr Type TYPE_SINT64
int FieldSize(const Message &message, const FieldDescriptor *field) const
static constexpr Type TYPE_STRING
void LowerString(string *s)
static constexpr Type TYPE_UINT32
static constexpr Type TYPE_INT64
#define GOOGLE_CHECK(EXPRESSION)
void set_type_name(const std::string &value)
@ kMessageTypeFieldNumber
static constexpr Type TYPE_GROUP
PROTOBUF_NAMESPACE_ID::DescriptorProto * mutable_message_type(int index)
bool DefaultToOptionalFields() const
static const uint32 kuint32max
void AttachComments(std::string *leading, std::string *trailing, std::vector< std::string > *detached_comments) const
bool ParseMessageFieldNoLabel(FieldDescriptorProto *field, RepeatedPtrField< DescriptorProto > *messages, const LocationRecorder &parent_location, int location_field_number_for_nested_type, const LocationRecorder &field_location, const FileDescriptorProto *containing_file)
bool ParseServiceStatement(ServiceDescriptorProto *message, const LocationRecorder &service_location, const FileDescriptorProto *containing_file)
bool ParseOptionNamePart(UninterpretedOption *uninterpreted_option, const LocationRecorder &part_location, const FileDescriptorProto *containing_file)
std::vector< std::string > upcoming_detached_comments_
MockErrorCollector error_collector_
PROTOBUF_NAMESPACE_ID::FileOptions * mutable_options()
bool ParseTopLevelStatement(FileDescriptorProto *file, const LocationRecorder &root_location)
void set_number(::PROTOBUF_NAMESPACE_ID::int32 value)
static const int32 kint32max
bool LookingAt(const char *text)
static void ParseString(const std::string &text, std::string *output)
bool ParseReserved(DescriptorProto *message, const LocationRecorder &message_location)
void set_name(const std::string &value)
bool ParseServiceMethod(MethodDescriptorProto *method, const LocationRecorder &method_location, const FileDescriptorProto *containing_file)
const std::string & identifier_value() const
@ kStringValueFieldNumber
@ kWeakDependencyFieldNumber
SourceCodeInfo * source_code_info_
static constexpr Type TYPE_SFIXED64
PROTOBUF_NAMESPACE_ID::OneofOptions * mutable_options()
PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart * add_name()
void set_positive_int_value(::PROTOBUF_NAMESPACE_ID::uint64 value)
PROTOBUF_NAMESPACE_ID::MessageOptions * mutable_options()
PROTOBUF_NAMESPACE_ID::EnumDescriptorProto * add_enum_type()
bool ParseUninterpretedBlock(std::string *value)
@ kPositiveIntValueFieldNumber
bool ParseServiceDefinition(ServiceDescriptorProto *service, const LocationRecorder &service_location, const FileDescriptorProto *containing_file)
void StartAt(const io::Tokenizer::Token &token)
@ kDefaultValueFieldNumber
bool ParseReservedNames(DescriptorProto *message, const LocationRecorder &parent_location)
PROTOBUF_NAMESPACE_ID::SourceCodeInfo * mutable_source_code_info()
static constexpr Label LABEL_REQUIRED
bool ParseOneof(OneofDescriptorProto *oneof_decl, DescriptorProto *containing_type, int oneof_index, const LocationRecorder &oneof_location, const LocationRecorder &containing_type_location, const FileDescriptorProto *containing_file)
static constexpr Type TYPE_INT32
bool Find(const Message *descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int *line, int *column) const
bool ParseDefaultAssignment(FieldDescriptorProto *field, const LocationRecorder &field_location, const FileDescriptorProto *containing_file)
static const int64 kint64max
static constexpr Type TYPE_UINT64
void Swap(SourceCodeInfo *other)
const PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart & name(int index) const
void set_string_value(const std::string &value)
bool ParseEnumConstant(EnumValueDescriptorProto *enum_value, const LocationRecorder &enum_value_location, const FileDescriptorProto *containing_file)
@ kServerStreamingFieldNumber
static const uint64 kuint64max
static constexpr Label LABEL_REPEATED
@ kReservedRangeFieldNumber
bool ConsumeInteger64(uint64 max_value, uint64 *output, const char *error)
GLsizei const GLfloat * value
std::string * mutable_aggregate_value()
void set_negative_int_value(::PROTOBUF_NAMESPACE_ID::int64 value)
bool ParseUserDefinedType(std::string *type_name)
const upb_json_parsermethod const upb_symtab upb_sink * output
LocationRecorder(Parser *parser)
@ kPublicDependencyFieldNumber
bool ParseServiceBlock(ServiceDescriptorProto *service, const LocationRecorder &service_location, const FileDescriptorProto *containing_file)
static constexpr Type TYPE_MESSAGE
bool LookingAtType(io::Tokenizer::TokenType token_type)
int enum_type_size() const
static uint32_t * group(tarjan *t, upb_refcounted *r)
@ kReservedNameFieldNumber
void set_name(const std::string &value)
void set_identifier_value(const std::string &value)
GLenum GLuint GLenum GLsizei const GLchar * message
bool ParseMessageBlock(DescriptorProto *message, const LocationRecorder &message_location, const FileDescriptorProto *containing_file)
bool Parse(io::Tokenizer *input, FileDescriptorProto *file)
bool ConsumeString(std::string *output, const char *error)
const Descriptor::ReservedRange const EnumValueDescriptor method
FieldDescriptorProto::Type key_type
bool ParseJsonName(FieldDescriptorProto *field, const LocationRecorder &field_location, const FileDescriptorProto *containing_file)
void set_type(PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:57