Merge pull request #10623 from mkruskal-google/sync-stage

Integrate from Piper for C++, Java, and Python
pull/10629/head
Mike Kruskal 2 years ago committed by GitHub
commit 2dcd3e4a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/codespell.yml
  2. 3
      CHANGES.txt
  3. 9
      CMakeLists.txt
  4. 2
      cmake/install.cmake
  5. 25
      java/core/src/main/java/com/google/protobuf/TextFormat.java
  6. 5
      python/google/protobuf/pyext/message.cc
  7. 2
      python/google/protobuf/text_format.py
  8. 114
      src/google/protobuf/any.pb.cc
  9. 51
      src/google/protobuf/any.pb.h
  10. 4
      src/google/protobuf/any_lite.cc
  11. 225
      src/google/protobuf/api.pb.cc
  12. 71
      src/google/protobuf/api.pb.h
  13. 12
      src/google/protobuf/arena.cc
  14. 3
      src/google/protobuf/arena.h
  15. 59
      src/google/protobuf/arena_impl.h
  16. 8
      src/google/protobuf/compiler/code_generator.cc
  17. 19
      src/google/protobuf/compiler/command_line_interface.cc
  18. 1
      src/google/protobuf/compiler/command_line_interface_unittest.cc
  19. 1
      src/google/protobuf/compiler/cpp/BUILD.bazel
  20. 1834
      src/google/protobuf/compiler/cpp/file.cc
  21. 119
      src/google/protobuf/compiler/cpp/file.h
  22. 9
      src/google/protobuf/compiler/cpp/generator.cc
  23. 41
      src/google/protobuf/compiler/cpp/helpers.cc
  24. 41
      src/google/protobuf/compiler/cpp/helpers.h
  25. 10
      src/google/protobuf/compiler/cpp/parse_function_generator.cc
  26. 3
      src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
  27. 13
      src/google/protobuf/compiler/csharp/csharp_enum.cc
  28. 10
      src/google/protobuf/compiler/csharp/csharp_field_base.cc
  29. 8
      src/google/protobuf/compiler/csharp/csharp_field_base.h
  30. 10
      src/google/protobuf/compiler/csharp/csharp_generator.cc
  31. 4
      src/google/protobuf/compiler/csharp/csharp_helpers.cc
  32. 2
      src/google/protobuf/compiler/csharp/csharp_helpers.h
  33. 10
      src/google/protobuf/compiler/csharp/csharp_map_field.cc
  34. 17
      src/google/protobuf/compiler/csharp/csharp_message.cc
  35. 12
      src/google/protobuf/compiler/csharp/csharp_message_field.cc
  36. 2
      src/google/protobuf/compiler/csharp/csharp_names.h
  37. 13
      src/google/protobuf/compiler/csharp/csharp_primitive_field.cc
  38. 13
      src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
  39. 12
      src/google/protobuf/compiler/importer.cc
  40. 12
      src/google/protobuf/compiler/java/helpers.cc
  41. 3
      src/google/protobuf/compiler/java/helpers.h
  42. 23
      src/google/protobuf/compiler/mock_code_generator.cc
  43. 8
      src/google/protobuf/compiler/objectivec/objectivec_enum.cc
  44. 9
      src/google/protobuf/compiler/objectivec/objectivec_extension.cc
  45. 9
      src/google/protobuf/compiler/objectivec/objectivec_field.cc
  46. 11
      src/google/protobuf/compiler/objectivec/objectivec_file.cc
  47. 12
      src/google/protobuf/compiler/objectivec/objectivec_generator.cc
  48. 59
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  49. 11
      src/google/protobuf/compiler/objectivec/objectivec_message.cc
  50. 9
      src/google/protobuf/compiler/objectivec/objectivec_oneof.cc
  51. 9
      src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
  52. 12
      src/google/protobuf/compiler/php/php_generator.cc
  53. 278
      src/google/protobuf/compiler/plugin.pb.cc
  54. 83
      src/google/protobuf/compiler/plugin.pb.h
  55. 21
      src/google/protobuf/compiler/python/generator.cc
  56. 9
      src/google/protobuf/compiler/python/helpers.cc
  57. 1
      src/google/protobuf/compiler/python/helpers.h
  58. 4
      src/google/protobuf/compiler/python/pyi_generator.cc
  59. 24
      src/google/protobuf/descriptor.cc
  60. 23
      src/google/protobuf/descriptor.h
  61. 1631
      src/google/protobuf/descriptor.pb.cc
  62. 261
      src/google/protobuf/descriptor.pb.h
  63. 4
      src/google/protobuf/descriptor_database.cc
  64. 67
      src/google/protobuf/descriptor_unittest.cc
  65. 108
      src/google/protobuf/duration.pb.cc
  66. 51
      src/google/protobuf/duration.pb.h
  67. 102
      src/google/protobuf/empty.pb.cc
  68. 51
      src/google/protobuf/empty.pb.h
  69. 3
      src/google/protobuf/extension_set_unittest.cc
  70. 106
      src/google/protobuf/field_mask.pb.cc
  71. 51
      src/google/protobuf/field_mask.pb.h
  72. 4
      src/google/protobuf/io/gzip_stream.h
  73. 18
      src/google/protobuf/io/printer.cc
  74. 7
      src/google/protobuf/io/printer.h
  75. 6
      src/google/protobuf/lite_unittest.cc
  76. 4
      src/google/protobuf/message_lite.cc
  77. 2
      src/google/protobuf/message_lite.h
  78. 14
      src/google/protobuf/parse_context.h
  79. 4
      src/google/protobuf/proto3_arena_unittest.cc
  80. 106
      src/google/protobuf/source_context.pb.cc
  81. 51
      src/google/protobuf/source_context.pb.h
  82. 231
      src/google/protobuf/struct.pb.cc
  83. 75
      src/google/protobuf/struct.pb.h
  84. 33
      src/google/protobuf/stubs/common_unittest.cc
  85. 667
      src/google/protobuf/stubs/strutil.cc
  86. 228
      src/google/protobuf/stubs/strutil.h
  87. 56
      src/google/protobuf/stubs/strutil_unittest.cc
  88. 3
      src/google/protobuf/testing/googletest.cc
  89. 108
      src/google/protobuf/timestamp.pb.cc
  90. 51
      src/google/protobuf/timestamp.pb.h
  91. 340
      src/google/protobuf/type.pb.cc
  92. 89
      src/google/protobuf/type.pb.h
  93. 7
      src/google/protobuf/util/internal/datapiece.cc
  94. 4
      src/google/protobuf/util/internal/field_mask_utility.cc
  95. 7
      src/google/protobuf/util/internal/json_stream_parser.cc
  96. 7
      src/google/protobuf/util/internal/protostream_objectwriter.cc
  97. 1
      src/google/protobuf/util/internal/utility.cc
  98. 3
      src/google/protobuf/util/json_util.cc
  99. 26
      src/google/protobuf/util/json_util_test.cc
  100. 1
      src/google/protobuf/util/message_differencer.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -13,4 +13,4 @@ jobs:
with:
check_filenames: true
skip: ./.git,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal,./.github/workflows/codespell.yml
ignore_words_list: "alow,alse,ba,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od,optin,streem,sur,falsy"
ignore_words_list: "alow,alse,ba,chec,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od,optin,streem,sur,falsy"

@ -22,6 +22,9 @@
* Turns on table-driven parser for reflection based objects.
* Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor.
* Undefine the macro `linux` when compiling protobuf
* Reduce memory consumption of MessageSet parsing.
* Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor.
* Breaking change: delete Arena::Init
Kotlin

@ -19,6 +19,10 @@ endif()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
# Honor visibility properties for all target types.
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
# Project
project(protobuf C CXX)
@ -53,6 +57,11 @@ else()
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# For -fvisibility=hidden and -fvisibility-inlines-hidden
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# The Intel compiler isn't able to deal with noinline member functions of
# template classes defined in headers. As such it spams the output with
# warning #2196: routine is both "inline" and "noinline"

@ -47,7 +47,7 @@ include(${protobuf_SOURCE_DIR}/src/file_lists.cmake)
set(protobuf_HEADERS
${libprotobuf_hdrs}
${libprotoc_hdrs}
${wkt_protos_proto_srcs}
${wkt_protos_files}
${descriptor_proto_proto_srcs}
${plugin_proto_proto_srcs}
)

@ -61,7 +61,6 @@ public final class TextFormat {
private static final String DEBUG_STRING_SILENT_MARKER = "\t ";
/**
* Outputs a textual representation of the Protocol Message supplied into the parameter output.
* (This representation is the new version of the classic "ProtocolPrinter" output from the
@ -739,9 +738,9 @@ public final class TextFormat {
// Groups must be serialized with their original capitalization.
generator.print(field.getMessageType().getName());
} else {
generator.print(field.getName());
}
generator.print(field.getName());
}
}
if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
generator.print(" {");
@ -1836,16 +1835,16 @@ public final class TextFormat {
extension = target.findExtensionByName(extensionRegistry, name);
if (extension == null) {
String message =
(tokenizer.getPreviousLine() + 1)
+ ":"
+ (tokenizer.getPreviousColumn() + 1)
+ ":\t"
+ type.getFullName()
+ ".["
+ name
+ "]";
unknownFields.add(new UnknownField(message, UnknownField.Type.EXTENSION));
String message =
(tokenizer.getPreviousLine() + 1)
+ ":"
+ (tokenizer.getPreviousColumn() + 1)
+ ":\t"
+ type.getFullName()
+ ".["
+ name
+ "]";
unknownFields.add(new UnknownField(message, UnknownField.Type.EXTENSION));
} else {
if (extension.descriptor.getContainingType() != type) {
throw tokenizer.parseExceptionPreviousToken(

@ -42,7 +42,7 @@
#include <string>
#include <vector>
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#ifndef PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
@ -70,6 +70,7 @@
#include "google/protobuf/pyext/unknown_field_set.h"
#include "google/protobuf/pyext/unknown_fields.h"
#include "google/protobuf/util/message_differencer.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/strtod.h"
@ -409,7 +410,7 @@ static PyObject* GetClassAttribute(CMessageClass *self, PyObject* name) {
Py_ssize_t attr_size;
static const char kSuffix[] = "_FIELD_NUMBER";
if (PyString_AsStringAndSize(name, &attr, &attr_size) >= 0 &&
HasSuffixString(absl::string_view(attr, attr_size), kSuffix)) {
absl::EndsWith(absl::string_view(attr, attr_size), kSuffix)) {
std::string field_name(attr, attr_size - sizeof(kSuffix) + 1);
LowerString(&field_name);

@ -1013,6 +1013,8 @@ class _Parser(object):
if not tokenizer.TryConsume(','):
tokenizer.TryConsume(';')
def _LogSilentMarker(self, field_name):
pass
def _DetectSilentMarker(self, tokenizer, field_name):

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto
#include <google/protobuf/any.pb.h>
#include "google/protobuf/any.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,16 +12,15 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
#if defined(__llvm__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wuninitialized"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wuninitialized"
#endif // __llvm__
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Any::Any(
@ -32,64 +30,88 @@ PROTOBUF_CONSTEXPR Any::Any(
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_._any_metadata_)*/{&_impl_.type_url_, &_impl_.value_}} {}
struct AnyDefaultTypeInternal {
PROTOBUF_CONSTEXPR AnyDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR AnyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~AnyDefaultTypeInternal() {}
union {
Any _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AnyDefaultTypeInternal _Any_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AnyDefaultTypeInternal _Any_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.value_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.value_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Any)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Any)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Any_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Any_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\031google/protobuf/any.proto\022\017google.prot"
"obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
" \001(\014Bv\n\023com.google.protobufB\010AnyProtoP\001Z"
",google.golang.org/protobuf/types/known/"
"anypb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownT"
"ypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\031google/protobuf/any.proto\022\017google.prot"
"obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
" \001(\014Bv\n\023com.google.protobufB\010AnyProtoP\001Z"
",google.golang.org/protobuf/types/known/"
"anypb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownT"
"ypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
false, false, 212, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto,
false,
false,
212,
descriptor_table_protodef_google_2fprotobuf_2fany_2eproto,
"google/protobuf/any.proto",
&descriptor_table_google_2fprotobuf_2fany_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fany_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto,
&descriptor_table_google_2fprotobuf_2fany_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fany_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fany_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fany_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fany_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fany_2eproto(&descriptor_table_google_2fprotobuf_2fany_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fany_2eproto(&descriptor_table_google_2fprotobuf_2fany_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
bool Any::GetAnyFieldDescriptors(
@ -353,7 +375,6 @@ void Any::InternalSwap(Any* other) {
&descriptor_table_google_2fprotobuf_2fany_2eproto_getter, &descriptor_table_google_2fprotobuf_2fany_2eproto_once,
file_level_metadata_google_2fprotobuf_2fany_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -362,9 +383,8 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Any >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#if defined(__llvm__)
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#endif // __llvm__
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,8 +32,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -43,19 +48,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fany_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Any;
struct AnyDefaultTypeInternal;
PROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Any final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
public:
@ -262,12 +271,17 @@ class PROTOBUF_EXPORT Any final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Any
// string type_url = 1;
@ -371,14 +385,15 @@ inline void Any::set_allocated_value(std::string* value) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto_2epb_2eh

@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/any.h"
#include "google/protobuf/arenastring.h"
@ -72,7 +72,7 @@ bool AnyMetadata::InternalIs(absl::string_view type_name) const {
absl::string_view type_url = type_url_->Get();
return type_url.size() >= type_name.size() + 1 &&
type_url[type_url.size() - type_name.size() - 1] == '/' &&
HasSuffixString(type_url, type_name);
absl::EndsWith(type_url, type_name);
}
bool ParseAnyTypeUrl(absl::string_view type_url, std::string* url_prefix,

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
#include <google/protobuf/api.pb.h>
#include "google/protobuf/api.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,13 +12,12 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Api::Api(
::_pbi::ConstantInitialized): _impl_{
@ -32,14 +30,15 @@ PROTOBUF_CONSTEXPR Api::Api(
, /*decltype(_impl_.syntax_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ApiDefaultTypeInternal {
PROTOBUF_CONSTEXPR ApiDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR ApiDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~ApiDefaultTypeInternal() {}
union {
Api _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ApiDefaultTypeInternal _Api_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ApiDefaultTypeInternal _Api_default_instance_;
PROTOBUF_CONSTEXPR Method::Method(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.options_)*/{}
@ -51,129 +50,155 @@ PROTOBUF_CONSTEXPR Method::Method(
, /*decltype(_impl_.syntax_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct MethodDefaultTypeInternal {
PROTOBUF_CONSTEXPR MethodDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR MethodDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~MethodDefaultTypeInternal() {}
union {
Method _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MethodDefaultTypeInternal _Method_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MethodDefaultTypeInternal _Method_default_instance_;
PROTOBUF_CONSTEXPR Mixin::Mixin(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.root_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct MixinDefaultTypeInternal {
PROTOBUF_CONSTEXPR MixinDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR MixinDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~MixinDefaultTypeInternal() {}
union {
Mixin _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MixinDefaultTypeInternal _Mixin_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MixinDefaultTypeInternal _Mixin_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fapi_2eproto[3];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.methods_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.version_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.mixins_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.request_type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.request_streaming_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.response_type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.response_streaming_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _impl_.root_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.methods_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.version_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.mixins_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.request_type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.request_streaming_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.response_type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.response_streaming_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _impl_.root_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Api)},
{ 15, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Method)},
{ 30, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Mixin)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Api)},
{ 15, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Method)},
{ 30, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Mixin)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Api_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Method_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Api_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Method_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\031google/protobuf/api.proto\022\017google.prot"
"obuf\032$google/protobuf/source_context.pro"
"to\032\032google/protobuf/type.proto\"\201\002\n\003Api\022\014"
"\n\004name\030\001 \001(\t\022(\n\007methods\030\002 \003(\0132\027.google.p"
"rotobuf.Method\022(\n\007options\030\003 \003(\0132\027.google"
".protobuf.Option\022\017\n\007version\030\004 \001(\t\0226\n\016sou"
"rce_context\030\005 \001(\0132\036.google.protobuf.Sour"
"ceContext\022&\n\006mixins\030\006 \003(\0132\026.google.proto"
"buf.Mixin\022\'\n\006syntax\030\007 \001(\0162\027.google.proto"
"buf.Syntax\"\325\001\n\006Method\022\014\n\004name\030\001 \001(\t\022\030\n\020r"
"equest_type_url\030\002 \001(\t\022\031\n\021request_streami"
"ng\030\003 \001(\010\022\031\n\021response_type_url\030\004 \001(\t\022\032\n\022r"
"esponse_streaming\030\005 \001(\010\022(\n\007options\030\006 \003(\013"
"2\027.google.protobuf.Option\022\'\n\006syntax\030\007 \001("
"\0162\027.google.protobuf.Syntax\"#\n\005Mixin\022\014\n\004n"
"ame\030\001 \001(\t\022\014\n\004root\030\002 \001(\tBv\n\023com.google.pr"
"otobufB\010ApiProtoP\001Z,google.golang.org/pr"
"otobuf/types/known/apipb\242\002\003GPB\252\002\036Google."
"Protobuf.WellKnownTypesb\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fapi_2eproto_deps[2] = {
&::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto,
&::descriptor_table_google_2fprotobuf_2ftype_2eproto,
const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\031google/protobuf/api.proto\022\017google.prot"
"obuf\032$google/protobuf/source_context.pro"
"to\032\032google/protobuf/type.proto\"\201\002\n\003Api\022\014"
"\n\004name\030\001 \001(\t\022(\n\007methods\030\002 \003(\0132\027.google.p"
"rotobuf.Method\022(\n\007options\030\003 \003(\0132\027.google"
".protobuf.Option\022\017\n\007version\030\004 \001(\t\0226\n\016sou"
"rce_context\030\005 \001(\0132\036.google.protobuf.Sour"
"ceContext\022&\n\006mixins\030\006 \003(\0132\026.google.proto"
"buf.Mixin\022\'\n\006syntax\030\007 \001(\0162\027.google.proto"
"buf.Syntax\"\325\001\n\006Method\022\014\n\004name\030\001 \001(\t\022\030\n\020r"
"equest_type_url\030\002 \001(\t\022\031\n\021request_streami"
"ng\030\003 \001(\010\022\031\n\021response_type_url\030\004 \001(\t\022\032\n\022r"
"esponse_streaming\030\005 \001(\010\022(\n\007options\030\006 \003(\013"
"2\027.google.protobuf.Option\022\'\n\006syntax\030\007 \001("
"\0162\027.google.protobuf.Syntax\"#\n\005Mixin\022\014\n\004n"
"ame\030\001 \001(\t\022\014\n\004root\030\002 \001(\tBv\n\023com.google.pr"
"otobufB\010ApiProtoP\001Z,google.golang.org/pr"
"otobuf/types/known/apipb\242\002\003GPB\252\002\036Google."
"Protobuf.WellKnownTypesb\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fapi_2eproto_deps[2] =
{
&::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto,
&::descriptor_table_google_2fprotobuf_2ftype_2eproto,
};
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fapi_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto = {
false, false, 751, descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto,
false,
false,
751,
descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto,
"google/protobuf/api.proto",
&descriptor_table_google_2fprotobuf_2fapi_2eproto_once, descriptor_table_google_2fprotobuf_2fapi_2eproto_deps, 2, 3,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fapi_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fapi_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto,
&descriptor_table_google_2fprotobuf_2fapi_2eproto_once,
descriptor_table_google_2fprotobuf_2fapi_2eproto_deps,
2,
3,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fapi_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fapi_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fapi_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fapi_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fapi_2eproto(&descriptor_table_google_2fprotobuf_2fapi_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fapi_2eproto(&descriptor_table_google_2fprotobuf_2fapi_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class Api::_Internal {
@ -613,7 +638,6 @@ void Api::InternalSwap(Api* other) {
&descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once,
file_level_metadata_google_2fprotobuf_2fapi_2eproto[0]);
}
// ===================================================================
class Method::_Internal {
@ -1040,7 +1064,6 @@ void Method::InternalSwap(Method* other) {
&descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once,
file_level_metadata_google_2fprotobuf_2fapi_2eproto[1]);
}
// ===================================================================
class Mixin::_Internal {
@ -1293,7 +1316,6 @@ void Mixin::InternalSwap(Mixin* other) {
&descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once,
file_level_metadata_google_2fprotobuf_2fapi_2eproto[2]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -1310,6 +1332,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Mixin >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Mixin >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -30,11 +31,15 @@
#include "google/protobuf/repeated_field.h" // IWYU pragma: export
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
#include <google/protobuf/source_context.pb.h>
#include <google/protobuf/type.pb.h>
#include "google/protobuf/source_context.pb.h"
#include "google/protobuf/type.pb.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -45,7 +50,8 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fapi_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fapi_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Api;
struct ApiDefaultTypeInternal;
@ -56,16 +62,21 @@ PROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_;
class Mixin;
struct MixinDefaultTypeInternal;
PROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Api>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Method>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Mixin>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Api>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Method>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Mixin>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Api final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
public:
@ -323,8 +334,7 @@ class PROTOBUF_EXPORT Api final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Method final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
@ -561,8 +571,7 @@ class PROTOBUF_EXPORT Method final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Mixin final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
@ -734,12 +743,17 @@ class PROTOBUF_EXPORT Mixin final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Api
// string name = 1;
@ -1420,18 +1434,15 @@ inline void Mixin::set_allocated_root(std::string* root) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto_2epb_2eh

@ -105,7 +105,7 @@ class GetDeallocator {
size_t* space_allocated_;
};
SerialArena::SerialArena(Block* b, ThreadSafeArena& parent)
SerialArena::SerialArena(ArenaBlock* b, ThreadSafeArena& parent)
: parent_(parent), space_allocated_(b->size()) {
set_head(b);
set_ptr(b->Pointer(kBlockHeaderSize + ThreadSafeArena::kSerialArenaSize));
@ -117,13 +117,13 @@ SerialArena* SerialArena::New(Memory mem, ThreadSafeArena& parent) {
ThreadSafeArenaStats::RecordAllocateStats(parent.arena_stats_.MutableStats(),
/*used=*/0, /*allocated=*/mem.size,
/*wasted=*/0);
auto b = new (mem.ptr) Block{nullptr, mem.size};
auto b = new (mem.ptr) ArenaBlock{nullptr, mem.size};
return new (b->Pointer(kBlockHeaderSize)) SerialArena(b, parent);
}
template <typename Deallocator>
SerialArena::Memory SerialArena::Free(Deallocator deallocator) {
Block* b = head();
ArenaBlock* b = head();
Memory mem = {b, b->size()};
while (b->next) {
b = b->next; // We must first advance before deleting this block
@ -179,7 +179,7 @@ void SerialArena::AllocateNewBlock(size_t n) {
ThreadSafeArenaStats::RecordAllocateStats(parent_.arena_stats_.MutableStats(),
/*used=*/used,
/*allocated=*/mem.size, wasted);
set_head(new (mem.ptr) Block{head(), mem.size});
set_head(new (mem.ptr) ArenaBlock{head(), mem.size});
set_ptr(head()->Pointer(kBlockHeaderSize));
limit_ = head()->Pointer(head()->size());
@ -199,7 +199,7 @@ uint64_t SerialArena::SpaceUsed() const {
const uint64_t current_block_size = head()->size();
uint64_t space_used = std::min(
static_cast<uint64_t>(
ptr() - const_cast<Block*>(head())->Pointer(kBlockHeaderSize)),
ptr() - const_cast<ArenaBlock*>(head())->Pointer(kBlockHeaderSize)),
current_block_size);
space_used += space_used_.load(std::memory_order_relaxed);
// Remove the overhead of the SerialArena itself.
@ -208,7 +208,7 @@ uint64_t SerialArena::SpaceUsed() const {
}
void SerialArena::CleanupList() {
Block* b = head();
ArenaBlock* b = head();
b->cleanup_nodes = limit_;
do {
char* limit = reinterpret_cast<char*>(

@ -252,9 +252,6 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
inline ~Arena() {}
// TODO(protobuf-team): Fix callers to use constructor and delete this method.
void Init(const ArenaOptions&) {}
// API to create proto2 message objects on the arena. If the arena passed in
// is nullptr, then a heap allocated object is returned. Type T must be a
// message defined in a .proto file with cc_enable_arenas set to true,

@ -90,6 +90,29 @@ inline PROTOBUF_ALWAYS_INLINE void* AlignTo(void* p, size_t a) {
}
}
// Arena blocks are variable length malloc-ed objects. The following structure
// describes the common header for all blocks.
struct ArenaBlock {
ArenaBlock(ArenaBlock* next, size_t size)
: next(next), cleanup_nodes(nullptr), relaxed_size(size) {
GOOGLE_DCHECK_GT(size, sizeof(ArenaBlock));
}
char* Pointer(size_t n) {
GOOGLE_DCHECK(n <= size());
return reinterpret_cast<char*>(this) + n;
}
size_t size() const { return relaxed_size.load(std::memory_order_relaxed); }
ArenaBlock* const next;
void* cleanup_nodes;
private:
const std::atomic<size_t> relaxed_size;
// data follows
};
namespace cleanup {
template <typename T>
@ -545,29 +568,8 @@ class PROTOBUF_EXPORT SerialArena {
template <typename Deallocator>
Memory Free(Deallocator deallocator);
// Blocks are variable length malloc-ed objects. The following structure
// describes the common header for all blocks.
struct Block {
Block(Block* next, size_t size)
: next(next), cleanup_nodes(nullptr), relaxed_size(size) {}
char* Pointer(size_t n) {
GOOGLE_DCHECK(n <= size());
return reinterpret_cast<char*>(this) + n;
}
size_t size() const { return relaxed_size.load(std::memory_order_relaxed); }
Block* const next;
void* cleanup_nodes;
private:
const std::atomic<size_t> relaxed_size;
// data follows
};
ThreadSafeArena& parent_;
std::atomic<Block*> head_; // Head of linked list of blocks.
std::atomic<ArenaBlock*> head_; // Head of linked list of blocks.
std::atomic<size_t> space_used_{0}; // Necessary for metrics.
std::atomic<size_t> space_allocated_;
@ -577,9 +579,11 @@ class PROTOBUF_EXPORT SerialArena {
std::atomic<char*> ptr_;
// Helper getters/setters to handle relaxed operations on atomic variables.
Block* head() { return head_.load(std::memory_order_relaxed); }
const Block* head() const { return head_.load(std::memory_order_relaxed); }
void set_head(Block* head) {
ArenaBlock* head() { return head_.load(std::memory_order_relaxed); }
const ArenaBlock* head() const {
return head_.load(std::memory_order_relaxed);
}
void set_head(ArenaBlock* head) {
return head_.store(head, std::memory_order_relaxed);
}
char* ptr() { return ptr_.load(std::memory_order_relaxed); }
@ -604,7 +608,8 @@ class PROTOBUF_EXPORT SerialArena {
CachedBlock** cached_blocks_ = nullptr;
// Constructor is private as only New() should be used.
inline SerialArena(Block* b, ThreadSafeArena& parent);
inline SerialArena(ArenaBlock* b, ThreadSafeArena& parent);
void* AllocateAlignedFallback(size_t n);
void* AllocateAlignedWithCleanupFallback(size_t n, size_t align,
void (*destructor)(void*));
@ -612,7 +617,7 @@ class PROTOBUF_EXPORT SerialArena {
void AllocateNewBlock(size_t n);
public:
static constexpr size_t kBlockHeaderSize = AlignUpTo8(sizeof(Block));
static constexpr size_t kBlockHeaderSize = AlignUpTo8(sizeof(ArenaBlock));
};
// Tag type used to invoke the constructor of message-owned arena.

@ -38,8 +38,8 @@
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/compiler/plugin.pb.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
namespace google {
namespace protobuf {
@ -126,10 +126,10 @@ void ParseGeneratorParameter(
// Strips ".proto" or ".protodevel" from the end of a filename.
std::string StripProto(const std::string& filename) {
if (HasSuffixString(filename, ".protodevel")) {
return StripSuffixString(filename, ".protodevel");
if (absl::EndsWith(filename, ".protodevel")) {
return std::string(absl::StripSuffix(filename, ".protodevel"));
} else {
return StripSuffixString(filename, ".proto");
return std::string(absl::StripSuffix(filename, ".proto"));
}
}

@ -75,6 +75,7 @@
#include "google/protobuf/compiler/subprocess.h"
#include "google/protobuf/compiler/plugin.pb.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "google/protobuf/stubs/stringprintf.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
@ -1065,9 +1066,9 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
if (mode_ == MODE_COMPILE) {
for (int i = 0; i < output_directives_.size(); i++) {
std::string output_location = output_directives_[i].output_location;
if (!HasSuffixString(output_location, ".zip") &&
!HasSuffixString(output_location, ".jar") &&
!HasSuffixString(output_location, ".srcjar")) {
if (!absl::EndsWith(output_location, ".zip") &&
!absl::EndsWith(output_location, ".jar") &&
!absl::EndsWith(output_location, ".srcjar")) {
AddTrailingSlash(&output_location);
}
@ -1088,12 +1089,12 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
for (const auto& pair : output_directories) {
const std::string& location = pair.first;
GeneratorContextImpl* directory = pair.second.get();
if (HasSuffixString(location, "/")) {
if (absl::EndsWith(location, "/")) {
if (!directory->WriteAllToDisk(location)) {
return 1;
}
} else {
if (HasSuffixString(location, ".jar")) {
if (absl::EndsWith(location, ".jar")) {
directory->AddJarManifest();
}
@ -1971,7 +1972,7 @@ CommandLineInterface::InterpretArgument(const std::string& name,
// Some other flag. Look it up in the generators list.
const GeneratorInfo* generator_info = FindGeneratorByFlag(name);
if (generator_info == nullptr &&
(plugin_prefix_.empty() || !HasSuffixString(name, "_out"))) {
(plugin_prefix_.empty() || !absl::EndsWith(name, "_out"))) {
// Check if it's a generator option flag.
generator_info = FindGeneratorByOption(name);
if (generator_info != nullptr) {
@ -1981,7 +1982,7 @@ CommandLineInterface::InterpretArgument(const std::string& name,
parameters->append(",");
}
parameters->append(value);
} else if (HasPrefixString(name, "--") && HasSuffixString(name, "_opt")) {
} else if (absl::StartsWith(name, "--") && absl::EndsWith(name, "_opt")) {
std::string* parameters =
&plugin_parameters_[PluginName(plugin_prefix_, name)];
if (!parameters->empty()) {
@ -2165,8 +2166,8 @@ bool CommandLineInterface::GenerateOutput(
std::string error;
if (output_directive.generator == nullptr) {
// This is a plugin.
GOOGLE_CHECK(HasPrefixString(output_directive.name, "--") &&
HasSuffixString(output_directive.name, "_out"))
GOOGLE_CHECK(absl::StartsWith(output_directive.name, "--") &&
absl::EndsWith(output_directive.name, "_out"))
<< "Bad name for plugin generator: " << output_directive.name;
std::string plugin_name = PluginName(plugin_prefix_, output_directive.name);

@ -794,6 +794,7 @@ TEST_F(CommandLineInterfaceTest, MultipleInputsWithImport) {
"bar.proto", "Bar");
}
TEST_F(CommandLineInterfaceTest, MultipleInputsWithImport_DescriptorSetIn) {
// Test parsing multiple input files with an import of a separate file.
FileDescriptorSet file_descriptor_set;

@ -56,6 +56,7 @@ cc_library(
"//src/google/protobuf:protobuf_nowkt",
"//src/google/protobuf/compiler:code_generator",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/container:layout",

File diff suppressed because it is too large Load Diff

@ -36,55 +36,47 @@
#define GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__
#include <algorithm>
#include <functional>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/compiler/scc.h"
#include "absl/container/flat_hash_set.h"
#include "google/protobuf/compiler/cpp/enum.h"
#include "google/protobuf/compiler/cpp/extension.h"
#include "google/protobuf/compiler/cpp/field.h"
#include "google/protobuf/compiler/cpp/helpers.h"
#include "google/protobuf/port.h"
#include "google/protobuf/compiler/scc.h"
#include "google/protobuf/compiler/cpp/message.h"
#include "google/protobuf/compiler/cpp/options.h"
#include "google/protobuf/compiler/cpp/service.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/port.h"
namespace google {
namespace protobuf {
class FileDescriptor; // descriptor.h
namespace io {
class Printer; // printer.h
}
} // namespace protobuf
} // namespace google
namespace google {
namespace protobuf {
namespace compiler {
namespace cpp {
class EnumGenerator; // enum.h
class MessageGenerator; // message.h
class ServiceGenerator; // service.h
class ExtensionGenerator; // extension.h
class FileGenerator {
public:
// See generator.cc for the meaning of dllexport_decl.
FileGenerator(const FileDescriptor* file, const Options& options);
FileGenerator(const FileGenerator&) = delete;
FileGenerator& operator=(const FileGenerator&) = delete;
~FileGenerator();
// Shared code between the two header generators below.
void GenerateHeader(io::Printer* printer);
~FileGenerator() = default;
// info_path, if non-empty, should be the path (relative to printer's
// output) to the metadata file describing this proto header.
void GenerateProtoHeader(io::Printer* printer, const std::string& info_path);
void GenerateProtoHeader(io::Printer* p, absl::string_view info_path);
// info_path, if non-empty, should be the path (relative to printer's
// output) to the metadata file describing this PB header.
void GeneratePBHeader(io::Printer* printer, const std::string& info_path);
void GenerateSource(io::Printer* printer);
void GeneratePBHeader(io::Printer* p, absl::string_view info_path);
void GenerateSource(io::Printer* p);
// The following member functions are used when the lite_implicit_weak_fields
// option is set. In this mode the code is organized a bit differently to
@ -95,80 +87,86 @@ class FileGenerator {
int NumMessages() const { return message_generators_.size(); }
int NumExtensions() const { return extension_generators_.size(); }
// Generates the source file for one message.
void GenerateSourceForMessage(int idx, io::Printer* printer);
void GenerateSourceForMessage(int idx, io::Printer* p);
// Generates the source file for one extension.
void GenerateSourceForExtension(int idx, io::Printer* printer);
void GenerateSourceForExtension(int idx, io::Printer* p);
// Generates a source file containing everything except messages and
// extensions.
void GenerateGlobalSource(io::Printer* printer);
void GenerateGlobalSource(io::Printer* p);
private:
// Generates a file, setting up the necessary accoutrements that start and
// end the file, calling `cb` in between.
//
// This includes header guards and file-global variables.
void GenerateFile(io::Printer* p, GeneratedFileType file_type,
std::function<void()> cb);
// Shared code between the two header generators.
void GenerateSharedHeaderCode(io::Printer* p);
// Internal type used by GenerateForwardDeclarations (defined in file.cc).
class ForwardDeclarations;
struct CrossFileReferences;
void IncludeFile(const std::string& google3_name, io::Printer* printer) {
DoIncludeFile(google3_name, false, printer);
void IncludeFile(absl::string_view google3_name, io::Printer* p) {
DoIncludeFile(google3_name, false, p);
}
void IncludeFileAndExport(const std::string& google3_name,
io::Printer* printer) {
DoIncludeFile(google3_name, true, printer);
void IncludeFileAndExport(absl::string_view google3_name, io::Printer* p) {
DoIncludeFile(google3_name, true, p);
}
void DoIncludeFile(const std::string& google3_name, bool do_export,
io::Printer* printer);
void DoIncludeFile(absl::string_view google3_name, bool do_export,
io::Printer* p);
std::string CreateHeaderInclude(const std::string& basename,
std::string CreateHeaderInclude(absl::string_view basename,
const FileDescriptor* file);
void GetCrossFileReferencesForField(const FieldDescriptor* field,
CrossFileReferences* refs);
void GetCrossFileReferencesForFile(const FileDescriptor* file,
CrossFileReferences* refs);
void GenerateInternalForwardDeclarations(const CrossFileReferences& refs,
io::Printer* printer);
void GenerateSourceIncludes(io::Printer* printer);
void GenerateSourcePrelude(io::Printer* printer);
void GenerateSourceDefaultInstance(int idx, io::Printer* printer);
io::Printer* p);
void GenerateSourceIncludes(io::Printer* p);
void GenerateSourcePrelude(io::Printer* p);
void GenerateSourceDefaultInstance(int idx, io::Printer* p);
void GenerateInitForSCC(const SCC* scc, const CrossFileReferences& refs,
io::Printer* printer);
void GenerateReflectionInitializationCode(io::Printer* printer);
io::Printer* p);
void GenerateReflectionInitializationCode(io::Printer* p);
// For other imports, generates their forward-declarations.
void GenerateForwardDeclarations(io::Printer* printer);
void GenerateForwardDeclarations(io::Printer* p);
// Generates top or bottom of a header file.
void GenerateTopHeaderGuard(
io::Printer* printer, google::protobuf::compiler::cpp::GeneratedFileType file_type);
void GenerateBottomHeaderGuard(
io::Printer* printer, google::protobuf::compiler::cpp::GeneratedFileType file_type);
void GenerateTopHeaderGuard(io::Printer* p, GeneratedFileType file_type);
void GenerateBottomHeaderGuard(io::Printer* p, GeneratedFileType file_type);
// Generates #include directives.
void GenerateLibraryIncludes(io::Printer* printer);
void GenerateDependencyIncludes(io::Printer* printer);
void GenerateLibraryIncludes(io::Printer* p);
void GenerateDependencyIncludes(io::Printer* p);
// Generate a pragma to pull in metadata using the given info_path (if
// non-empty). info_path should be relative to printer's output.
void GenerateMetadataPragma(io::Printer* printer,
const std::string& info_path);
void GenerateMetadataPragma(io::Printer* p, absl::string_view info_path);
// Generates a couple of different pieces before definitions:
void GenerateGlobalStateFunctionDeclarations(io::Printer* printer);
void GenerateGlobalStateFunctionDeclarations(io::Printer* p);
// Generates types for classes.
void GenerateMessageDefinitions(io::Printer* printer);
void GenerateMessageDefinitions(io::Printer* p);
void GenerateEnumDefinitions(io::Printer* printer);
void GenerateEnumDefinitions(io::Printer* p);
// Generates generic service definitions.
void GenerateServiceDefinitions(io::Printer* printer);
void GenerateServiceDefinitions(io::Printer* p);
// Generates extension identifiers.
void GenerateExtensionIdentifiers(io::Printer* printer);
void GenerateExtensionIdentifiers(io::Printer* p);
// Generates inline function definitions.
void GenerateInlineFunctionDefinitions(io::Printer* printer);
void GenerateInlineFunctionDefinitions(io::Printer* p);
void GenerateProto2NamespaceEnumSpecializations(io::Printer* printer);
void GenerateProto2NamespaceEnumSpecializations(io::Printer* p);
// Sometimes the names we use in a .proto file happen to be defined as
// macros on some platforms (e.g., macro/minor used in plugin.proto are
@ -177,7 +175,7 @@ class FileGenerator {
// undef the macro for these few platforms, or rename the field name for all
// platforms. Since these names are part of protobuf public API, renaming is
// generally a breaking change so we prefer the #undef approach.
void GenerateMacroUndefs(io::Printer* printer);
void GenerateMacroUndefs(io::Printer* p);
bool IsDepWeak(const FileDescriptor* dep) const {
if (weak_deps_.count(dep) != 0) {
@ -187,13 +185,16 @@ class FileGenerator {
return false;
}
std::set<const FileDescriptor*> weak_deps_;
absl::flat_hash_set<const FileDescriptor*> weak_deps_;
const FileDescriptor* file_;
const Options options_;
Options options_;
MessageSCCAnalyzer scc_analyzer_;
// This member is unused and should be deleted once all old-style variable
// maps are gone.
// TODO(b/245791219)
std::map<std::string, std::string> variables_;
// Contains the post-order walk of all the messages (and child messages) in

@ -70,6 +70,9 @@ absl::flat_hash_map<std::string, std::string> CommonVars(
{"uint32", "uint32_t"},
{"uint64", "uint64_t"},
{"hrule_thick", kThickSeparator},
{"hrule_thin", kThinSeparator},
// Warning: there is some clever naming/splitting here to avoid extract
// script rewrites. The names of these variables must not be things that
// the extract script will rewrite. That's why we use "CHK" (for example)
@ -83,9 +86,11 @@ absl::flat_hash_map<std::string, std::string> CommonVars(
: "GOOGLE3_PROTOBU"
"F"},
{"CHK", is_oss ? "GOOGLE_CHECK"
: "CHECK"},
: "CHEC"
"K"},
{"DCHK", is_oss ? "GOOGLE_DCHECK"
: "DCHECK"},
: "DCHEC"
"K"},
};
}
} // namespace

@ -43,6 +43,7 @@
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "google/protobuf/stubs/common.h"
@ -1087,6 +1088,46 @@ bool IsWellKnownMessage(const FileDescriptor* file) {
return well_known_files->find(file->name()) != well_known_files->end();
}
void NamespaceOpener::ChangeTo(absl::string_view name) {
std::vector<std::string> new_stack =
absl::StrSplit(name, "::", absl::SkipEmpty());
size_t len = std::min(name_stack_.size(), new_stack.size());
size_t common_idx = 0;
while (common_idx < len) {
if (name_stack_[common_idx] != new_stack[common_idx]) {
break;
}
++common_idx;
}
for (size_t i = name_stack_.size(); i > common_idx; i--) {
const auto& ns = name_stack_[i - 1];
if (ns == "PROTOBUF_NAMESPACE_ID") {
p_->Emit(R"cc(
PROTOBUF_NAMESPACE_CLOSE
)cc");
} else {
p_->Emit({{"ns", ns}}, R"(
} // namespace $ns$
)");
}
}
for (size_t i = common_idx; i < new_stack.size(); ++i) {
const auto& ns = new_stack[i];
if (ns == "PROTOBUF_NAMESPACE_ID") {
p_->Emit(R"cc(
PROTOBUF_NAMESPACE_OPEN
)cc");
} else {
p_->Emit({{"ns", ns}}, R"(
namespace $ns$ {
)");
}
}
name_stack_ = std::move(new_stack);
}
static void GenerateUtf8CheckCode(const FieldDescriptor* field,
const Options& options, bool for_parse,
const char* parameters,

@ -44,7 +44,7 @@
#include "google/protobuf/compiler/scc.h"
#include "google/protobuf/compiler/code_generator.h"
#include "absl/container/flat_hash_map.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/cpp/names.h"
#include "google/protobuf/compiler/cpp/options.h"
@ -52,6 +52,7 @@
#include "google/protobuf/io/printer.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/port.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/str_cat.h"
// Must be included last.
@ -887,43 +888,21 @@ void PrintFieldComment(const Formatter& format, const T* field) {
class PROTOC_EXPORT NamespaceOpener {
public:
explicit NamespaceOpener(const Formatter& format)
: printer_(format.printer()) {}
NamespaceOpener(const std::string& name, const Formatter& format)
explicit NamespaceOpener(io::Printer* p) : p_(p) {}
explicit NamespaceOpener(const Formatter& format) : p_(format.printer()) {}
NamespaceOpener(absl::string_view name, const Formatter& format)
: NamespaceOpener(format) {
ChangeTo(name);
}
NamespaceOpener(absl::string_view name, io::Printer* p) : NamespaceOpener(p) {
ChangeTo(name);
}
~NamespaceOpener() { ChangeTo(""); }
void ChangeTo(const std::string& name) {
std::vector<std::string> new_stack_ =
absl::StrSplit(name, "::", absl::SkipEmpty());
size_t len = std::min(name_stack_.size(), new_stack_.size());
size_t common_idx = 0;
while (common_idx < len) {
if (name_stack_[common_idx] != new_stack_[common_idx]) break;
common_idx++;
}
for (auto it = name_stack_.crbegin();
it != name_stack_.crend() - common_idx; ++it) {
if (*it == "PROTOBUF_NAMESPACE_ID") {
printer_->Print("PROTOBUF_NAMESPACE_CLOSE\n");
} else {
printer_->Print("} // namespace $ns$\n", "ns", *it);
}
}
name_stack_.swap(new_stack_);
for (size_t i = common_idx; i < name_stack_.size(); ++i) {
if (name_stack_[i] == "PROTOBUF_NAMESPACE_ID") {
printer_->Print("PROTOBUF_NAMESPACE_OPEN\n");
} else {
printer_->Print("namespace $ns$ {\n", "ns", name_stack_[i]);
}
}
}
void ChangeTo(absl::string_view name);
private:
io::Printer* printer_;
io::Printer* p_;
std::vector<std::string> name_stack_;
};

@ -630,11 +630,11 @@ void ParseFunctionGenerator::GenerateFastFieldEntries(Formatter& format) {
std::string func_name = info.func_name;
// For 1-byte tags we have a more optimized version of the varint parser
// that can hardcode the offset and has bit.
if (HasSuffixString(func_name, "V8S1") ||
HasSuffixString(func_name, "V32S1") ||
HasSuffixString(func_name, "V64S1")) {
std::string field_type = HasSuffixString(func_name, "V8S1") ? "bool"
: HasSuffixString(func_name, "V32S1")
if (absl::EndsWith(func_name, "V8S1") ||
absl::EndsWith(func_name, "V32S1") ||
absl::EndsWith(func_name, "V64S1")) {
std::string field_type = absl::EndsWith(func_name, "V8S1") ? "bool"
: absl::EndsWith(func_name, "V32S1")
? "uint32_t"
: "uint64_t";
func_name =

@ -33,9 +33,6 @@
// Sanjay Ghemawat, Jeff Dean, and others.
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/descriptor.h"

@ -33,22 +33,13 @@
#include <sstream>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
namespace google {
namespace protobuf {

@ -37,21 +37,11 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_names.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
// Must be last.
#include "google/protobuf/port_def.inc"

@ -32,17 +32,13 @@
#define GOOGLE_PROTOBUF_COMPILER_CSHARP_FIELD_BASE_H__
#include <string>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/compiler/csharp/csharp_source_generator_base.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/io/printer.h"

@ -34,16 +34,6 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_names.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/compiler/csharp/csharp_reflection_class.h"

@ -41,9 +41,7 @@
#include "absl/container/flat_hash_set.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/compiler/csharp/csharp_enum_field.h"
#include "google/protobuf/compiler/csharp/csharp_field_base.h"
@ -57,8 +55,6 @@
#include "google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h"
#include "google/protobuf/compiler/csharp/csharp_wrapper_field.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/wire_format.h"
// Must be last.
#include "google/protobuf/port_def.inc"

@ -39,11 +39,11 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/port.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/port_def.inc"
#include "google/protobuf/port.h"
namespace google {
namespace protobuf {

@ -34,20 +34,10 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
namespace google {
namespace protobuf {

@ -35,27 +35,18 @@
#include <sstream>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/compiler/csharp/csharp_enum.h"
#include "google/protobuf/compiler/csharp/csharp_field_base.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_names.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/wire_format_lite.h"
// Must be last.
#include "google/protobuf/port_def.inc"

@ -34,23 +34,11 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
namespace google {
namespace protobuf {

@ -39,8 +39,6 @@
#define GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__
#include <string>
#include "google/protobuf/port.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/port_def.inc"

@ -33,22 +33,13 @@
#include <sstream>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/csharp/csharp_doc_comment.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
namespace google {
namespace protobuf {

@ -33,25 +33,16 @@
#include <sstream>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_join.h"
#include "google/protobuf/compiler/csharp/csharp_enum.h"
#include "google/protobuf/compiler/csharp/csharp_field_base.h"
#include "google/protobuf/compiler/csharp/csharp_helpers.h"
#include "google/protobuf/compiler/csharp/csharp_message.h"
#include "google/protobuf/compiler/csharp/csharp_names.h"
#include "google/protobuf/compiler/csharp/csharp_options.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
// Must be last.
#include "google/protobuf/port_def.inc"

@ -48,7 +48,7 @@
#include <memory>
#include <vector>
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
@ -282,7 +282,7 @@ static std::string CanonicalizePath(absl::string_view path) {
// backslashes are standard. Let's avoid confusion and use only forward
// slashes.
std::string path_str;
if (HasPrefixString(path, "\\\\")) {
if (absl::StartsWith(path, "\\\\")) {
// Avoid converting two leading backslashes.
path_str = "\\\\" + absl::StrReplaceAll(path.substr(2), {{"\\", "/"}});
} else {
@ -306,8 +306,8 @@ static std::string CanonicalizePath(absl::string_view path) {
}
static inline bool ContainsParentReference(absl::string_view path) {
return path == ".." || HasPrefixString(path, "../") ||
HasSuffixString(path, "/..") || absl::StrContains(path, "/../");
return path == ".." || absl::StartsWith(path, "../") ||
absl::EndsWith(path, "/..") || absl::StrContains(path, "/../");
}
// Maps a file from an old location to a new one. Typically, old_prefix is
@ -336,7 +336,7 @@ static bool ApplyMapping(absl::string_view filename,
// We do not allow the file name to use "..".
return false;
}
if (HasPrefixString(filename, "/") || IsWindowsAbsolutePath(filename)) {
if (absl::StartsWith(filename, "/") || IsWindowsAbsolutePath(filename)) {
// This is an absolute path, so it isn't matched by the empty string.
return false;
}
@ -344,7 +344,7 @@ static bool ApplyMapping(absl::string_view filename,
if (!result->empty()) result->push_back('/');
result->append(std::string(filename));
return true;
} else if (HasPrefixString(filename, old_prefix)) {
} else if (absl::StartsWith(filename, old_prefix)) {
// old_prefix is a prefix of the filename. Is it the whole filename?
if (filename.size() == old_prefix.size()) {
// Yep, it's an exact match.

@ -221,7 +221,7 @@ std::string ToCamelCase(const std::string& input, bool lower_first) {
if (i == '_') {
capitalize_next = true;
} else if (capitalize_next) {
result.push_back(ToUpperCh(i));
result.push_back(absl::ascii_toupper(i));
capitalize_next = false;
} else {
result.push_back(i);
@ -230,20 +230,12 @@ std::string ToCamelCase(const std::string& input, bool lower_first) {
// Lower-case the first letter.
if (lower_first && !result.empty()) {
result[0] = ToLowerCh(result[0]);
result[0] = absl::ascii_tolower(result[0]);
}
return result;
}
char ToUpperCh(char ch) {
return (ch >= 'a' && ch <= 'z') ? (ch - 'a' + 'A') : ch;
}
char ToLowerCh(char ch) {
return (ch >= 'A' && ch <= 'Z') ? (ch - 'A' + 'a') : ch;
}
std::string UnderscoresToCamelCase(const FieldDescriptor* field) {
return UnderscoresToCamelCase(FieldName(field), false);
}

@ -84,9 +84,6 @@ void PrintEnumVerifierLogic(io::Printer* printer,
// first letter.
std::string ToCamelCase(const std::string& input, bool lower_first);
char ToUpperCh(char ch);
char ToLowerCh(char ch);
// Converts a name to camel-case. If cap_first_letter is true, capitalize the
// first letter.
std::string UnderscoresToCamelCase(const std::string& name,

@ -39,19 +39,18 @@
#include <memory>
#include <vector>
#include "google/protobuf/stubs/strutil.h"
#include "google/protobuf/stubs/logging.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/testing/file.h"
#include "google/protobuf/testing/file.h"
#include "google/protobuf/testing/file.h"
#include "google/protobuf/compiler/plugin.pb.h"
#include "google/protobuf/descriptor.pb.h"
#include <gtest/gtest.h>
#include "absl/strings/str_join.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"
#include "absl/strings/substitute.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/io/printer.h"
@ -208,8 +207,8 @@ bool MockCodeGenerator::Generate(const FileDescriptor* file,
std::string* error) const {
bool annotate = false;
for (int i = 0; i < file->message_type_count(); i++) {
if (HasPrefixString(file->message_type(i)->name(), "MockCodeGenerator_")) {
std::string command = StripPrefixString(
if (absl::StartsWith(file->message_type(i)->name(), "MockCodeGenerator_")) {
absl::string_view command = absl::StripPrefix(
file->message_type(i)->name(), "MockCodeGenerator_");
if (command == "Error") {
*error = "Saw message type MockCodeGenerator_Error.";
@ -252,12 +251,12 @@ bool MockCodeGenerator::Generate(const FileDescriptor* file,
}
}
bool insert_endlines = HasPrefixString(parameter, "insert_endlines=");
if (insert_endlines || HasPrefixString(parameter, "insert=")) {
bool insert_endlines = absl::StartsWith(parameter, "insert_endlines=");
if (insert_endlines || absl::StartsWith(parameter, "insert=")) {
std::vector<std::string> insert_into = absl::StrSplit(
StripPrefixString(
parameter, insert_endlines ? "insert_endlines=" : "insert="),
",", absl::SkipEmpty());
absl::StripPrefix(parameter,
insert_endlines ? "insert_endlines=" : "insert="),
',', absl::SkipEmpty());
for (size_t i = 0; i < insert_into.size(); i++) {
{
@ -265,7 +264,7 @@ bool MockCodeGenerator::Generate(const FileDescriptor* file,
std::string content =
GetOutputFileContent(name_, "first_insert", file, context);
if (insert_endlines) {
GlobalReplaceSubstring(",", ",\n", &content);
absl::StrReplaceAll({{",", ",\n"}}, &content);
}
if (annotate) {
auto* annotation = info.add_annotation();
@ -290,7 +289,7 @@ bool MockCodeGenerator::Generate(const FileDescriptor* file,
std::string content =
GetOutputFileContent(name_, "second_insert", file, context);
if (insert_endlines) {
GlobalReplaceSubstring(",", ",\n", &content);
absl::StrReplaceAll({{",", ",\n"}}, &content);
}
if (annotate) {
auto* annotation = info.add_annotation();

@ -28,18 +28,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_enum.h"
#include <algorithm>
#include <map>
#include <string>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/objectivec/objectivec_enum.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -28,17 +28,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_extension.h"
#include <iostream>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/objectivec/objectivec_extension.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -28,20 +28,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_field.h"
#include <iostream>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_enum_field.h"
#include "google/protobuf/compiler/objectivec/objectivec_field.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_map_field.h"
#include "google/protobuf/compiler/objectivec/objectivec_message_field.h"
#include "google/protobuf/compiler/objectivec/objectivec_primitive_field.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -28,24 +28,19 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_file.h"
#include <algorithm>
#include <iostream>
#include <sstream>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/code_generator.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_enum.h"
#include "google/protobuf/compiler/objectivec/objectivec_extension.h"
#include "google/protobuf/compiler/objectivec/objectivec_file.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_message.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream_impl.h"
#include "google/protobuf/stubs/stl_util.h"
#include "google/protobuf/stubs/strutil.h"
// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some
// error cases, so it seems to be ok to use as a back door for errors.

@ -28,21 +28,20 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_generator.h"
#include <fstream>
#include <iostream>
#include <string>
#include <unordered_set>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
#include "google/protobuf/compiler/objectivec/objectivec_file.h"
#include "google/protobuf/compiler/objectivec/objectivec_generator.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {
@ -104,7 +103,7 @@ bool ObjectiveCGenerator::GenerateAll(
std::vector<std::pair<std::string, std::string> > options;
ParseGeneratorParameter(parameter, &options);
for (int i = 0; i < options.size(); i++) {
for (size_t i = 0; i < options.size(); i++) {
if (options[i].first == "expected_prefixes_path") {
// Path to find a file containing the expected prefixes
// (objc_class_prefix "PREFIX") for proto packages (package NAME). The
@ -194,7 +193,8 @@ bool ObjectiveCGenerator::GenerateAll(
// generated files. When integrating ObjC protos into a build system,
// this can be used to avoid having to add the runtime directory to the
// header search path since the generate #import will be more complete.
generation_options.runtime_import_prefix = StripSuffixString(options[i].second, "/");
generation_options.runtime_import_prefix =
std::string(absl::StripSuffix(options[i].second, "/"));
} else if (options[i].first == "package_to_prefix_mappings_path") {
// Path to use for when loading the objc class prefix mappings to use.
// The `objc_class_prefix` file option is always honored first if one is present.

@ -31,21 +31,24 @@
#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <climits>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <climits>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <unordered_set>
#include <vector>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/code_generator.h"
#include "absl/strings/strip.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h"
#include "google/protobuf/descriptor.pb.h"
@ -55,7 +58,6 @@
#include "google/protobuf/io/zero_copy_stream_impl.h"
#include "google/protobuf/port.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/stubs/strutil.h"
// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some
// error cases, so it seems to be ok to use as a back door for errors.
@ -466,7 +468,7 @@ std::string SanitizeNameForObjC(const std::string& prefix,
// a) Doesn't start with the prefix or
// b) Isn't equivalent to the prefix or
// c) Has the prefix, but the letter after the prefix is lowercase
if (HasPrefixString(input, prefix)) {
if (absl::StartsWith(input, prefix)) {
if (input.length() == prefix.length() || !absl::ascii_isupper(input[prefix.length()])) {
sanitized = prefix + input;
} else {
@ -797,7 +799,7 @@ std::string EnumValueShortName(const EnumValueDescriptor* descriptor) {
const std::string class_name = EnumName(descriptor->type());
const std::string long_name_prefix = class_name + "_";
const std::string long_name = EnumValueName(descriptor);
return StripPrefixString(long_name, long_name_prefix);
return std::string(absl::StripPrefix(long_name, long_name_prefix));
}
std::string UnCamelCaseEnumShortName(const std::string& name) {
@ -826,7 +828,7 @@ std::string FieldName(const FieldDescriptor* field) {
result += "Array";
} else {
// If it wasn't repeated, but ends in "Array", force on the _p suffix.
if (HasSuffixString(result, "Array")) {
if (absl::EndsWith(result, "Array")) {
result += "_p";
}
}
@ -876,20 +878,22 @@ std::string ObjCClassDeclaration(const std::string& class_name) {
}
std::string UnCamelCaseFieldName(const std::string& name, const FieldDescriptor* field) {
std::string worker(name);
if (HasSuffixString(worker, "_p")) {
worker = StripSuffixString(worker, "_p");
absl::string_view worker(name);
if (absl::EndsWith(worker, "_p")) {
worker = absl::StripSuffix(worker, "_p");
}
if (field->is_repeated() && HasSuffixString(worker, "Array")) {
worker = StripSuffixString(worker, "Array");
if (field->is_repeated() && absl::EndsWith(worker, "Array")) {
worker = absl::StripSuffix(worker, "Array");
}
if (field->type() == FieldDescriptor::TYPE_GROUP) {
if (worker.length() > 0) {
if (absl::ascii_islower(worker[0])) {
worker[0] = absl::ascii_toupper(worker[0]);
std::string copy(worker);
copy[0] = absl::ascii_toupper(worker[0]);
return copy;
}
}
return worker;
return std::string(worker);
} else {
std::string result;
for (int i = 0; i < worker.size(); i++) {
@ -1252,7 +1256,7 @@ std::string BuildCommentsString(const SourceLocation& location,
for (size_t i = 0; i < lines.size(); i++) {
std::string line = absl::StrReplaceAll(
StripPrefixString(lines[i], " "),
absl::StripPrefix(lines[i], " "),
{// HeaderDoc and appledoc use '\' and '@' for markers; escape them.
{"\\", "\\\\"},
{"@", "\\@"},
@ -1260,9 +1264,9 @@ std::string BuildCommentsString(const SourceLocation& location,
{"/*", "/\\*"},
{"*/", "*\\/"}});
line = prefix + line;
StripWhitespace(&line);
absl::StripAsciiWhitespace(&line);
// If not a one line, need to add the first space before *, as
// StripWhitespace would have removed it.
// absl::StripAsciiWhitespace would have removed it.
line = (add_leading_space ? " " : "") + line;
final_comments += line + suffix;
}
@ -1425,7 +1429,7 @@ bool ValidateObjCClassPrefix(
other_package_for_prefix = i->first;
// Stop on the first real package listing, if it was a no_package file
// specific entry, keep looking to try and find a package one.
if (!HasPrefixString(other_package_for_prefix, no_package_prefix)) {
if (!absl::StartsWith(other_package_for_prefix, no_package_prefix)) {
break;
}
}
@ -1438,16 +1442,19 @@ bool ValidateObjCClassPrefix(
*out_error =
"error: Found 'option objc_class_prefix = \"" + prefix +
"\";' in '" + file->name() + "'; that prefix is already used for ";
if (HasPrefixString(other_package_for_prefix, no_package_prefix)) {
*out_error += "file '" +
StripPrefixString(other_package_for_prefix, no_package_prefix) +
"'.";
if (absl::StartsWith(other_package_for_prefix, no_package_prefix)) {
absl::StrAppend(
out_error, "file '",
absl::StripPrefix(other_package_for_prefix, no_package_prefix),
"'.");
} else {
*out_error += "'package " + other_package_for_prefix + ";'.";
absl::StrAppend(out_error, "'package ",
other_package_for_prefix + ";'.");
}
*out_error +=
" It can only be reused by adding '" + lookup_key + " = " + prefix +
"' to the expected prefixes file (" + expected_prefixes_path + ").";
absl::StrAppend(out_error, " It can only be reused by adding '",
lookup_key, " = ", prefix,
"' to the expected prefixes file (",
expected_prefixes_path, ").");
return false; // Only report first usage of the prefix.
}
} // !prefix.empty() && have_expected_prefix_file

@ -28,24 +28,19 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_message.h"
#include <algorithm>
#include <iostream>
#include <sstream>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_enum.h"
#include "google/protobuf/compiler/objectivec/objectivec_extension.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_message.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream_impl.h"
#include "google/protobuf/stubs/stl_util.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -28,17 +28,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_oneof.h"
#include <map>
#include <string>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_oneof.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -28,17 +28,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/compiler/objectivec/objectivec_primitive_field.h"
#include <map>
#include <string>
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/compiler/objectivec/objectivec_helpers.h"
#include "google/protobuf/compiler/objectivec/objectivec_primitive_field.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/stubs/strutil.h"
namespace google {
namespace protobuf {

@ -33,13 +33,12 @@
#include <sstream>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/compiler/plugin.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream.h"
@ -153,8 +152,7 @@ std::string ReservedNamePrefix(const std::string& classname,
template <typename DescriptorType>
std::string DescriptorFullName(const DescriptorType* desc, bool is_internal) {
if (is_internal) {
return StringReplace(desc->full_name(),
"google.protobuf",
return StringReplace(desc->full_name(), "google.protobuf",
"google.protobuf.internal", false);
} else {
return desc->full_name();
@ -1110,7 +1108,7 @@ static bool NeedsUnwrapping(const FileDescriptor* file,
has_aggregate_metadata_prefix = true;
} else {
for (const auto& prefix : options.aggregate_metadata_prefixes) {
if (HasPrefixString(file->package(), prefix)) {
if (absl::StartsWith(file->package(), prefix)) {
has_aggregate_metadata_prefix = true;
break;
}
@ -2392,7 +2390,7 @@ bool Generator::GenerateAll(const std::vector<const FileDescriptor*>& files,
for (const auto& option : absl::StrSplit(parameter, ",", absl::SkipEmpty())) {
const std::vector<std::string> option_pair = absl::StrSplit(option, "=", absl::SkipEmpty());
if (HasPrefixString(option_pair[0], "aggregate_metadata")) {
if (absl::StartsWith(option_pair[0], "aggregate_metadata")) {
options.aggregate_metadata = true;
for (const auto& prefix : absl::StrSplit(option_pair[1], "#", absl::AllowEmpty())) {
options.aggregate_metadata_prefixes.emplace(prefix);

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/compiler/plugin.proto
#include <google/protobuf/compiler/plugin.pb.h>
#include "google/protobuf/compiler/plugin.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,13 +12,12 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
namespace compiler {
PROTOBUF_CONSTEXPR Version::Version(
@ -31,14 +29,15 @@ PROTOBUF_CONSTEXPR Version::Version(
, /*decltype(_impl_.minor_)*/0
, /*decltype(_impl_.patch_)*/0} {}
struct VersionDefaultTypeInternal {
PROTOBUF_CONSTEXPR VersionDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR VersionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~VersionDefaultTypeInternal() {}
union {
Version _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VersionDefaultTypeInternal _Version_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VersionDefaultTypeInternal _Version_default_instance_;
PROTOBUF_CONSTEXPR CodeGeneratorRequest::CodeGeneratorRequest(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
@ -48,14 +47,15 @@ PROTOBUF_CONSTEXPR CodeGeneratorRequest::CodeGeneratorRequest(
, /*decltype(_impl_.parameter_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.compiler_version_)*/nullptr} {}
struct CodeGeneratorRequestDefaultTypeInternal {
PROTOBUF_CONSTEXPR CodeGeneratorRequestDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR CodeGeneratorRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~CodeGeneratorRequestDefaultTypeInternal() {}
union {
CodeGeneratorRequest _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_;
PROTOBUF_CONSTEXPR CodeGeneratorResponse_File::CodeGeneratorResponse_File(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
@ -65,14 +65,15 @@ PROTOBUF_CONSTEXPR CodeGeneratorResponse_File::CodeGeneratorResponse_File(
, /*decltype(_impl_.content_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.generated_code_info_)*/nullptr} {}
struct CodeGeneratorResponse_FileDefaultTypeInternal {
PROTOBUF_CONSTEXPR CodeGeneratorResponse_FileDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR CodeGeneratorResponse_FileDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~CodeGeneratorResponse_FileDefaultTypeInternal() {}
union {
CodeGeneratorResponse_File _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_;
PROTOBUF_CONSTEXPR CodeGeneratorResponse::CodeGeneratorResponse(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
@ -81,138 +82,163 @@ PROTOBUF_CONSTEXPR CodeGeneratorResponse::CodeGeneratorResponse(
, /*decltype(_impl_.error_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.supported_features_)*/uint64_t{0u}} {}
struct CodeGeneratorResponseDefaultTypeInternal {
PROTOBUF_CONSTEXPR CodeGeneratorResponseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR CodeGeneratorResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~CodeGeneratorResponseDefaultTypeInternal() {}
union {
CodeGeneratorResponse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_;
} // namespace compiler
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[4];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.major_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.minor_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.patch_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.suffix_),
1,
2,
3,
0,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.file_to_generate_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.parameter_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.proto_file_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.compiler_version_),
~0u,
0,
~0u,
1,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.insertion_point_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.content_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.generated_code_info_),
0,
1,
2,
3,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.error_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.supported_features_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.file_),
0,
1,
~0u,
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.major_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.minor_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.patch_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _impl_.suffix_),
1,
2,
3,
0,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.file_to_generate_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.parameter_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.proto_file_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _impl_.compiler_version_),
~0u,
0,
~0u,
1,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.insertion_point_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.content_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _impl_.generated_code_info_),
0,
1,
2,
3,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.error_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.supported_features_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _impl_.file_),
0,
1,
~0u,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 12, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::Version)},
{ 16, 28, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest)},
{ 32, 44, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File)},
{ 48, 59, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 12, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::Version)},
{ 16, 28, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest)},
{ 32, 44, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File)},
{ 48, 59, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_File_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_File_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n%google/protobuf/compiler/plugin.proto\022"
"\030google.protobuf.compiler\032 google/protob"
"uf/descriptor.proto\"F\n\007Version\022\r\n\005major\030"
"\001 \001(\005\022\r\n\005minor\030\002 \001(\005\022\r\n\005patch\030\003 \001(\005\022\016\n\006s"
"uffix\030\004 \001(\t\"\272\001\n\024CodeGeneratorRequest\022\030\n\020"
"file_to_generate\030\001 \003(\t\022\021\n\tparameter\030\002 \001("
"\t\0228\n\nproto_file\030\017 \003(\0132$.google.protobuf."
"FileDescriptorProto\022;\n\020compiler_version\030"
"\003 \001(\0132!.google.protobuf.compiler.Version"
"\"\301\002\n\025CodeGeneratorResponse\022\r\n\005error\030\001 \001("
"\t\022\032\n\022supported_features\030\002 \001(\004\022B\n\004file\030\017 "
"\003(\01324.google.protobuf.compiler.CodeGener"
"atorResponse.File\032\177\n\004File\022\014\n\004name\030\001 \001(\t\022"
"\027\n\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001("
"\t\022\?\n\023generated_code_info\030\020 \001(\0132\".google."
"protobuf.GeneratedCodeInfo\"8\n\007Feature\022\020\n"
"\014FEATURE_NONE\020\000\022\033\n\027FEATURE_PROTO3_OPTION"
"AL\020\001BW\n\034com.google.protobuf.compilerB\014Pl"
"uginProtosZ)google.golang.org/protobuf/t"
"ypes/pluginpb"
;
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps[1] = {
&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto,
const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n%google/protobuf/compiler/plugin.proto\022"
"\030google.protobuf.compiler\032 google/protob"
"uf/descriptor.proto\"F\n\007Version\022\r\n\005major\030"
"\001 \001(\005\022\r\n\005minor\030\002 \001(\005\022\r\n\005patch\030\003 \001(\005\022\016\n\006s"
"uffix\030\004 \001(\t\"\272\001\n\024CodeGeneratorRequest\022\030\n\020"
"file_to_generate\030\001 \003(\t\022\021\n\tparameter\030\002 \001("
"\t\0228\n\nproto_file\030\017 \003(\0132$.google.protobuf."
"FileDescriptorProto\022;\n\020compiler_version\030"
"\003 \001(\0132!.google.protobuf.compiler.Version"
"\"\301\002\n\025CodeGeneratorResponse\022\r\n\005error\030\001 \001("
"\t\022\032\n\022supported_features\030\002 \001(\004\022B\n\004file\030\017 "
"\003(\01324.google.protobuf.compiler.CodeGener"
"atorResponse.File\032\177\n\004File\022\014\n\004name\030\001 \001(\t\022"
"\027\n\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001("
"\t\022\?\n\023generated_code_info\030\020 \001(\0132\".google."
"protobuf.GeneratedCodeInfo\"8\n\007Feature\022\020\n"
"\014FEATURE_NONE\020\000\022\033\n\027FEATURE_PROTO3_OPTION"
"AL\020\001BW\n\034com.google.protobuf.compilerB\014Pl"
"uginProtosZ)google.golang.org/protobuf/t"
"ypes/pluginpb"
};
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps[1] =
{
&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto,
};
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto = {
false, false, 773, descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
false,
false,
773,
descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
"google/protobuf/compiler/plugin.proto",
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps, 1, 4,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once,
descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps,
1,
4,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fcompiler_2fplugin_2eproto(&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fcompiler_2fplugin_2eproto(&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto);
PROTOBUF_NAMESPACE_OPEN
namespace compiler {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CodeGeneratorResponse_Feature_descriptor() {
@ -236,7 +262,6 @@ constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::Feature_MIN;
constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::Feature_MAX;
constexpr int CodeGeneratorResponse::Feature_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================
class Version::_Internal {
@ -562,7 +587,6 @@ void Version::InternalSwap(Version* other) {
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[0]);
}
// ===================================================================
class CodeGeneratorRequest::_Internal {
@ -916,7 +940,6 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) {
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[1]);
}
// ===================================================================
class CodeGeneratorResponse_File::_Internal {
@ -1308,7 +1331,6 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other)
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[2]);
}
// ===================================================================
class CodeGeneratorResponse::_Internal {
@ -1601,7 +1623,6 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) {
&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once,
file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[3]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace compiler
PROTOBUF_NAMESPACE_CLOSE
@ -1623,6 +1644,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRespo
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,16 +32,20 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
#include <google/protobuf/descriptor.pb.h>
#include "google/protobuf/descriptor.pb.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fcompiler_2fplugin_2eproto PROTOC_EXPORT
#ifdef major
#undef major
#endif
#endif // major
#ifdef minor
#undef minor
#endif
#endif // minor
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -51,7 +56,8 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOC_EXPORT TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto {
static const uint32_t offsets[];
};
PROTOC_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
PROTOC_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
PROTOBUF_NAMESPACE_OPEN
namespace compiler {
class CodeGeneratorRequest;
@ -67,16 +73,18 @@ class Version;
struct VersionDefaultTypeInternal;
PROTOC_EXPORT extern VersionDefaultTypeInternal _Version_default_instance_;
} // namespace compiler
template <>
PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest>(Arena*);
template <>
PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse>(Arena*);
template <>
PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File>(Arena*);
template <>
PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest>(Arena*);
template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse>(Arena*);
template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File>(Arena*);
template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
namespace compiler {
enum CodeGeneratorResponse_Feature : int {
CodeGeneratorResponse_Feature_FEATURE_NONE = 0,
CodeGeneratorResponse_Feature_FEATURE_PROTO3_OPTIONAL = 1
@ -104,8 +112,12 @@ inline bool CodeGeneratorResponse_Feature_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<CodeGeneratorResponse_Feature>(
CodeGeneratorResponse_Feature_descriptor(), name, value);
}
// ===================================================================
// -------------------------------------------------------------------
class PROTOC_EXPORT Version final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ {
public:
@ -313,8 +325,7 @@ class PROTOC_EXPORT Version final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorRequest final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ {
@ -544,8 +555,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorResponse_File final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ {
@ -769,8 +779,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorResponse final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ {
@ -1005,12 +1014,17 @@ class PROTOC_EXPORT CodeGeneratorResponse final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Version
// optional int32 major = 1;
@ -1861,20 +1875,14 @@ CodeGeneratorResponse::file() const {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace compiler
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature> : ::std::true_type {};
@ -1888,4 +1896,5 @@ PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh

@ -59,6 +59,8 @@
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/stubs/stringprintf.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/strip.h"
#include "absl/strings/substitute.h"
#include "google/protobuf/compiler/python/helpers.h"
#include "google/protobuf/compiler/python/pyi_generator.h"
@ -82,8 +84,8 @@ std::string ModuleAlias(const std::string& filename) {
// We can't have dots in the module name, so we replace each with _dot_.
// But that could lead to a collision between a.b and a_dot_b, so we also
// duplicate each underscore.
GlobalReplaceSubstring("_", "__", &module_name);
GlobalReplaceSubstring(".", "_dot_", &module_name);
absl::StrReplaceAll({{"_", "__"}}, &module_name);
absl::StrReplaceAll({{".", "_dot_"}}, &module_name);
return module_name;
}
@ -315,7 +317,8 @@ bool Generator::Generate(const FileDescriptor* file,
}
std::string module_name = ModuleName(file->name());
if (!opensource_runtime_) {
module_name = StripPrefixString(module_name, kThirdPartyPrefix);
module_name =
std::string(absl::StripPrefix(module_name, kThirdPartyPrefix));
}
printer_->Print(
"_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, '$module_name$', "
@ -386,7 +389,8 @@ void Generator::PrintImports() const {
std::string module_name = ModuleName(filename);
std::string module_alias = ModuleAlias(filename);
if (!opensource_runtime_) {
module_name = StripPrefixString(module_name, kThirdPartyPrefix);
module_name =
std::string(absl::StripPrefix(module_name, kThirdPartyPrefix));
}
if (ContainsPythonKeyword(module_name)) {
// If the module path contains a Python keyword, we have to quote the
@ -419,7 +423,8 @@ void Generator::PrintImports() const {
for (int i = 0; i < file_->public_dependency_count(); ++i) {
std::string module_name = ModuleName(file_->public_dependency(i)->name());
if (!opensource_runtime_) {
module_name = StripPrefixString(module_name, kThirdPartyPrefix);
module_name =
std::string(absl::StripPrefix(module_name, kThirdPartyPrefix));
}
printer_->Print("from $module$ import *\n", "module", module_name);
}
@ -592,7 +597,8 @@ void Generator::PrintDescriptorKeyAndModuleName(
kDescriptorKey, "descriptor_name", name);
std::string module_name = ModuleName(file_->name());
if (!opensource_runtime_) {
module_name = StripPrefixString(module_name, kThirdPartyPrefix);
module_name =
std::string(absl::StripPrefix(module_name, kThirdPartyPrefix));
}
printer_->Print("__module__ = '$module_name$'\n", "module_name", module_name);
}
@ -784,7 +790,8 @@ void Generator::PrintMessage(const Descriptor& message_descriptor,
printer_->Print(m, "'$descriptor_key$' : $descriptor_name$,\n");
std::string module_name = ModuleName(file_->name());
if (!opensource_runtime_) {
module_name = StripPrefixString(module_name, kThirdPartyPrefix);
module_name =
std::string(absl::StripPrefix(module_name, kThirdPartyPrefix));
}
printer_->Print("'__module__' : '$module_name$'\n", "module_name",
module_name);

@ -32,9 +32,11 @@
#include <algorithm>
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
@ -47,8 +49,7 @@ namespace python {
// Returns the Python module name expected for a given .proto filename.
std::string ModuleName(const std::string& filename) {
std::string basename = StripProto(filename);
ReplaceCharacters(&basename, "-", '_');
ReplaceCharacters(&basename, "/", '.');
absl::StrReplaceAll({{"-", "_"}, {"/", "."}}, &basename);
return basename + "_pb2";
}
@ -94,7 +95,7 @@ std::string GetFileName(const FileDescriptor* file_des,
const std::string& suffix) {
std::string module_name = ModuleName(file_des->name());
std::string filename = module_name;
ReplaceCharacters(&filename, ".", '/');
absl::StrReplaceAll({{".", "/"}}, &filename);
filename += suffix;
return filename;
}

@ -42,7 +42,6 @@ namespace protobuf {
namespace compiler {
namespace python {
std::string ModuleName(const std::string& filename);
std::string StrippedModuleName(const std::string& filename);
bool ContainsPythonKeyword(const std::string& module_name);

@ -34,7 +34,7 @@
#include <utility>
#include "absl/strings/ascii.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_split.h"
#include "google/protobuf/compiler/python/helpers.h"
#include "google/protobuf/descriptor.h"
@ -577,7 +577,7 @@ bool PyiGenerator::Generate(const FileDescriptor* file,
for (const std::pair<std::string, std::string>& option : options) {
if (option.first == "annotate_code") {
annotate_code = true;
} else if (HasSuffixString(option.first, ".pyi")) {
} else if (absl::EndsWith(option.first, ".pyi")) {
filename = option.first;
} else {
*error = "Unknown generator option: " + option.first;

@ -2506,12 +2506,7 @@ std::string FieldDescriptor::DefaultValueAsString(
// CopyTo methods ====================================================
void FileDescriptor::CopyTo(FileDescriptorProto* proto) const {
proto->set_name(name());
if (!package().empty()) proto->set_package(package());
// TODO(liujisi): Also populate when syntax="proto2".
if (syntax() == SYNTAX_PROTO3
) proto->set_syntax(SyntaxName(syntax()));
CopyHeadingTo(proto);
for (int i = 0; i < dependency_count(); i++) {
proto->add_dependency(dependency(i)->name());
@ -2543,6 +2538,19 @@ void FileDescriptor::CopyTo(FileDescriptorProto* proto) const {
}
}
void FileDescriptor::CopyHeadingTo(FileDescriptorProto* proto) const {
proto->set_name(name());
if (!package().empty()) {
proto->set_package(package());
}
// TODO(liujisi): Also populate when syntax="proto2".
if (syntax() == SYNTAX_PROTO3
) {
proto->set_syntax(SyntaxName(syntax()));
}
}
void FileDescriptor::CopyJsonNameTo(FileDescriptorProto* proto) const {
if (message_type_count() != proto->message_type_size() ||
extension_count() != proto->extension_size()) {
@ -2901,7 +2909,7 @@ class SourceLocationCommentPrinter {
// the DebugString() output.
std::string FormatComment(const std::string& comment_text) {
std::string stripped_comment = comment_text;
StripWhitespace(&stripped_comment);
absl::StripAsciiWhitespace(&stripped_comment);
std::vector<std::string> lines = absl::StrSplit(stripped_comment, "\n");
std::string output;
for (const std::string& line : lines) {
@ -4206,7 +4214,7 @@ void DescriptorBuilder::AddWarning(
bool DescriptorBuilder::IsInPackage(const FileDescriptor* file,
const std::string& package_name) {
return HasPrefixString(file->package(), package_name) &&
return absl::StartsWith(file->package(), package_name) &&
(file->package().size() == package_name.size() ||
file->package()[package_name.size()] == '.');
}

@ -761,6 +761,10 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase {
// Reflection::HasField() is semantically meaningful.
bool has_presence() const;
// Returns true if this TYPE_STRING-typed field requires UTF-8 validation on
// parse.
bool requires_utf8_validation() const;
// Index of this field within the message's field array, or the file or
// extension scope's extensions array.
int index() const;
@ -1143,6 +1147,13 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase {
// with AllowUnknownDependencies() set.
bool is_placeholder() const;
// Returns true whether this is a "closed" enum, meaning that it:
// - Has a fixed set of named values.
// - Encountering values not in this set causes them to be treated as unknown
// fields.
// - The first value (i.e., the default) may be nonzero.
bool is_closed() const;
// Reserved fields -------------------------------------------------
// A range of reserved field numbers.
@ -1650,6 +1661,9 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase {
// Fill the json_name field of FieldDescriptorProto for all fields. Can only
// be called after CopyTo().
void CopyJsonNameTo(FileDescriptorProto* proto) const;
// Fills in the file-level settings of this file (e.g. syntax, package,
// file options) to `proto`.
void CopyHeadingTo(FileDescriptorProto* proto) const;
// See Descriptor::DebugString().
std::string DebugString() const;
@ -2200,6 +2214,10 @@ PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, reserved_range,
const EnumDescriptor::ReservedRange*)
PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_name_count, int)
inline bool EnumDescriptor::is_closed() const {
return file()->syntax() != FileDescriptor::SYNTAX_PROTO3;
}
PROTOBUF_DEFINE_NAME_ACCESSOR(EnumValueDescriptor)
PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, number, int)
PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, type, const EnumDescriptor*)
@ -2364,6 +2382,11 @@ inline bool FieldDescriptor::has_presence() const {
file()->syntax() == FileDescriptor::SYNTAX_PROTO2;
}
inline bool FieldDescriptor::requires_utf8_validation() const {
return type() == TYPE_STRING &&
file()->syntax() == FileDescriptor::SYNTAX_PROTO3;
}
// To save space, index() is computed by looking at the descriptor's position
// in the parent's array of children.
inline int FieldDescriptor::index() const {

File diff suppressed because it is too large Load Diff

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -32,8 +33,12 @@
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fdescriptor_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -44,7 +49,8 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fdescriptor_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fdescriptor_2eproto;
PROTOBUF_NAMESPACE_OPEN
class DescriptorProto;
struct DescriptorProtoDefaultTypeInternal;
@ -127,38 +133,63 @@ PROTOBUF_EXPORT extern UninterpretedOptionDefaultTypeInternal _UninterpretedOpti
class UninterpretedOption_NamePart;
struct UninterpretedOption_NamePartDefaultTypeInternal;
PROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorSet>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MessageOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MessageOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceOptions>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorSet>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MessageOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MessageOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceOptions>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_NAMESPACE_OPEN
enum FieldDescriptorProto_Type : int {
FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
FieldDescriptorProto_Type_TYPE_FLOAT = 2,
@ -370,8 +401,12 @@ inline bool GeneratedCodeInfo_Annotation_Semantic_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<GeneratedCodeInfo_Annotation_Semantic>(
GeneratedCodeInfo_Annotation_Semantic_descriptor(), name, value);
}
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT FileDescriptorSet final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {
public:
@ -533,8 +568,7 @@ class PROTOBUF_EXPORT FileDescriptorSet final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT FileDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {
@ -952,8 +986,7 @@ class PROTOBUF_EXPORT FileDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {
@ -1147,8 +1180,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT DescriptorProto_ReservedRange final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {
@ -1322,8 +1354,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT DescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {
@ -1676,8 +1707,7 @@ class PROTOBUF_EXPORT DescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT ExtensionRangeOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {
@ -2032,8 +2062,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT FieldDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {
@ -2466,8 +2495,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT OneofDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {
@ -2651,8 +2679,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {
@ -2826,8 +2853,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {
@ -3079,8 +3105,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumValueDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {
@ -3279,8 +3304,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT ServiceDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {
@ -3484,8 +3508,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT MethodDescriptorProto final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {
@ -3739,8 +3762,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT FileOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {
@ -4478,8 +4500,7 @@ class PROTOBUF_EXPORT FileOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT MessageOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {
@ -4895,8 +4916,7 @@ class PROTOBUF_EXPORT MessageOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT FieldOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {
@ -5421,8 +5441,7 @@ class PROTOBUF_EXPORT FieldOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT OneofOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {
@ -5777,8 +5796,7 @@ class PROTOBUF_EXPORT OneofOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {
@ -6164,8 +6182,7 @@ class PROTOBUF_EXPORT EnumOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumValueOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {
@ -6536,8 +6553,7 @@ class PROTOBUF_EXPORT EnumValueOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT ServiceOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {
@ -6908,8 +6924,7 @@ class PROTOBUF_EXPORT ServiceOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT MethodOptions final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {
@ -7327,8 +7342,7 @@ class PROTOBUF_EXPORT MethodOptions final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT UninterpretedOption_NamePart final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {
@ -7510,8 +7524,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT UninterpretedOption final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {
@ -7782,8 +7795,7 @@ class PROTOBUF_EXPORT UninterpretedOption final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT SourceCodeInfo_Location final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {
@ -8043,8 +8055,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT SourceCodeInfo final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {
@ -8209,8 +8220,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {
@ -8476,8 +8486,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT GeneratedCodeInfo final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {
@ -8646,12 +8655,17 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// FileDescriptorSet
// repeated .google.protobuf.FileDescriptorProto file = 1;
@ -14861,65 +14875,13 @@ GeneratedCodeInfo::annotation() const {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type> : ::std::true_type {};
@ -14963,4 +14925,5 @@ PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh

@ -39,7 +39,7 @@
#include <utility>
#include "absl/strings/ascii.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_replace.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/stubs/stl_util.h"
@ -190,7 +190,7 @@ typename Container::const_iterator FindLastLessOrEqual(
// "foo.bar.baz", but not a parent of "foo.barbaz").
bool IsSubSymbol(absl::string_view sub_symbol, absl::string_view super_symbol) {
return sub_symbol == super_symbol ||
(HasPrefixString(super_symbol, sub_symbol) &&
(absl::StartsWith(super_symbol, sub_symbol) &&
super_symbol[sub_symbol.size()] == '.');
}

@ -43,6 +43,7 @@
#include "google/protobuf/compiler/parser.h"
#include "google/protobuf/unittest.pb.h"
#include "google/protobuf/unittest_custom_options.pb.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/stubs/logging.h"
#include "google/protobuf/stubs/stringprintf.h"
@ -553,6 +554,27 @@ TEST_F(FileDescriptorTest, Syntax) {
}
}
TEST_F(FileDescriptorTest, CopyHeadingTo) {
FileDescriptorProto proto;
proto.set_name("foo.proto");
proto.set_package("foo.bar.baz");
proto.set_syntax("proto3");
// Won't be copied.
proto.add_message_type()->set_name("Foo");
DescriptorPool pool;
const FileDescriptor* file = pool.BuildFile(proto);
ASSERT_NE(file, nullptr);
FileDescriptorProto other;
file->CopyHeadingTo(&other);
EXPECT_EQ(other.name(), "foo.proto");
EXPECT_EQ(other.package(), "foo.bar.baz");
EXPECT_EQ(other.syntax(), "proto3");
EXPECT_TRUE(other.message_type().empty());
}
void ExtractDebugString(
const FileDescriptor* file, std::set<std::string>* visited,
std::vector<std::pair<std::string, std::string>>* debug_strings) {
@ -1063,6 +1085,34 @@ TEST_F(DescriptorTest, FieldLabel) {
EXPECT_TRUE(baz_->is_repeated());
}
TEST_F(DescriptorTest, NeedsUtf8Check) {
EXPECT_FALSE(foo_->requires_utf8_validation());
EXPECT_FALSE(bar_->requires_utf8_validation());
// Build a copy of the file in proto3.
FileDescriptorProto foo_file3;
foo_file_->CopyTo(&foo_file3);
foo_file3.set_syntax("proto3");
// Make this valid proto3 by removing `required` and the one group field.
for (auto& f : *foo_file3.mutable_message_type(1)->mutable_field()) {
f.clear_label();
if (f.type() == FieldDescriptorProto::TYPE_GROUP) {
f.set_type(FieldDescriptorProto::TYPE_MESSAGE);
}
}
// Make this valid proto3 by making the first enum value be zero.
foo_file3.mutable_enum_type(0)->mutable_value(0)->set_number(0);
DescriptorPool pool3;
const Descriptor* message3 = pool3.BuildFile(foo_file3)->message_type(1);
const FieldDescriptor* foo3 = message3->field(0);
const FieldDescriptor* bar3 = message3->field(1);
EXPECT_TRUE(foo3->requires_utf8_validation());
EXPECT_FALSE(bar3->requires_utf8_validation());
}
TEST_F(DescriptorTest, IsMap) {
EXPECT_TRUE(map_->is_map());
EXPECT_FALSE(baz_->is_map());
@ -1535,6 +1585,23 @@ TEST_F(EnumDescriptorTest, ValueType) {
EXPECT_EQ(enum2_, baz2_->type());
}
TEST_F(EnumDescriptorTest, IsClosed) {
// enum_ is proto2.
EXPECT_TRUE(enum_->is_closed());
// Make a proto3 version of enum_.
FileDescriptorProto foo_file3;
foo_file_->CopyTo(&foo_file3);
foo_file3.set_syntax("proto3");
// Make this valid proto3 by making the first enum value be zero.
foo_file3.mutable_enum_type(0)->mutable_value(0)->set_number(0);
DescriptorPool pool3;
const EnumDescriptor* enum3 = pool3.BuildFile(foo_file3)->enum_type(0);
EXPECT_FALSE(enum3->is_closed());
}
// ===================================================================
// Test service descriptors.

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto
#include <google/protobuf/duration.pb.h>
#include "google/protobuf/duration.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,13 +12,12 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Duration::Duration(
::_pbi::ConstantInitialized): _impl_{
@ -27,64 +25,88 @@ PROTOBUF_CONSTEXPR Duration::Duration(
, /*decltype(_impl_.nanos_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct DurationDefaultTypeInternal {
PROTOBUF_CONSTEXPR DurationDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR DurationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~DurationDefaultTypeInternal() {}
union {
Duration _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DurationDefaultTypeInternal _Duration_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DurationDefaultTypeInternal _Duration_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fduration_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.seconds_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.nanos_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.seconds_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.nanos_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Duration)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Duration)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Duration_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Duration_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\036google/protobuf/duration.proto\022\017google"
".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
"\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
"urationProtoP\001Z1google.golang.org/protob"
"uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
"gle.Protobuf.WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\036google/protobuf/duration.proto\022\017google"
".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
"\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
"urationProtoP\001Z1google.golang.org/protob"
"uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
"gle.Protobuf.WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = {
false, false, 235, descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto,
false,
false,
235,
descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto,
"google/protobuf/duration.proto",
&descriptor_table_google_2fprotobuf_2fduration_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fduration_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto,
&descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fduration_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fduration_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fduration_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto(&descriptor_table_google_2fprotobuf_2fduration_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto(&descriptor_table_google_2fprotobuf_2fduration_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class Duration::_Internal {
@ -295,7 +317,6 @@ void Duration::InternalSwap(Duration* other) {
&descriptor_table_google_2fprotobuf_2fduration_2eproto_getter, &descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
file_level_metadata_google_2fprotobuf_2fduration_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -304,6 +325,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Duration >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Duration >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,8 +32,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fduration_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -43,19 +48,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fduration_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fduration_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Duration;
struct DurationDefaultTypeInternal;
PROTOBUF_EXPORT extern DurationDefaultTypeInternal _Duration_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Duration* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Duration>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Duration* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Duration>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Duration final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {
public:
@ -216,12 +225,17 @@ class PROTOBUF_EXPORT Duration final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Duration
// int64 seconds = 1;
@ -265,14 +279,15 @@ inline void Duration::set_nanos(int32_t value) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fduration_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fduration_2eproto_2epb_2eh

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto
#include <google/protobuf/empty.pb.h>
#include "google/protobuf/empty.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,72 +12,95 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Empty::Empty(
::_pbi::ConstantInitialized) {}
struct EmptyDefaultTypeInternal {
PROTOBUF_CONSTEXPR EmptyDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR EmptyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~EmptyDefaultTypeInternal() {}
union {
Empty _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EmptyDefaultTypeInternal _Empty_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EmptyDefaultTypeInternal _Empty_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fempty_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fempty_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fempty_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Empty, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fempty_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fempty_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Empty, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Empty)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Empty)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Empty_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Empty_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\033google/protobuf/empty.proto\022\017google.pr"
"otobuf\"\007\n\005EmptyB}\n\023com.google.protobufB\n"
"EmptyProtoP\001Z.google.golang.org/protobuf"
"/types/known/emptypb\370\001\001\242\002\003GPB\252\002\036Google.P"
"rotobuf.WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\033google/protobuf/empty.proto\022\017google.pr"
"otobuf\"\007\n\005EmptyB}\n\023com.google.protobufB\n"
"EmptyProtoP\001Z.google.golang.org/protobuf"
"/types/known/emptypb\370\001\001\242\002\003GPB\252\002\036Google.P"
"rotobuf.WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fempty_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fempty_2eproto = {
false, false, 190, descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto,
false,
false,
190,
descriptor_table_protodef_google_2fprotobuf_2fempty_2eproto,
"google/protobuf/empty.proto",
&descriptor_table_google_2fprotobuf_2fempty_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fempty_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fempty_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto,
&descriptor_table_google_2fprotobuf_2fempty_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fempty_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fempty_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fempty_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fempty_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fempty_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fempty_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fempty_2eproto(&descriptor_table_google_2fprotobuf_2fempty_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fempty_2eproto(&descriptor_table_google_2fprotobuf_2fempty_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class Empty::_Internal {
@ -118,7 +140,6 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Empty::GetClassData() const {
&descriptor_table_google_2fprotobuf_2fempty_2eproto_getter, &descriptor_table_google_2fprotobuf_2fempty_2eproto_once,
file_level_metadata_google_2fprotobuf_2fempty_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -127,6 +148,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Empty >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Empty >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -32,8 +33,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fempty_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -44,19 +49,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fempty_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fempty_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fempty_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Empty;
struct EmptyDefaultTypeInternal;
PROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Empty* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Empty>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Empty* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Empty>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Empty final :
public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
public:
@ -176,23 +185,29 @@ class PROTOBUF_EXPORT Empty final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Empty
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fempty_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fempty_2eproto_2epb_2eh

@ -49,6 +49,7 @@
#include "google/protobuf/testing/googletest.h"
#include <gtest/gtest.h>
#include "absl/base/casts.h"
#include "absl/strings/match.h"
#include "google/protobuf/test_util.h"
#include "google/protobuf/test_util2.h"
#include "google/protobuf/stubs/stl_util.h"
@ -1234,7 +1235,7 @@ TEST(ExtensionSetTest, DynamicExtensions) {
std::string prefix = "." + template_descriptor->full_name() + ".";
if (extension->has_type_name()) {
std::string* type_name = extension->mutable_type_name();
if (HasPrefixString(*type_name, prefix)) {
if (absl::StartsWith(*type_name, prefix)) {
type_name->replace(0, prefix.size(), ".dynamic_extensions.");
}
}

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto
#include <google/protobuf/field_mask.pb.h>
#include "google/protobuf/field_mask.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,76 +12,99 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR FieldMask::FieldMask(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.paths_)*/{}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct FieldMaskDefaultTypeInternal {
PROTOBUF_CONSTEXPR FieldMaskDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR FieldMaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~FieldMaskDefaultTypeInternal() {}
union {
FieldMask _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldMask, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldMask, _impl_.paths_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldMask, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldMask, _impl_.paths_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FieldMask)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FieldMask)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_FieldMask_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_FieldMask_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n google/protobuf/field_mask.proto\022\017goog"
"le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
"\205\001\n\023com.google.protobufB\016FieldMaskProtoP"
"\001Z2google.golang.org/protobuf/types/know"
"n/fieldmaskpb\370\001\001\242\002\003GPB\252\002\036Google.Protobuf"
".WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n google/protobuf/field_mask.proto\022\017goog"
"le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
"\205\001\n\023com.google.protobufB\016FieldMaskProtoP"
"\001Z2google.golang.org/protobuf/types/know"
"n/fieldmaskpb\370\001\001\242\002\003GPB\252\002\036Google.Protobuf"
".WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto = {
false, false, 223, descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto,
false,
false,
223,
descriptor_table_protodef_google_2fprotobuf_2ffield_5fmask_2eproto,
"google/protobuf/field_mask.proto",
&descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto, file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto,
&descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto,
file_level_service_descriptors_google_2fprotobuf_2ffield_5fmask_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ffield_5fmask_2eproto(&descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ffield_5fmask_2eproto(&descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class FieldMask::_Internal {
@ -272,7 +294,6 @@ void FieldMask::InternalSwap(FieldMask* other) {
&descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_getter, &descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto_once,
file_level_metadata_google_2fprotobuf_2ffield_5fmask_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -281,6 +302,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FieldMask >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FieldMask >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,8 +32,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ffield_5fmask_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -43,19 +48,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto;
PROTOBUF_NAMESPACE_OPEN
class FieldMask;
struct FieldMaskDefaultTypeInternal;
PROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldMask* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldMask>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldMask* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldMask>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT FieldMask final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
public:
@ -220,12 +229,17 @@ class PROTOBUF_EXPORT FieldMask final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// FieldMask
// repeated string paths = 1;
@ -302,14 +316,15 @@ FieldMask::mutable_paths() {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh

@ -76,7 +76,7 @@ class PROTOBUF_EXPORT GzipInputStream PROTOBUF_FUTURE_FINAL
Format format = AUTO, int buffer_size = -1);
GzipInputStream(const GzipInputStream&) = delete;
GzipInputStream& operator=(const GzipInputStream&) = delete;
virtual ~GzipInputStream();
~GzipInputStream() override;
// Return last error message or NULL if no error.
inline const char* ZlibErrorMessage() const { return zcontext_.msg; }
@ -144,7 +144,7 @@ class PROTOBUF_EXPORT GzipOutputStream PROTOBUF_FUTURE_FINAL
GzipOutputStream(const GzipOutputStream&) = delete;
GzipOutputStream& operator=(const GzipOutputStream&) = delete;
virtual ~GzipOutputStream();
~GzipOutputStream() override;
// Return last error message or NULL if no error.
inline const char* ZlibErrorMessage() const { return zcontext_.msg; }

@ -48,7 +48,7 @@
#include "google/protobuf/stubs/common.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/stubs/stringprintf.h"
#include "absl/strings/string_view.h"
@ -129,6 +129,16 @@ Printer::Printer(ZeroCopyOutputStream* output, Options options)
}
}
absl::string_view Printer::LookupVar(absl::string_view var) {
LookupResult result = LookupInFrameStack(var, absl::MakeSpan(var_lookups_));
GOOGLE_CHECK(result.has_value()) << "could not find " << var;
auto* view = absl::get_if<absl::string_view>(&*result);
GOOGLE_CHECK(view != nullptr) << "could not find " << var
<< "; found callback instead";
return *view;
}
bool Printer::Validate(bool cond, Printer::PrintOptions opts,
absl::FunctionRef<std::string()> message) {
if (!cond) {
@ -614,10 +624,12 @@ void Printer::PrintImpl(absl::string_view format,
//
// };
//
// in many cases. We *also* do this if a ; follows the substitution,
// in many cases. We *also* do this if a ; or , follows the substitution,
// because this helps clang-format keep its head on in many cases.
// Users that need to keep the semi can write $foo$/**/;
absl::ConsumePrefix(&format, ";");
if (!absl::ConsumePrefix(&format, ";")) {
absl::ConsumePrefix(&format, ",");
}
absl::ConsumePrefix(&format, "\n");
indent_ =
original_indent + ConsumeIndentForLine(raw_string_indent_len, format);

@ -495,6 +495,13 @@ class PROTOBUF_EXPORT Printer {
return absl::MakeCleanup([this] { var_lookups_.pop_back(); });
}
// Looks up a variable set with WithVars().
//
// Will crash if:
// - `var` is not present in the lookup frame table.
// - `var` is a callback, rather than a string.
absl::string_view LookupVar(absl::string_view var);
// Pushes a new annotation lookup frame that stores `vars` by reference.
//
// Returns an RAII object that pops the lookup frame.

@ -39,7 +39,7 @@
#include "google/protobuf/map_lite_unittest.pb.h"
#include "google/protobuf/unittest_lite.pb.h"
#include <gtest/gtest.h>
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/arena_test_util.h"
#include "google/protobuf/io/coded_stream.h"
@ -1144,8 +1144,8 @@ TEST(Lite, CorrectEnding) {
TEST(Lite, DebugString) {
protobuf_unittest::TestAllTypesLite message1, message2;
EXPECT_TRUE(HasPrefixString(message1.DebugString(), "MessageLite at 0x"));
EXPECT_TRUE(HasPrefixString(message2.DebugString(), "MessageLite at 0x"));
EXPECT_TRUE(absl::StartsWith(message1.DebugString(), "MessageLite at 0x"));
EXPECT_TRUE(absl::StartsWith(message2.DebugString(), "MessageLite at 0x"));
// DebugString() and ShortDebugString() are the same for now.
EXPECT_EQ(message1.DebugString(), message1.ShortDebugString());

@ -63,6 +63,10 @@
namespace google {
namespace protobuf {
MessageLite::~MessageLite(){
// Defined out of line to save code space
}
std::string MessageLite::InitializationErrorString() const {
return "(cannot determine missing fields for lite message)";
}

@ -171,7 +171,7 @@ class PROTOBUF_EXPORT MessageLite {
constexpr MessageLite() {}
MessageLite(const MessageLite&) = delete;
MessageLite& operator=(const MessageLite&) = delete;
virtual ~MessageLite() = default;
virtual ~MessageLite();
// Basic Operations ------------------------------------------------

@ -337,7 +337,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream {
template <typename A>
const char* AppendSize(const char* ptr, int size, const A& append) {
int chunk_size = buffer_end_ + kSlopBytes - ptr;
int chunk_size = static_cast<int>(buffer_end_ + kSlopBytes - ptr);
do {
GOOGLE_DCHECK(size > chunk_size);
if (next_chunk_ == nullptr) return nullptr;
@ -351,7 +351,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream {
ptr = Next();
if (ptr == nullptr) return nullptr; // passed the limit
ptr += kSlopBytes;
chunk_size = buffer_end_ + kSlopBytes - ptr;
chunk_size = static_cast<int>(buffer_end_ + kSlopBytes - ptr);
} while (size > chunk_size);
append(ptr, size);
return ptr + size;
@ -880,7 +880,7 @@ template <typename T>
const char* EpsCopyInputStream::ReadPackedFixed(const char* ptr, int size,
RepeatedField<T>* out) {
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
int nbytes = buffer_end_ + kSlopBytes - ptr;
int nbytes = static_cast<int>(buffer_end_ + kSlopBytes - ptr);
while (size > nbytes) {
int num = nbytes / sizeof(T);
int old_entries = out->size();
@ -898,7 +898,7 @@ const char* EpsCopyInputStream::ReadPackedFixed(const char* ptr, int size,
ptr = Next();
if (ptr == nullptr) return nullptr;
ptr += kSlopBytes - (nbytes - block_size);
nbytes = buffer_end_ + kSlopBytes - ptr;
nbytes = static_cast<int>(buffer_end_ + kSlopBytes - ptr);
}
int num = size / sizeof(T);
int old_entries = out->size();
@ -930,11 +930,11 @@ template <typename Add>
const char* EpsCopyInputStream::ReadPackedVarint(const char* ptr, Add add) {
int size = ReadSize(&ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
int chunk_size = buffer_end_ - ptr;
int chunk_size = static_cast<int>(buffer_end_ - ptr);
while (size > chunk_size) {
ptr = ReadPackedVarintArray(ptr, buffer_end_, add);
if (ptr == nullptr) return nullptr;
int overrun = ptr - buffer_end_;
int overrun = static_cast<int>(ptr - buffer_end_);
GOOGLE_DCHECK(overrun >= 0 && overrun <= kSlopBytes);
if (size - chunk_size <= kSlopBytes) {
// The current buffer contains all the information needed, we don't need
@ -955,7 +955,7 @@ const char* EpsCopyInputStream::ReadPackedVarint(const char* ptr, Add add) {
ptr = Next();
if (ptr == nullptr) return nullptr;
ptr += overrun;
chunk_size = buffer_end_ - ptr;
chunk_size = static_cast<int>(buffer_end_ - ptr);
}
auto end = ptr + size;
ptr = ReadPackedVarintArray(ptr, end, add);

@ -38,7 +38,7 @@
#include "google/protobuf/arena.h"
#include "google/protobuf/text_format.h"
#include <gtest/gtest.h>
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "google/protobuf/test_util.h"
// Must be included last.
@ -296,7 +296,7 @@ TEST(Proto3OptionalTest, OptionalFieldDescriptor) {
for (int i = 0; i < d->field_count(); i++) {
const FieldDescriptor* f = d->field(i);
if (HasPrefixString(f->name(), "singular")) {
if (absl::StartsWith(f->name(), "singular")) {
EXPECT_FALSE(f->has_optional_keyword()) << f->full_name();
EXPECT_FALSE(f->has_presence()) << f->full_name();
EXPECT_FALSE(f->containing_oneof()) << f->full_name();

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto
#include <google/protobuf/source_context.pb.h>
#include "google/protobuf/source_context.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,76 +12,99 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR SourceContext::SourceContext(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.file_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct SourceContextDefaultTypeInternal {
PROTOBUF_CONSTEXPR SourceContextDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR SourceContextDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~SourceContextDefaultTypeInternal() {}
union {
SourceContext _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceContextDefaultTypeInternal _SourceContext_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceContextDefaultTypeInternal _SourceContext_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _impl_.file_name_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _impl_.file_name_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::SourceContext)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::SourceContext)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n$google/protobuf/source_context.proto\022\017"
"google.protobuf\"\"\n\rSourceContext\022\021\n\tfile"
"_name\030\001 \001(\tB\212\001\n\023com.google.protobufB\022Sou"
"rceContextProtoP\001Z6google.golang.org/pro"
"tobuf/types/known/sourcecontextpb\242\002\003GPB\252"
"\002\036Google.Protobuf.WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n$google/protobuf/source_context.proto\022\017"
"google.protobuf\"\"\n\rSourceContext\022\021\n\tfile"
"_name\030\001 \001(\tB\212\001\n\023com.google.protobufB\022Sou"
"rceContextProtoP\001Z6google.golang.org/pro"
"tobuf/types/known/sourcecontextpb\242\002\003GPB\252"
"\002\036Google.Protobuf.WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto = {
false, false, 240, descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto,
false,
false,
240,
descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto,
"google/protobuf/source_context.proto",
&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fsource_5fcontext_2eproto(&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fsource_5fcontext_2eproto(&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class SourceContext::_Internal {
@ -285,7 +307,6 @@ void SourceContext::InternalSwap(SourceContext* other) {
&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter, &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once,
file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -294,6 +315,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::SourceContext >(Arena* arena
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::SourceContext >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,8 +32,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fsource_5fcontext_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -43,19 +48,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto;
PROTOBUF_NAMESPACE_OPEN
class SourceContext;
struct SourceContextDefaultTypeInternal;
PROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceContext* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceContext* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT SourceContext final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {
public:
@ -210,12 +219,17 @@ class PROTOBUF_EXPORT SourceContext final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// SourceContext
// string file_name = 1;
@ -269,14 +283,15 @@ inline void SourceContext::set_allocated_file_name(std::string* file_name) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto
#include <google/protobuf/struct.pb.h>
#include "google/protobuf/struct.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,164 +12,190 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse(
::_pbi::ConstantInitialized) {}
struct Struct_FieldsEntry_DoNotUseDefaultTypeInternal {
PROTOBUF_CONSTEXPR Struct_FieldsEntry_DoNotUseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR Struct_FieldsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~Struct_FieldsEntry_DoNotUseDefaultTypeInternal() {}
union {
Struct_FieldsEntry_DoNotUse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Struct_FieldsEntry_DoNotUseDefaultTypeInternal _Struct_FieldsEntry_DoNotUse_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Struct_FieldsEntry_DoNotUseDefaultTypeInternal _Struct_FieldsEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR Struct::Struct(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.fields_)*/{::_pbi::ConstantInitialized()}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct StructDefaultTypeInternal {
PROTOBUF_CONSTEXPR StructDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR StructDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~StructDefaultTypeInternal() {}
union {
Struct _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StructDefaultTypeInternal _Struct_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StructDefaultTypeInternal _Struct_default_instance_;
PROTOBUF_CONSTEXPR Value::Value(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.kind_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_._oneof_case_)*/{}} {}
struct ValueDefaultTypeInternal {
PROTOBUF_CONSTEXPR ValueDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR ValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~ValueDefaultTypeInternal() {}
union {
Value _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueDefaultTypeInternal _Value_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueDefaultTypeInternal _Value_default_instance_;
PROTOBUF_CONSTEXPR ListValue::ListValue(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.values_)*/{}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ListValueDefaultTypeInternal {
PROTOBUF_CONSTEXPR ListValueDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR ListValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~ListValueDefaultTypeInternal() {}
union {
ListValue _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListValueDefaultTypeInternal _ListValue_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListValueDefaultTypeInternal _ListValue_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fstruct_2eproto[4];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fstruct_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, key_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, value_),
0,
1,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct, _impl_.fields_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _internal_metadata_),
~0u, // no _extensions_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _impl_._oneof_case_[0]),
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _impl_.kind_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ListValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ListValue, _impl_.values_),
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2fstruct_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _has_bits_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, key_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, value_),
0,
1,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct, _impl_.fields_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _internal_metadata_),
~0u, // no _extensions_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _impl_._oneof_case_[0]),
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Value, _impl_.kind_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ListValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ListValue, _impl_.values_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 10, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse)},
{ 12, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Struct)},
{ 21, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Value)},
{ 36, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::ListValue)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 10, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse)},
{ 12, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Struct)},
{ 21, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Value)},
{ 36, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::ListValue)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Struct_FieldsEntry_DoNotUse_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Struct_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Value_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_ListValue_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Struct_FieldsEntry_DoNotUse_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Struct_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Value_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_ListValue_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\034google/protobuf/struct.proto\022\017google.p"
"rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
"gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
"sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
"gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
"_value\030\001 \001(\0162\032.google.protobuf.NullValue"
"H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
"ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
"ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
"\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
"ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
"es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
"Value\022\016\n\nNULL_VALUE\020\000B\177\n\023com.google.prot"
"obufB\013StructProtoP\001Z/google.golang.org/p"
"rotobuf/types/known/structpb\370\001\001\242\002\003GPB\252\002\036"
"Google.Protobuf.WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\034google/protobuf/struct.proto\022\017google.p"
"rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
"gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
"sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
"gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
"_value\030\001 \001(\0162\032.google.protobuf.NullValue"
"H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
"ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
"ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
"\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
"ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
"es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
"Value\022\016\n\nNULL_VALUE\020\000B\177\n\023com.google.prot"
"obufB\013StructProtoP\001Z/google.golang.org/p"
"rotobuf/types/known/structpb\370\001\001\242\002\003GPB\252\002\036"
"Google.Protobuf.WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fstruct_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fstruct_2eproto = {
false, false, 638, descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto,
false,
false,
638,
descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto,
"google/protobuf/struct.proto",
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_once, nullptr, 0, 4,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto,
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_once,
nullptr,
0,
4,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2fstruct_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2fstruct_2eproto,
file_level_service_descriptors_google_2fprotobuf_2fstruct_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fstruct_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2fstruct_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fstruct_2eproto(&descriptor_table_google_2fprotobuf_2fstruct_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fstruct_2eproto(&descriptor_table_google_2fprotobuf_2fstruct_2eproto);
PROTOBUF_NAMESPACE_OPEN
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NullValue_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fstruct_2eproto);
@ -185,7 +210,6 @@ bool NullValue_IsValid(int value) {
}
}
// ===================================================================
Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse() {}
@ -199,7 +223,6 @@ void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& o
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_getter, &descriptor_table_google_2fprotobuf_2fstruct_2eproto_once,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto[0]);
}
// ===================================================================
class Struct::_Internal {
@ -414,7 +437,6 @@ void Struct::InternalSwap(Struct* other) {
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_getter, &descriptor_table_google_2fprotobuf_2fstruct_2eproto_once,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto[1]);
}
// ===================================================================
class Value::_Internal {
@ -856,7 +878,6 @@ void Value::InternalSwap(Value* other) {
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_getter, &descriptor_table_google_2fprotobuf_2fstruct_2eproto_once,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto[2]);
}
// ===================================================================
class ListValue::_Internal {
@ -1041,7 +1062,6 @@ void ListValue::InternalSwap(ListValue* other) {
&descriptor_table_google_2fprotobuf_2fstruct_2eproto_getter, &descriptor_table_google_2fprotobuf_2fstruct_2eproto_once,
file_level_metadata_google_2fprotobuf_2fstruct_2eproto[3]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -1062,6 +1082,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ListValue >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::ListValue >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -35,8 +36,12 @@
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fstruct_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -47,7 +52,8 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fstruct_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fstruct_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2fstruct_2eproto;
PROTOBUF_NAMESPACE_OPEN
class ListValue;
struct ListValueDefaultTypeInternal;
@ -61,15 +67,17 @@ PROTOBUF_EXPORT extern Struct_FieldsEntry_DoNotUseDefaultTypeInternal _Struct_Fi
class Value;
struct ValueDefaultTypeInternal;
PROTOBUF_EXPORT extern ValueDefaultTypeInternal _Value_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ListValue* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ListValue>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Struct* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Struct>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Value* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Value>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ListValue* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ListValue>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Struct* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Struct>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Value* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Value>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_NAMESPACE_OPEN
enum NullValue : int {
NULL_VALUE = 0,
NullValue_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
@ -98,8 +106,12 @@ inline bool NullValue_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<NullValue>(
NullValue_descriptor(), name, value);
}
// ===================================================================
// -------------------------------------------------------------------
class Struct_FieldsEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<Struct_FieldsEntry_DoNotUse,
std::string, ::PROTOBUF_NAMESPACE_ID::Value,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
@ -123,7 +135,6 @@ public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto;
};
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Struct final :
@ -286,8 +297,7 @@ class PROTOBUF_EXPORT Struct final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Value final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {
@ -555,8 +565,7 @@ class PROTOBUF_EXPORT Value final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT ListValue final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {
@ -716,14 +725,19 @@ class PROTOBUF_EXPORT ListValue final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// Struct
// map<string, .google.protobuf.Value> fields = 1;
@ -1152,19 +1166,13 @@ ListValue::values() const {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::NullValue> : ::std::true_type {};
@ -1178,4 +1186,5 @@ PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fstruct_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fstruct_2eproto_2epb_2eh

@ -95,11 +95,14 @@ TEST(LoggingTest, DefaultLogging) {
GOOGLE_LOG(ERROR ) << "An error.";
std::string text = GetCapturedTestStderr();
EXPECT_EQ(
"[libprotobuf INFO " __FILE__ ":" + SimpleItoa(line + 1) + "] A message.\n"
"[libprotobuf WARNING " __FILE__ ":" + SimpleItoa(line + 2) + "] A warning.\n"
"[libprotobuf ERROR " __FILE__ ":" + SimpleItoa(line + 3) + "] An error.\n",
text);
EXPECT_EQ(absl::StrCat("[libprotobuf INFO " __FILE__ ":", line + 1,
"] A message.\n"
"[libprotobuf WARNING " __FILE__ ":",
line + 2,
"] A warning.\n"
"[libprotobuf ERROR " __FILE__ ":",
line + 3, "] An error.\n"),
text);
}
TEST(LoggingTest, NullLogging) {
@ -128,12 +131,10 @@ TEST(LoggingTest, CaptureLogging) {
EXPECT_TRUE(SetLogHandler(old_handler) == &CaptureLog);
ASSERT_EQ(2, captured_messages_.size());
EXPECT_EQ(
"2 " __FILE__ ":" + SimpleItoa(start_line + 1) + ": An error.",
captured_messages_[0]);
EXPECT_EQ(
"1 " __FILE__ ":" + SimpleItoa(start_line + 2) + ": A warning.",
captured_messages_[1]);
EXPECT_EQ(absl::StrCat("2 " __FILE__ ":", start_line + 1, ": An error."),
captured_messages_[0]);
EXPECT_EQ(absl::StrCat("1 " __FILE__ ":", start_line + 2, ": A warning."),
captured_messages_[1]);
}
TEST(LoggingTest, SilenceLogging) {
@ -154,12 +155,10 @@ TEST(LoggingTest, SilenceLogging) {
EXPECT_TRUE(SetLogHandler(old_handler) == &CaptureLog);
ASSERT_EQ(2, captured_messages_.size());
EXPECT_EQ(
"0 " __FILE__ ":" + SimpleItoa(line1) + ": Visible1",
captured_messages_[0]);
EXPECT_EQ(
"0 " __FILE__ ":" + SimpleItoa(line2) + ": Visible2",
captured_messages_[1]);
EXPECT_EQ(absl::StrCat("0 " __FILE__ ":", line1, ": Visible1"),
captured_messages_[0]);
EXPECT_EQ(absl::StrCat("0 " __FILE__ ":", line2, ": Visible2"),
captured_messages_[1]);
}
class ClosureTest : public testing::Test {

@ -63,75 +63,7 @@
namespace google {
namespace protobuf {
// These are defined as macros on some platforms. #undef them so that we can
// redefine them.
#undef isxdigit
#undef isprint
// The definitions of these in ctype.h change based on locale. Since our
// string manipulation is all in relation to the protocol buffer and C++
// languages, we always want to use the C locale. So, we re-define these
// exactly as we want them.
inline bool isxdigit(char c) {
return ('0' <= c && c <= '9') ||
('a' <= c && c <= 'f') ||
('A' <= c && c <= 'F');
}
inline bool isprint(char c) {
return c >= 0x20 && c <= 0x7E;
}
// ----------------------------------------------------------------------
// ReplaceCharacters
// Replaces any occurrence of the character 'remove' (or the characters
// in 'remove') with the character 'replacewith'.
// ----------------------------------------------------------------------
void ReplaceCharacters(std::string *s, const char *remove, char replacewith) {
const char *str_start = s->c_str();
const char *str = str_start;
for (str = strpbrk(str, remove);
str != nullptr;
str = strpbrk(str + 1, remove)) {
(*s)[str - str_start] = replacewith;
}
}
void StripWhitespace(std::string *str) {
int str_length = str->length();
// Strip off leading whitespace.
int first = 0;
while (first < str_length && absl::ascii_isspace(str->at(first))) {
++first;
}
// If entire string is white space.
if (first == str_length) {
str->clear();
return;
}
if (first > 0) {
str->erase(0, first);
str_length -= first;
}
// Strip off trailing whitespace.
int last = str_length - 1;
while (last >= 0 && absl::ascii_isspace(str->at(last))) {
--last;
}
if (last != (str_length - 1) && last >= 0) {
str->erase(last + 1, std::string::npos);
}
}
// ----------------------------------------------------------------------
// StringReplace()
// Replace the "old" pattern with the "new" pattern in a string,
// and append the result to "res". If replace_all is false,
// it only replaces the first instance of "old."
// ----------------------------------------------------------------------
namespace {
void StringReplace(const std::string &s, const std::string &oldsub,
const std::string &newsub, bool replace_all,
std::string *res) {
@ -153,6 +85,7 @@ void StringReplace(const std::string &s, const std::string &oldsub,
} while (replace_all);
res->append(s, start_pos, s.length() - start_pos);
}
} // namespace
// ----------------------------------------------------------------------
// StringReplace()
@ -170,91 +103,6 @@ std::string StringReplace(const std::string &s, const std::string &oldsub,
return ret;
}
// ----------------------------------------------------------------------
// SplitStringUsing()
// Split a string using a character delimiter. Append the components
// to 'result'.
//
// Note: For multi-character delimiters, this routine will split on *ANY* of
// the characters in the string, not the entire string as a single delimiter.
// ----------------------------------------------------------------------
template <typename ITR>
static inline void SplitStringToIteratorUsing(absl::string_view full,
const char *delim, ITR &result) {
// Optimize the common case where delim is a single character.
if (delim[0] != '\0' && delim[1] == '\0') {
char c = delim[0];
const char* p = full.data();
const char* end = p + full.size();
while (p != end) {
if (*p == c) {
++p;
} else {
const char* start = p;
while (++p != end && *p != c);
*result++ = std::string(start, p - start);
}
}
return;
}
std::string::size_type begin_index, end_index;
begin_index = full.find_first_not_of(delim);
while (begin_index != std::string::npos) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == std::string::npos) {
*result++ = std::string(full.substr(begin_index));
return;
}
*result++ =
std::string(full.substr(begin_index, (end_index - begin_index)));
begin_index = full.find_first_not_of(delim, end_index);
}
}
void SplitStringUsing(absl::string_view full, const char *delim,
std::vector<std::string> *result) {
std::back_insert_iterator<std::vector<std::string> > it(*result);
SplitStringToIteratorUsing(full, delim, it);
}
// Split a string using a character delimiter. Append the components
// to 'result'. If there are consecutive delimiters, this function
// will return corresponding empty strings. The string is split into
// at most the specified number of pieces greedily. This means that the
// last piece may possibly be split further. To split into as many pieces
// as possible, specify 0 as the number of pieces.
//
// If "full" is the empty string, yields an empty string as the only value.
//
// If "pieces" is negative for some reason, it returns the whole string
// ----------------------------------------------------------------------
template <typename ITR>
static inline void SplitStringToIteratorAllowEmpty(absl::string_view full,
const char *delim,
int pieces, ITR &result) {
std::string::size_type begin_index, end_index;
begin_index = 0;
for (int i = 0; (i < pieces-1) || (pieces == 0); i++) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == std::string::npos) {
*result++ = std::string(full.substr(begin_index));
return;
}
*result++ =
std::string(full.substr(begin_index, (end_index - begin_index)));
begin_index = end_index + 1;
}
*result++ = std::string(full.substr(begin_index));
}
void SplitStringAllowEmpty(absl::string_view full, const char *delim,
std::vector<std::string> *result) {
std::back_insert_iterator<std::vector<std::string> > it(*result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it);
}
// ----------------------------------------------------------------------
// strto32_adaptor()
// strtou32_adaptor()
@ -423,378 +271,9 @@ bool safe_uint_internal(std::string text, IntType *value_p) {
return safe_parse_positive_int(text, value_p);
}
// ----------------------------------------------------------------------
// FastIntToBuffer()
// FastInt64ToBuffer()
// FastHexToBuffer()
// FastHex64ToBuffer()
// FastHex32ToBuffer()
// ----------------------------------------------------------------------
// Offset into buffer where FastInt64ToBuffer places the end of string
// null character. Also used by FastInt64ToBufferLeft.
static const int kFastInt64ToBufferOffset = 21;
char *FastInt64ToBuffer(int64_t i, char* buffer) {
// We could collapse the positive and negative sections, but that
// would be slightly slower for positive numbers...
// 22 bytes is enough to store -2**64, -18446744073709551616.
char* p = buffer + kFastInt64ToBufferOffset;
*p-- = '\0';
if (i >= 0) {
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
return p + 1;
} else {
// On different platforms, % and / have different behaviors for
// negative numbers, so we need to jump through hoops to make sure
// we don't divide negative numbers.
if (i > -10) {
i = -i;
*p-- = '0' + i;
*p = '-';
return p;
} else {
// Make sure we aren't at MIN_INT, in which case we can't say i = -i
i = i + 10;
i = -i;
*p-- = '0' + i % 10;
// Undo what we did a moment ago
i = i / 10 + 1;
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
*p = '-';
return p;
}
}
}
// Offset into buffer where FastInt32ToBuffer places the end of string
// null character. Also used by FastInt32ToBufferLeft
static const int kFastInt32ToBufferOffset = 11;
// Yes, this is a duplicate of FastInt64ToBuffer. But, we need this for the
// compiler to generate 32 bit arithmetic instructions. It's much faster, at
// least with 32 bit binaries.
char *FastInt32ToBuffer(int32_t i, char* buffer) {
// We could collapse the positive and negative sections, but that
// would be slightly slower for positive numbers...
// 12 bytes is enough to store -2**32, -4294967296.
char* p = buffer + kFastInt32ToBufferOffset;
*p-- = '\0';
if (i >= 0) {
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
return p + 1;
} else {
// On different platforms, % and / have different behaviors for
// negative numbers, so we need to jump through hoops to make sure
// we don't divide negative numbers.
if (i > -10) {
i = -i;
*p-- = '0' + i;
*p = '-';
return p;
} else {
// Make sure we aren't at MIN_INT, in which case we can't say i = -i
i = i + 10;
i = -i;
*p-- = '0' + i % 10;
// Undo what we did a moment ago
i = i / 10 + 1;
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
*p = '-';
return p;
}
}
}
char *FastHexToBuffer(int i, char* buffer) {
GOOGLE_CHECK(i >= 0) << "FastHexToBuffer() wants non-negative integers, not " << i;
static const char *hexdigits = "0123456789abcdef";
char *p = buffer + 21;
*p-- = '\0';
do {
*p-- = hexdigits[i & 15]; // mod by 16
i >>= 4; // divide by 16
} while (i > 0);
return p + 1;
}
char *InternalFastHexToBuffer(uint64_t value, char* buffer, int num_byte) {
static const char *hexdigits = "0123456789abcdef";
buffer[num_byte] = '\0';
for (int i = num_byte - 1; i >= 0; i--) {
#ifdef _M_X64
// MSVC x64 platform has a bug optimizing the uint32(value) in the #else
// block. Given that the uint32 cast was to improve performance on 32-bit
// platforms, we use 64-bit '&' directly.
buffer[i] = hexdigits[value & 0xf];
#else
buffer[i] = hexdigits[uint32_t(value) & 0xf];
#endif
value >>= 4;
}
return buffer;
}
char *FastHex64ToBuffer(uint64_t value, char* buffer) {
return InternalFastHexToBuffer(value, buffer, 16);
}
char *FastHex32ToBuffer(uint32_t value, char* buffer) {
return InternalFastHexToBuffer(value, buffer, 8);
}
// ----------------------------------------------------------------------
// FastInt32ToBufferLeft()
// FastUInt32ToBufferLeft()
// FastInt64ToBufferLeft()
// FastUInt64ToBufferLeft()
//
// Like the Fast*ToBuffer() functions above, these are intended for speed.
// Unlike the Fast*ToBuffer() functions, however, these functions write
// their output to the beginning of the buffer (hence the name, as the
// output is left-aligned). The caller is responsible for ensuring that
// the buffer has enough space to hold the output.
//
// Returns a pointer to the end of the string (i.e. the null character
// terminating the string).
// ----------------------------------------------------------------------
static const char two_ASCII_digits[100][2] = {
{'0','0'}, {'0','1'}, {'0','2'}, {'0','3'}, {'0','4'},
{'0','5'}, {'0','6'}, {'0','7'}, {'0','8'}, {'0','9'},
{'1','0'}, {'1','1'}, {'1','2'}, {'1','3'}, {'1','4'},
{'1','5'}, {'1','6'}, {'1','7'}, {'1','8'}, {'1','9'},
{'2','0'}, {'2','1'}, {'2','2'}, {'2','3'}, {'2','4'},
{'2','5'}, {'2','6'}, {'2','7'}, {'2','8'}, {'2','9'},
{'3','0'}, {'3','1'}, {'3','2'}, {'3','3'}, {'3','4'},
{'3','5'}, {'3','6'}, {'3','7'}, {'3','8'}, {'3','9'},
{'4','0'}, {'4','1'}, {'4','2'}, {'4','3'}, {'4','4'},
{'4','5'}, {'4','6'}, {'4','7'}, {'4','8'}, {'4','9'},
{'5','0'}, {'5','1'}, {'5','2'}, {'5','3'}, {'5','4'},
{'5','5'}, {'5','6'}, {'5','7'}, {'5','8'}, {'5','9'},
{'6','0'}, {'6','1'}, {'6','2'}, {'6','3'}, {'6','4'},
{'6','5'}, {'6','6'}, {'6','7'}, {'6','8'}, {'6','9'},
{'7','0'}, {'7','1'}, {'7','2'}, {'7','3'}, {'7','4'},
{'7','5'}, {'7','6'}, {'7','7'}, {'7','8'}, {'7','9'},
{'8','0'}, {'8','1'}, {'8','2'}, {'8','3'}, {'8','4'},
{'8','5'}, {'8','6'}, {'8','7'}, {'8','8'}, {'8','9'},
{'9','0'}, {'9','1'}, {'9','2'}, {'9','3'}, {'9','4'},
{'9','5'}, {'9','6'}, {'9','7'}, {'9','8'}, {'9','9'}
};
char* FastUInt32ToBufferLeft(uint32_t u, char* buffer) {
uint32_t digits;
const char *ASCII_digits = nullptr;
// The idea of this implementation is to trim the number of divides to as few
// as possible by using multiplication and subtraction rather than mod (%),
// and by outputting two digits at a time rather than one.
// The huge-number case is first, in the hopes that the compiler will output
// that case in one branch-free block of code, and only output conditional
// branches into it from below.
if (u >= 1000000000) { // >= 1,000,000,000
digits = u / 100000000; // 100,000,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt100_000_000:
u -= digits * 100000000; // 100,000,000
lt100_000_000:
digits = u / 1000000; // 1,000,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt1_000_000:
u -= digits * 1000000; // 1,000,000
lt1_000_000:
digits = u / 10000; // 10,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt10_000:
u -= digits * 10000; // 10,000
lt10_000:
digits = u / 100;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt100:
u -= digits * 100;
lt100:
digits = u;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
done:
*buffer = 0;
return buffer;
}
if (u < 100) {
digits = u;
if (u >= 10) goto lt100;
*buffer++ = '0' + digits;
goto done;
}
if (u < 10000) { // 10,000
if (u >= 1000) goto lt10_000;
digits = u / 100;
*buffer++ = '0' + digits;
goto sublt100;
}
if (u < 1000000) { // 1,000,000
if (u >= 100000) goto lt1_000_000;
digits = u / 10000; // 10,000
*buffer++ = '0' + digits;
goto sublt10_000;
}
if (u < 100000000) { // 100,000,000
if (u >= 10000000) goto lt100_000_000;
digits = u / 1000000; // 1,000,000
*buffer++ = '0' + digits;
goto sublt1_000_000;
}
// we already know that u < 1,000,000,000
digits = u / 100000000; // 100,000,000
*buffer++ = '0' + digits;
goto sublt100_000_000;
}
char* FastInt32ToBufferLeft(int32_t i, char* buffer) {
uint32_t u = 0;
if (i < 0) {
*buffer++ = '-';
u -= i;
} else {
u = i;
}
return FastUInt32ToBufferLeft(u, buffer);
}
char* FastUInt64ToBufferLeft(uint64_t u64, char* buffer) {
int digits;
const char *ASCII_digits = nullptr;
uint32_t u = static_cast<uint32_t>(u64);
if (u == u64) return FastUInt32ToBufferLeft(u, buffer);
uint64_t top_11_digits = u64 / 1000000000;
buffer = FastUInt64ToBufferLeft(top_11_digits, buffer);
u = u64 - (top_11_digits * 1000000000);
digits = u / 10000000; // 10,000,000
GOOGLE_DCHECK_LT(digits, 100);
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 10000000; // 10,000,000
digits = u / 100000; // 100,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 100000; // 100,000
digits = u / 1000; // 1,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 1000; // 1,000
digits = u / 10;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 10;
digits = u;
*buffer++ = '0' + digits;
*buffer = 0;
return buffer;
}
char* FastInt64ToBufferLeft(int64_t i, char* buffer) {
uint64_t u = 0;
if (i < 0) {
*buffer++ = '-';
u -= i;
} else {
u = i;
}
return FastUInt64ToBufferLeft(u, buffer);
}
// ----------------------------------------------------------------------
// SimpleItoa()
// Description: converts an integer to a string.
//
// Return value: string
// ----------------------------------------------------------------------
std::string SimpleItoa(int i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
std::string SimpleItoa(unsigned int i) {
char buffer[kFastToBufferSize];
return std::string(buffer, (sizeof(i) == 4)
? FastUInt32ToBufferLeft(i, buffer)
: FastUInt64ToBufferLeft(i, buffer));
}
std::string SimpleItoa(long i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
std::string SimpleItoa(unsigned long i) {
char buffer[kFastToBufferSize];
return std::string(buffer, (sizeof(i) == 4)
? FastUInt32ToBufferLeft(i, buffer)
: FastUInt64ToBufferLeft(i, buffer));
}
std::string SimpleItoa(long long i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
std::string SimpleItoa(unsigned long long i) {
char buffer[kFastToBufferSize];
return std::string(buffer, (sizeof(i) == 4)
? FastUInt32ToBufferLeft(i, buffer)
: FastUInt64ToBufferLeft(i, buffer));
}
// ----------------------------------------------------------------------
// SimpleDtoa()
// SimpleFtoa()
// DoubleToBuffer()
// FloatToBuffer()
// We want to print the value without losing precision, but we also do
// not want to print more digits than necessary. This turns out to be
// trickier than it sounds. Numbers like 0.2 cannot be represented
@ -831,23 +310,18 @@ std::string SimpleItoa(unsigned long long i) {
// implementation.
// ----------------------------------------------------------------------
std::string SimpleDtoa(double value) {
char buffer[kDoubleToBufferSize];
return DoubleToBuffer(value, buffer);
}
std::string SimpleFtoa(float value) {
char buffer[kFloatToBufferSize];
return FloatToBuffer(value, buffer);
}
namespace {
// In practice, doubles should never need more than 24 bytes and floats
// should never need more than 14 (including null terminators), but we
// overestimate to be safe.
constexpr int kDoubleToBufferSize = 32;
constexpr int kFloatToBufferSize = 24;
static inline bool IsValidFloatChar(char c) {
return ('0' <= c && c <= '9') ||
c == 'e' || c == 'E' ||
c == '+' || c == '-';
return ('0' <= c && c <= '9') || c == 'e' || c == 'E' || c == '+' || c == '-';
}
void DelocalizeRadix(char* buffer) {
void DelocalizeRadix(char *buffer) {
// Fast check: if the buffer has a normal decimal point, assume no
// translation is needed.
if (strchr(buffer, '.') != nullptr) return;
@ -868,12 +342,52 @@ void DelocalizeRadix(char* buffer) {
if (!IsValidFloatChar(*buffer) && *buffer != '\0') {
// It appears the radix was a multi-byte character. We need to remove the
// extra bytes.
char* target = buffer;
do { ++buffer; } while (!IsValidFloatChar(*buffer) && *buffer != '\0');
char *target = buffer;
do {
++buffer;
} while (!IsValidFloatChar(*buffer) && *buffer != '\0');
memmove(target, buffer, strlen(buffer) + 1);
}
}
char *FloatToBuffer(float value, char *buffer) {
// FLT_DIG is 6 for IEEE-754 floats, which are used on almost all
// platforms these days. Just in case some system exists where FLT_DIG
// is significantly larger -- and risks overflowing our buffer -- we have
// this assert.
static_assert(FLT_DIG < 10, "FLT_DIG_is_too_big");
if (value == std::numeric_limits<double>::infinity()) {
strcpy(buffer, "inf");
return buffer;
} else if (value == -std::numeric_limits<double>::infinity()) {
strcpy(buffer, "-inf");
return buffer;
} else if (std::isnan(value)) {
strcpy(buffer, "nan");
return buffer;
}
int snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG, value);
// The snprintf should never overflow because the buffer is significantly
// larger than the precision we asked for.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
float parsed_value;
if (!safe_strtof(buffer, &parsed_value) || parsed_value != value) {
snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG + 3, value);
// Should never overflow; see above.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
}
DelocalizeRadix(buffer);
return buffer;
}
char* DoubleToBuffer(double value, char* buffer) {
// DBL_DIG is 15 for IEEE-754 doubles, which are used on almost all
// platforms these days. Just in case some system exists where DBL_DIG
@ -917,6 +431,17 @@ char* DoubleToBuffer(double value, char* buffer) {
DelocalizeRadix(buffer);
return buffer;
}
} // namespace
std::string SimpleDtoa(double value) {
char buffer[kDoubleToBufferSize];
return DoubleToBuffer(value, buffer);
}
std::string SimpleFtoa(float value) {
char buffer[kFloatToBufferSize];
return FloatToBuffer(value, buffer);
}
static int memcasecmp(const char *s1, const char *s2, size_t len) {
const unsigned char *us1 = reinterpret_cast<const unsigned char *>(s1);
@ -994,72 +519,6 @@ bool safe_strtou64(const std::string &str, uint64_t *value) {
return safe_uint_internal(str, value);
}
char* FloatToBuffer(float value, char* buffer) {
// FLT_DIG is 6 for IEEE-754 floats, which are used on almost all
// platforms these days. Just in case some system exists where FLT_DIG
// is significantly larger -- and risks overflowing our buffer -- we have
// this assert.
static_assert(FLT_DIG < 10, "FLT_DIG_is_too_big");
if (value == std::numeric_limits<double>::infinity()) {
strcpy(buffer, "inf");
return buffer;
} else if (value == -std::numeric_limits<double>::infinity()) {
strcpy(buffer, "-inf");
return buffer;
} else if (std::isnan(value)) {
strcpy(buffer, "nan");
return buffer;
}
int snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG, value);
// The snprintf should never overflow because the buffer is significantly
// larger than the precision we asked for.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
float parsed_value;
if (!safe_strtof(buffer, &parsed_value) || parsed_value != value) {
snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG + 3, value);
// Should never overflow; see above.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
}
DelocalizeRadix(buffer);
return buffer;
}
int GlobalReplaceSubstring(const std::string &substring,
const std::string &replacement, std::string *s) {
GOOGLE_CHECK(s != nullptr);
if (s->empty() || substring.empty())
return 0;
std::string tmp;
int num_replacements = 0;
int pos = 0;
for (absl::string_view::size_type match_pos =
s->find(substring.data(), pos, substring.length());
match_pos != std::string::npos; pos = match_pos + substring.length(),
match_pos = s->find(substring.data(), pos,
substring.length())) {
++num_replacements;
// Append the original content before the match.
tmp.append(*s, pos, match_pos - pos);
// Append the replacement for the match.
tmp.append(replacement.begin(), replacement.end());
}
// Append the content after the last match. If no replacements were made, the
// original string is left untouched.
if (num_replacements > 0) {
tmp.append(*s, pos, s->length() - pos);
s->swap(tmp);
}
return num_replacements;
}
namespace {
int CalculateBase64EscapedLen(int input_len, bool do_padding) {
// Base64 encodes three bytes of input at a time. If the input is not

@ -67,99 +67,6 @@ inline int hex_digit_to_int(char c) {
return x & 0xf;
}
// ----------------------------------------------------------------------
// HasPrefixString()
// Check if a string begins with a given prefix.
// StripPrefixString()
// Given a string and a putative prefix, returns the string minus the
// prefix string if the prefix matches, otherwise the original
// string.
// ----------------------------------------------------------------------
inline bool HasPrefixString(absl::string_view str, absl::string_view prefix) {
return str.size() >= prefix.size() &&
memcmp(str.data(), prefix.data(), prefix.size()) == 0;
}
inline std::string StripPrefixString(const std::string& str,
const std::string& prefix) {
if (HasPrefixString(str, prefix)) {
return str.substr(prefix.size());
} else {
return str;
}
}
// ----------------------------------------------------------------------
// HasSuffixString()
// Return true if str ends in suffix.
// StripSuffixString()
// Given a string and a putative suffix, returns the string minus the
// suffix string if the suffix matches, otherwise the original
// string.
// ----------------------------------------------------------------------
inline bool HasSuffixString(absl::string_view str, absl::string_view suffix) {
return str.size() >= suffix.size() &&
memcmp(str.data() + str.size() - suffix.size(), suffix.data(),
suffix.size()) == 0;
}
inline std::string StripSuffixString(const std::string& str,
const std::string& suffix) {
if (HasSuffixString(str, suffix)) {
return str.substr(0, str.size() - suffix.size());
} else {
return str;
}
}
// ----------------------------------------------------------------------
// ReplaceCharacters
// Replaces any occurrence of the character 'remove' (or the characters
// in 'remove') with the character 'replacewith'.
// Good for keeping html characters or protocol characters (\t) out
// of places where they might cause a problem.
// StripWhitespace
// Removes whitespaces from both ends of the given string.
// ----------------------------------------------------------------------
PROTOBUF_EXPORT void ReplaceCharacters(std::string* s, const char* remove,
char replacewith);
PROTOBUF_EXPORT void StripWhitespace(std::string* s);
// ----------------------------------------------------------------------
// LowerString()
// UpperString()
// ToUpper()
// Convert the characters in "s" to lowercase or uppercase. ASCII-only:
// these functions intentionally ignore locale because they are applied to
// identifiers used in the Protocol Buffer language, not to natural-language
// strings.
// ----------------------------------------------------------------------
inline void LowerString(std::string* s) {
std::string::iterator end = s->end();
for (std::string::iterator i = s->begin(); i != end; ++i) {
// tolower() changes based on locale. We don't want this!
if ('A' <= *i && *i <= 'Z') *i += 'a' - 'A';
}
}
inline void UpperString(std::string* s) {
std::string::iterator end = s->end();
for (std::string::iterator i = s->begin(); i != end; ++i) {
// toupper() changes based on locale. We don't want this!
if ('a' <= *i && *i <= 'z') *i += 'A' - 'a';
}
}
inline void ToUpper(std::string* s) { UpperString(s); }
inline std::string ToUpper(const std::string& s) {
std::string out = s;
UpperString(&out);
return out;
}
// ----------------------------------------------------------------------
// StringReplace()
// Give me a string and two patterns "old" and "new", and I replace
@ -272,135 +179,20 @@ inline bool safe_strtod(absl::string_view str, double* value) {
return safe_strtod(std::string(str), value);
}
// ----------------------------------------------------------------------
// FastIntToBuffer()
// FastHexToBuffer()
// FastHex64ToBuffer()
// FastHex32ToBuffer()
// FastTimeToBuffer()
// These are intended for speed. FastIntToBuffer() assumes the
// integer is non-negative. FastHexToBuffer() puts output in
// hex rather than decimal. FastTimeToBuffer() puts the output
// into RFC822 format.
//
// FastHex64ToBuffer() puts a 64-bit unsigned value in hex-format,
// padded to exactly 16 bytes (plus one byte for '\0')
//
// FastHex32ToBuffer() puts a 32-bit unsigned value in hex-format,
// padded to exactly 8 bytes (plus one byte for '\0')
//
// All functions take the output buffer as an arg.
// They all return a pointer to the beginning of the output,
// which may not be the beginning of the input buffer.
// ----------------------------------------------------------------------
// Suggested buffer size for FastToBuffer functions. Also works with
// DoubleToBuffer() and FloatToBuffer().
static const int kFastToBufferSize = 32;
PROTOBUF_EXPORT char* FastInt32ToBuffer(int32_t i, char* buffer);
PROTOBUF_EXPORT char* FastInt64ToBuffer(int64_t i, char* buffer);
char* FastUInt32ToBuffer(uint32_t i, char* buffer); // inline below
char* FastUInt64ToBuffer(uint64_t i, char* buffer); // inline below
PROTOBUF_EXPORT char* FastHexToBuffer(int i, char* buffer);
PROTOBUF_EXPORT char* FastHex64ToBuffer(uint64_t i, char* buffer);
PROTOBUF_EXPORT char* FastHex32ToBuffer(uint32_t i, char* buffer);
// at least 22 bytes long
inline char* FastIntToBuffer(int i, char* buffer) {
return (sizeof(i) == 4 ?
FastInt32ToBuffer(i, buffer) : FastInt64ToBuffer(i, buffer));
}
inline char* FastUIntToBuffer(unsigned int i, char* buffer) {
return (sizeof(i) == 4 ?
FastUInt32ToBuffer(i, buffer) : FastUInt64ToBuffer(i, buffer));
}
inline char* FastLongToBuffer(long i, char* buffer) {
return (sizeof(i) == 4 ?
FastInt32ToBuffer(i, buffer) : FastInt64ToBuffer(i, buffer));
}
inline char* FastULongToBuffer(unsigned long i, char* buffer) {
return (sizeof(i) == 4 ?
FastUInt32ToBuffer(i, buffer) : FastUInt64ToBuffer(i, buffer));
}
// ----------------------------------------------------------------------
// FastInt32ToBufferLeft()
// FastUInt32ToBufferLeft()
// FastInt64ToBufferLeft()
// FastUInt64ToBufferLeft()
//
// Like the Fast*ToBuffer() functions above, these are intended for speed.
// Unlike the Fast*ToBuffer() functions, however, these functions write
// their output to the beginning of the buffer (hence the name, as the
// output is left-aligned). The caller is responsible for ensuring that
// the buffer has enough space to hold the output.
//
// Returns a pointer to the end of the string (i.e. the null character
// terminating the string).
// ----------------------------------------------------------------------
PROTOBUF_EXPORT char* FastInt32ToBufferLeft(int32_t i, char* buffer);
PROTOBUF_EXPORT char* FastUInt32ToBufferLeft(uint32_t i, char* buffer);
PROTOBUF_EXPORT char* FastInt64ToBufferLeft(int64_t i, char* buffer);
PROTOBUF_EXPORT char* FastUInt64ToBufferLeft(uint64_t i, char* buffer);
// Just define these in terms of the above.
inline char* FastUInt32ToBuffer(uint32_t i, char* buffer) {
FastUInt32ToBufferLeft(i, buffer);
return buffer;
}
inline char* FastUInt64ToBuffer(uint64_t i, char* buffer) {
FastUInt64ToBufferLeft(i, buffer);
return buffer;
}
inline std::string SimpleBtoa(bool value) { return value ? "true" : "false"; }
// ----------------------------------------------------------------------
// SimpleItoa()
// Description: converts an integer to a string.
//
// Return value: string
// ----------------------------------------------------------------------
PROTOBUF_EXPORT std::string SimpleItoa(int i);
PROTOBUF_EXPORT std::string SimpleItoa(unsigned int i);
PROTOBUF_EXPORT std::string SimpleItoa(long i);
PROTOBUF_EXPORT std::string SimpleItoa(unsigned long i);
PROTOBUF_EXPORT std::string SimpleItoa(long long i);
PROTOBUF_EXPORT std::string SimpleItoa(unsigned long long i);
// ----------------------------------------------------------------------
// SimpleDtoa()
// SimpleFtoa()
// DoubleToBuffer()
// FloatToBuffer()
// Description: converts a double or float to a string which, if
// passed to NoLocaleStrtod(), will produce the exact same original double
// (except in case of NaN; all NaNs are considered the same value).
// We try to keep the string short but it's not guaranteed to be as
// short as possible.
//
// DoubleToBuffer() and FloatToBuffer() write the text to the given
// buffer and return it. The buffer must be at least
// kDoubleToBufferSize bytes for doubles and kFloatToBufferSize
// bytes for floats. kFastToBufferSize is also guaranteed to be large
// enough to hold either.
//
// Return value: string
// ----------------------------------------------------------------------
PROTOBUF_EXPORT std::string SimpleDtoa(double value);
PROTOBUF_EXPORT std::string SimpleFtoa(float value);
PROTOBUF_EXPORT char* DoubleToBuffer(double i, char* buffer);
PROTOBUF_EXPORT char* FloatToBuffer(float i, char* buffer);
// In practice, doubles should never need more than 24 bytes and floats
// should never need more than 14 (including null terminators), but we
// overestimate to be safe.
static const int kDoubleToBufferSize = 32;
static const int kFloatToBufferSize = 24;
namespace strings {
using Hex = absl::Hex;
@ -413,17 +205,6 @@ using Hex = absl::Hex;
// ----------------------------------------------------------------------
PROTOBUF_EXPORT std::string ToHex(uint64_t num);
// ----------------------------------------------------------------------
// GlobalReplaceSubstring()
// Replaces all instances of a substring in a string. Does nothing
// if 'substring' is empty. Returns the number of replacements.
//
// NOTE: The string pieces must not overlap s.
// ----------------------------------------------------------------------
PROTOBUF_EXPORT int GlobalReplaceSubstring(const std::string& substring,
const std::string& replacement,
std::string* s);
namespace strings {
// Encode src into dest web-safely with padding.
PROTOBUF_EXPORT void WebSafeBase64EscapeWithPadding(absl::string_view src,
@ -452,15 +233,6 @@ PROTOBUF_EXPORT int EncodeAsUTF8Char(uint32_t code_point, char* output);
// ----------------------------------------------------------------------
PROTOBUF_EXPORT int UTF8FirstLetterNumBytes(const char* src, int len);
namespace strings {
inline bool EndsWith(absl::string_view text, absl::string_view suffix) {
return suffix.empty() ||
(text.size() >= suffix.size() &&
memcmp(text.data() + (text.size() - suffix.size()), suffix.data(),
suffix.size()) == 0);
}
} // namespace strings
namespace internal {
// A locale-independent version of the standard strtod(), which always

@ -74,62 +74,6 @@ TEST(StringUtilityTest, ImmuneToLocales) {
setlocale(LC_NUMERIC, old_locale.c_str());
}
class ReplaceChars
: public ::testing::TestWithParam<
std::tuple<std::string, std::string, const char*, char>> {};
TEST_P(ReplaceChars, ReplacesAllOccurencesOfAnyCharInReplaceWithAReplaceChar) {
std::string expected = std::get<0>(GetParam());
std::string string_to_replace_in = std::get<1>(GetParam());
const char* what_to_replace = std::get<2>(GetParam());
char replacement = std::get<3>(GetParam());
ReplaceCharacters(&string_to_replace_in, what_to_replace, replacement);
ASSERT_EQ(expected, string_to_replace_in);
}
INSTANTIATE_TEST_CASE_P(
Replace, ReplaceChars,
::testing::Values(
std::make_tuple("", "", "", '_'), // empty string should remain empty
std::make_tuple(" ", " ", "", '_'), // no replacement string
std::make_tuple(" ", " ", "_-abcedf",
'*'), // replacement character not in string
std::make_tuple("replace", "Replace", "R",
'r'), // replace one character
std::make_tuple("not_spaces__", "not\nspaces\t ", " \t\r\n",
'_'), // replace some special characters
std::make_tuple("c++", "cxx", "x",
'+'), // same character multiple times
std::make_tuple("qvvvvvng v T", "queueing a T", "aeiou",
'v'))); // replace all voewls
class StripWs
: public ::testing::TestWithParam<std::tuple<std::string, std::string>> {};
TEST_P(StripWs, AlwaysStripsLeadingAndTrailingWhitespace) {
std::string expected = std::get<0>(GetParam());
std::string string_to_strip = std::get<1>(GetParam());
StripWhitespace(&string_to_strip);
ASSERT_EQ(expected, string_to_strip);
}
INSTANTIATE_TEST_CASE_P(
Strip, StripWs,
::testing::Values(
std::make_tuple("", ""), // empty string should remain empty
std::make_tuple("", " "), // only ws should become empty
std::make_tuple("no whitespace",
" no whitespace"), // leading ws removed
std::make_tuple("no whitespace",
"no whitespace "), // trailing ws removed
std::make_tuple("no whitespace",
" no whitespace "), // same nb. of leading and trailing
std::make_tuple(
"no whitespace",
" no whitespace "), // different nb. of leading/trailing
std::make_tuple("no whitespace",
" no whitespace "))); // more trailing than leading
} // anonymous namespace
} // namespace protobuf
} // namespace google

@ -38,6 +38,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "absl/strings/match.h"
#include "absl/strings/str_replace.h"
#include "google/protobuf/io/io_win32.h"
#include "google/protobuf/stubs/strutil.h"
@ -147,7 +148,7 @@ std::string GetTemporaryDirectoryName() {
}
// On Win32, tmpnam() returns a file prefixed with '\', but which is supposed
// to be used in the current working directory. WTF?
if (HasPrefixString(result, "\\")) {
if (absl::StartsWith(result, "\\")) {
result.erase(0, 1);
}
// The Win32 API accepts forward slashes as a path delimiter as long as the

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto
#include <google/protobuf/timestamp.pb.h>
#include "google/protobuf/timestamp.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,13 +12,12 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Timestamp::Timestamp(
::_pbi::ConstantInitialized): _impl_{
@ -27,64 +25,88 @@ PROTOBUF_CONSTEXPR Timestamp::Timestamp(
, /*decltype(_impl_.nanos_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct TimestampDefaultTypeInternal {
PROTOBUF_CONSTEXPR TimestampDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR TimestampDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~TimestampDefaultTypeInternal() {}
union {
Timestamp _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TimestampDefaultTypeInternal _Timestamp_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TimestampDefaultTypeInternal _Timestamp_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _impl_.seconds_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _impl_.nanos_),
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _impl_.seconds_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _impl_.nanos_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Timestamp)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Timestamp)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\037google/protobuf/timestamp.proto\022\017googl"
"e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
"\022\r\n\005nanos\030\002 \001(\005B\205\001\n\023com.google.protobufB"
"\016TimestampProtoP\001Z2google.golang.org/pro"
"tobuf/types/known/timestamppb\370\001\001\242\002\003GPB\252\002"
"\036Google.Protobuf.WellKnownTypesb\006proto3"
};
const char descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\037google/protobuf/timestamp.proto\022\017googl"
"e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
"\022\r\n\005nanos\030\002 \001(\005B\205\001\n\023com.google.protobufB"
"\016TimestampProtoP\001Z2google.golang.org/pro"
"tobuf/types/known/timestamppb\370\001\001\242\002\003GPB\252\002"
"\036Google.Protobuf.WellKnownTypesb\006proto3"
;
static ::absl::once_flag descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2ftimestamp_2eproto = {
false, false, 239, descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto,
false,
false,
239,
descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto,
"google/protobuf/timestamp.proto",
&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto, file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto,
&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto,
file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ftimestamp_2eproto(&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ftimestamp_2eproto(&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto);
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class Timestamp::_Internal {
@ -295,7 +317,6 @@ void Timestamp::InternalSwap(Timestamp* other) {
&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -304,6 +325,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Timestamp >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Timestamp >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,8 +32,12 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -43,19 +48,23 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftimestamp_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftimestamp_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2ftimestamp_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Timestamp;
struct TimestampDefaultTypeInternal;
PROTOBUF_EXPORT extern TimestampDefaultTypeInternal _Timestamp_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Timestamp* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Timestamp>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Timestamp* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Timestamp>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Timestamp final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {
public:
@ -216,12 +225,17 @@ class PROTOBUF_EXPORT Timestamp final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Timestamp
// int64 seconds = 1;
@ -265,14 +279,15 @@ inline void Timestamp::set_nanos(int32_t value) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh

@ -1,10 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto
#include <google/protobuf/type.pb.h>
#include "google/protobuf/type.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
@ -13,13 +12,12 @@
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
// @@protoc_insertion_point(includes)
#include "google/protobuf/port_def.inc"
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_CONSTEXPR Type::Type(
::_pbi::ConstantInitialized): _impl_{
@ -31,14 +29,15 @@ PROTOBUF_CONSTEXPR Type::Type(
, /*decltype(_impl_.syntax_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct TypeDefaultTypeInternal {
PROTOBUF_CONSTEXPR TypeDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR TypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~TypeDefaultTypeInternal() {}
union {
Type _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypeDefaultTypeInternal _Type_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypeDefaultTypeInternal _Type_default_instance_;
PROTOBUF_CONSTEXPR Field::Field(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.options_)*/{}
@ -53,14 +52,15 @@ PROTOBUF_CONSTEXPR Field::Field(
, /*decltype(_impl_.packed_)*/false
, /*decltype(_impl_._cached_size_)*/{}} {}
struct FieldDefaultTypeInternal {
PROTOBUF_CONSTEXPR FieldDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR FieldDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~FieldDefaultTypeInternal() {}
union {
Field _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldDefaultTypeInternal _Field_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldDefaultTypeInternal _Field_default_instance_;
PROTOBUF_CONSTEXPR Enum::Enum(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.enumvalue_)*/{}
@ -70,14 +70,15 @@ PROTOBUF_CONSTEXPR Enum::Enum(
, /*decltype(_impl_.syntax_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct EnumDefaultTypeInternal {
PROTOBUF_CONSTEXPR EnumDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR EnumDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~EnumDefaultTypeInternal() {}
union {
Enum _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumDefaultTypeInternal _Enum_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumDefaultTypeInternal _Enum_default_instance_;
PROTOBUF_CONSTEXPR EnumValue::EnumValue(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.options_)*/{}
@ -85,178 +86,204 @@ PROTOBUF_CONSTEXPR EnumValue::EnumValue(
, /*decltype(_impl_.number_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct EnumValueDefaultTypeInternal {
PROTOBUF_CONSTEXPR EnumValueDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR EnumValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~EnumValueDefaultTypeInternal() {}
union {
EnumValue _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumValueDefaultTypeInternal _EnumValue_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnumValueDefaultTypeInternal _EnumValue_default_instance_;
PROTOBUF_CONSTEXPR Option::Option(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.value_)*/nullptr
, /*decltype(_impl_._cached_size_)*/{}} {}
struct OptionDefaultTypeInternal {
PROTOBUF_CONSTEXPR OptionDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR OptionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~OptionDefaultTypeInternal() {}
union {
Option _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OptionDefaultTypeInternal _Option_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OptionDefaultTypeInternal _Option_default_instance_;
PROTOBUF_NAMESPACE_CLOSE
static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2ftype_2eproto[5];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto[3];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2ftype_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ftype_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.fields_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.oneofs_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.kind_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.cardinality_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.number_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.oneof_index_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.packed_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.json_name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.default_value_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.enumvalue_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.number_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.options_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _impl_.value_),
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_google_2fprotobuf_2ftype_2eproto = nullptr;
const uint32_t TableStruct_google_2fprotobuf_2ftype_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.fields_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.oneofs_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Type, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.kind_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.cardinality_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.number_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.type_url_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.oneof_index_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.packed_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.json_name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Field, _impl_.default_value_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.enumvalue_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.options_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.source_context_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Enum, _impl_.syntax_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.number_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValue, _impl_.options_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Option, _impl_.value_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Type)},
{ 14, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Field)},
{ 32, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Enum)},
{ 45, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumValue)},
{ 56, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Option)},
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Type)},
{ 14, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Field)},
{ 32, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Enum)},
{ 45, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumValue)},
{ 56, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Option)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::PROTOBUF_NAMESPACE_ID::_Type_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Field_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Enum_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_EnumValue_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Option_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Type_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Field_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Enum_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_EnumValue_default_instance_._instance,
&::PROTOBUF_NAMESPACE_ID::_Option_default_instance_._instance,
};
const char descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\032google/protobuf/type.proto\022\017google.pro"
"tobuf\032\031google/protobuf/any.proto\032$google"
"/protobuf/source_context.proto\"\327\001\n\004Type\022"
"\014\n\004name\030\001 \001(\t\022&\n\006fields\030\002 \003(\0132\026.google.p"
"rotobuf.Field\022\016\n\006oneofs\030\003 \003(\t\022(\n\007options"
"\030\004 \003(\0132\027.google.protobuf.Option\0226\n\016sourc"
"e_context\030\005 \001(\0132\036.google.protobuf.Source"
"Context\022\'\n\006syntax\030\006 \001(\0162\027.google.protobu"
"f.Syntax\"\325\005\n\005Field\022)\n\004kind\030\001 \001(\0162\033.googl"
"e.protobuf.Field.Kind\0227\n\013cardinality\030\002 \001"
"(\0162\".google.protobuf.Field.Cardinality\022\016"
"\n\006number\030\003 \001(\005\022\014\n\004name\030\004 \001(\t\022\020\n\010type_url"
"\030\006 \001(\t\022\023\n\013oneof_index\030\007 \001(\005\022\016\n\006packed\030\010 "
"\001(\010\022(\n\007options\030\t \003(\0132\027.google.protobuf.O"
"ption\022\021\n\tjson_name\030\n \001(\t\022\025\n\rdefault_valu"
"e\030\013 \001(\t\"\310\002\n\004Kind\022\020\n\014TYPE_UNKNOWN\020\000\022\017\n\013TY"
"PE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT6"
"4\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014"
"TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE"
"_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n"
"\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TY"
"PE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXE"
"D32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020"
"\021\022\017\n\013TYPE_SINT64\020\022\"t\n\013Cardinality\022\027\n\023CAR"
"DINALITY_UNKNOWN\020\000\022\030\n\024CARDINALITY_OPTION"
"AL\020\001\022\030\n\024CARDINALITY_REQUIRED\020\002\022\030\n\024CARDIN"
"ALITY_REPEATED\020\003\"\316\001\n\004Enum\022\014\n\004name\030\001 \001(\t\022"
"-\n\tenumvalue\030\002 \003(\0132\032.google.protobuf.Enu"
"mValue\022(\n\007options\030\003 \003(\0132\027.google.protobu"
"f.Option\0226\n\016source_context\030\004 \001(\0132\036.googl"
"e.protobuf.SourceContext\022\'\n\006syntax\030\005 \001(\016"
"2\027.google.protobuf.Syntax\"S\n\tEnumValue\022\014"
"\n\004name\030\001 \001(\t\022\016\n\006number\030\002 \001(\005\022(\n\007options\030"
"\003 \003(\0132\027.google.protobuf.Option\";\n\006Option"
"\022\014\n\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.google.p"
"rotobuf.Any*.\n\006Syntax\022\021\n\rSYNTAX_PROTO2\020\000"
"\022\021\n\rSYNTAX_PROTO3\020\001B{\n\023com.google.protob"
"ufB\tTypeProtoP\001Z-google.golang.org/proto"
"buf/types/known/typepb\370\001\001\242\002\003GPB\252\002\036Google"
".Protobuf.WellKnownTypesb\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2ftype_2eproto_deps[2] = {
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
&::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto,
const char descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\032google/protobuf/type.proto\022\017google.pro"
"tobuf\032\031google/protobuf/any.proto\032$google"
"/protobuf/source_context.proto\"\327\001\n\004Type\022"
"\014\n\004name\030\001 \001(\t\022&\n\006fields\030\002 \003(\0132\026.google.p"
"rotobuf.Field\022\016\n\006oneofs\030\003 \003(\t\022(\n\007options"
"\030\004 \003(\0132\027.google.protobuf.Option\0226\n\016sourc"
"e_context\030\005 \001(\0132\036.google.protobuf.Source"
"Context\022\'\n\006syntax\030\006 \001(\0162\027.google.protobu"
"f.Syntax\"\325\005\n\005Field\022)\n\004kind\030\001 \001(\0162\033.googl"
"e.protobuf.Field.Kind\0227\n\013cardinality\030\002 \001"
"(\0162\".google.protobuf.Field.Cardinality\022\016"
"\n\006number\030\003 \001(\005\022\014\n\004name\030\004 \001(\t\022\020\n\010type_url"
"\030\006 \001(\t\022\023\n\013oneof_index\030\007 \001(\005\022\016\n\006packed\030\010 "
"\001(\010\022(\n\007options\030\t \003(\0132\027.google.protobuf.O"
"ption\022\021\n\tjson_name\030\n \001(\t\022\025\n\rdefault_valu"
"e\030\013 \001(\t\"\310\002\n\004Kind\022\020\n\014TYPE_UNKNOWN\020\000\022\017\n\013TY"
"PE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT6"
"4\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014"
"TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE"
"_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n"
"\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TY"
"PE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXE"
"D32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020"
"\021\022\017\n\013TYPE_SINT64\020\022\"t\n\013Cardinality\022\027\n\023CAR"
"DINALITY_UNKNOWN\020\000\022\030\n\024CARDINALITY_OPTION"
"AL\020\001\022\030\n\024CARDINALITY_REQUIRED\020\002\022\030\n\024CARDIN"
"ALITY_REPEATED\020\003\"\316\001\n\004Enum\022\014\n\004name\030\001 \001(\t\022"
"-\n\tenumvalue\030\002 \003(\0132\032.google.protobuf.Enu"
"mValue\022(\n\007options\030\003 \003(\0132\027.google.protobu"
"f.Option\0226\n\016source_context\030\004 \001(\0132\036.googl"
"e.protobuf.SourceContext\022\'\n\006syntax\030\005 \001(\016"
"2\027.google.protobuf.Syntax\"S\n\tEnumValue\022\014"
"\n\004name\030\001 \001(\t\022\016\n\006number\030\002 \001(\005\022(\n\007options\030"
"\003 \003(\0132\027.google.protobuf.Option\";\n\006Option"
"\022\014\n\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.google.p"
"rotobuf.Any*.\n\006Syntax\022\021\n\rSYNTAX_PROTO2\020\000"
"\022\021\n\rSYNTAX_PROTO3\020\001B{\n\023com.google.protob"
"ufB\tTypeProtoP\001Z-google.golang.org/proto"
"buf/types/known/typepb\370\001\001\242\002\003GPB\252\002\036Google"
".Protobuf.WellKnownTypesb\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2ftype_2eproto_deps[2] =
{
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
&::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto,
};
static ::absl::once_flag descriptor_table_google_2fprotobuf_2ftype_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2ftype_2eproto = {
false, false, 1592, descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto,
false,
false,
1592,
descriptor_table_protodef_google_2fprotobuf_2ftype_2eproto,
"google/protobuf/type.proto",
&descriptor_table_google_2fprotobuf_2ftype_2eproto_once, descriptor_table_google_2fprotobuf_2ftype_2eproto_deps, 2, 5,
schemas, file_default_instances, TableStruct_google_2fprotobuf_2ftype_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ftype_2eproto, file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto,
&descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
descriptor_table_google_2fprotobuf_2ftype_2eproto_deps,
2,
5,
schemas,
file_default_instances,
TableStruct_google_2fprotobuf_2ftype_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2ftype_2eproto,
file_level_enum_descriptors_google_2fprotobuf_2ftype_2eproto,
file_level_service_descriptors_google_2fprotobuf_2ftype_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2ftype_2eproto_getter() {
return &descriptor_table_google_2fprotobuf_2ftype_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ftype_2eproto(&descriptor_table_google_2fprotobuf_2ftype_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ftype_2eproto(&descriptor_table_google_2fprotobuf_2ftype_2eproto);
PROTOBUF_NAMESPACE_OPEN
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Field_Kind_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2ftype_2eproto);
@ -352,7 +379,6 @@ bool Syntax_IsValid(int value) {
}
}
// ===================================================================
class Type::_Internal {
@ -744,7 +770,6 @@ void Type::InternalSwap(Type* other) {
&descriptor_table_google_2fprotobuf_2ftype_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftype_2eproto[0]);
}
// ===================================================================
class Field::_Internal {
@ -1269,7 +1294,6 @@ void Field::InternalSwap(Field* other) {
&descriptor_table_google_2fprotobuf_2ftype_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftype_2eproto[1]);
}
// ===================================================================
class Enum::_Internal {
@ -1622,7 +1646,6 @@ void Enum::InternalSwap(Enum* other) {
&descriptor_table_google_2fprotobuf_2ftype_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftype_2eproto[2]);
}
// ===================================================================
class EnumValue::_Internal {
@ -1886,7 +1909,6 @@ void EnumValue::InternalSwap(EnumValue* other) {
&descriptor_table_google_2fprotobuf_2ftype_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftype_2eproto[3]);
}
// ===================================================================
class Option::_Internal {
@ -2137,7 +2159,6 @@ void Option::InternalSwap(Option* other) {
&descriptor_table_google_2fprotobuf_2ftype_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftype_2eproto_once,
file_level_metadata_google_2fprotobuf_2ftype_2eproto[4]);
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
@ -2162,6 +2183,5 @@ Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Option >(Arena* arena) {
return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Option >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

@ -6,19 +6,20 @@
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
@ -31,11 +32,15 @@
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
#include <google/protobuf/any.pb.h>
#include <google/protobuf/source_context.pb.h>
#include "google/protobuf/any.pb.h"
#include "google/protobuf/source_context.pb.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftype_2eproto PROTOBUF_EXPORT
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
@ -46,7 +51,8 @@ PROTOBUF_NAMESPACE_CLOSE
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftype_2eproto {
static const uint32_t offsets[];
};
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftype_2eproto;
PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
descriptor_table_google_2fprotobuf_2ftype_2eproto;
PROTOBUF_NAMESPACE_OPEN
class Enum;
struct EnumDefaultTypeInternal;
@ -63,16 +69,19 @@ PROTOBUF_EXPORT extern OptionDefaultTypeInternal _Option_default_instance_;
class Type;
struct TypeDefaultTypeInternal;
PROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_;
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Enum* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Enum>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValue* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValue>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Field* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Field>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Option* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Option>(Arena*);
template <>
PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Type* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Type>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Enum* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Enum>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValue* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValue>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Field* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Field>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Option* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Option>(Arena*);
template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Type* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Type>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_NAMESPACE_OPEN
enum Field_Kind : int {
Field_Kind_TYPE_UNKNOWN = 0,
Field_Kind_TYPE_DOUBLE = 1,
@ -179,8 +188,12 @@ inline bool Syntax_Parse(
return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Syntax>(
Syntax_descriptor(), name, value);
}
// ===================================================================
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Type final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {
public:
@ -428,8 +441,7 @@ class PROTOBUF_EXPORT Type final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Field final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {
@ -802,8 +814,7 @@ class PROTOBUF_EXPORT Field final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Enum final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {
@ -1026,8 +1037,7 @@ class PROTOBUF_EXPORT Enum final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumValue final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {
@ -1210,8 +1220,7 @@ class PROTOBUF_EXPORT EnumValue final :
};
union { Impl_ _impl_; };
friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto;
};
// -------------------------------------------------------------------
};// -------------------------------------------------------------------
class PROTOBUF_EXPORT Option final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {
@ -1387,12 +1396,17 @@ class PROTOBUF_EXPORT Option final :
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Type
// string name = 1;
@ -2540,21 +2554,13 @@ inline void Option::set_allocated_value(::PROTOBUF_NAMESPACE_ID::Any* value) {
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_CLOSE
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::Field_Kind> : ::std::true_type {};
@ -2578,4 +2584,5 @@ PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ftype_2eproto_2epb_2eh
#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ftype_2eproto_2epb_2eh

@ -43,6 +43,7 @@
#include "absl/strings/str_cat.h"
#include "google/protobuf/util/internal/utility.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "google/protobuf/stubs/mathutil.h"
namespace google {
@ -263,7 +264,7 @@ std::string DataPiece::ValueAsStringOrDefault(
case TYPE_FLOAT:
return FloatAsString(float_);
case TYPE_BOOL:
return SimpleBtoa(bool_);
return bool_ ? "true" : "false";
case TYPE_STRING:
return absl::StrCat("\"", str_, "\"");
case TYPE_BYTES: {
@ -397,7 +398,7 @@ bool DataPiece::DecodeBase64(absl::string_view src, std::string* dest) const {
absl::WebSafeBase64Escape(*dest, &encoded);
// Remove trailing padding '=' characters before comparison.
absl::string_view src_no_padding = absl::string_view(src).substr(
0, HasSuffixString(src, "=") ? src.find_last_not_of('=') + 1
0, absl::EndsWith(src, "=") ? src.find_last_not_of('=') + 1
: src.length());
return encoded == src_no_padding;
}
@ -409,7 +410,7 @@ bool DataPiece::DecodeBase64(absl::string_view src, std::string* dest) const {
std::string encoded;
strings::LegacyBase64EscapeWithoutPadding(*dest, &encoded);
absl::string_view src_no_padding = absl::string_view(src).substr(
0, HasSuffixString(src, "=") ? src.find_last_not_of('=') + 1
0, absl::EndsWith(src, "=") ? src.find_last_not_of('=') + 1
: src.length());
return encoded == src_no_padding;
}

@ -31,7 +31,7 @@
#include "google/protobuf/util/internal/field_mask_utility.h"
#include "absl/status/status.h"
#include "google/protobuf/stubs/strutil.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/util/internal/utility.h"
#include "google/protobuf/stubs/status_macros.h"
@ -56,7 +56,7 @@ std::string AppendPathSegmentToPrefix(absl::string_view prefix,
return std::string(prefix);
}
// If the segment is a map key, appends it to the prefix without the ".".
if (HasPrefixString(segment, "[\"")) {
if (absl::StartsWith(segment, "[\"")) {
return absl::StrCat(prefix, segment);
}
return absl::StrCat(prefix, ".", segment);

@ -43,6 +43,7 @@
#include "absl/status/status.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/util/internal/object_writer.h"
@ -966,15 +967,15 @@ JsonStreamParser::TokenType JsonStreamParser::GetNextTokenType() {
return BEGIN_NUMBER;
}
if (size >= kKeywordTrue.length() &&
HasPrefixString(data_view, kKeywordTrue)) {
absl::StartsWith(data_view, kKeywordTrue)) {
return BEGIN_TRUE;
}
if (size >= kKeywordFalse.length() &&
HasPrefixString(data_view, kKeywordFalse)) {
absl::StartsWith(data_view, kKeywordFalse)) {
return BEGIN_FALSE;
}
if (size >= kKeywordNull.length() &&
HasPrefixString(data_view, kKeywordNull)) {
absl::StartsWith(data_view, kKeywordNull)) {
return BEGIN_NULL;
}
if (*data == '{') return BEGIN_OBJECT;

@ -41,6 +41,7 @@
#include "absl/base/call_once.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/strip.h"
#include "absl/time/time.h"
@ -1048,7 +1049,7 @@ Status ProtoStreamObjectWriter::RenderTimestamp(ProtoStreamObjectWriter* ow,
absl::string_view value(data.str());
int timezone_offset_seconds = 0;
if (HasSuffixString(value, "Z")) {
if (absl::EndsWith(value, "Z")) {
value = value.substr(0, value.size() - 1);
} else {
size_t pos = value.find_last_of("+-");
@ -1123,13 +1124,13 @@ Status ProtoStreamObjectWriter::RenderDuration(ProtoStreamObjectWriter* ow,
absl::string_view value(data.str());
if (!HasSuffixString(value, "s")) {
if (!absl::EndsWith(value, "s")) {
return absl::InvalidArgumentError(
"Illegal duration format; duration must end with 's'");
}
value = value.substr(0, value.size() - 1);
int sign = 1;
if (HasPrefixString(value, "-")) {
if (absl::StartsWith(value, "-")) {
sign = -1;
value = value.substr(1);
}

@ -45,6 +45,7 @@
#include "google/protobuf/stubs/strutil.h"
#include "absl/container/flat_hash_set.h"
#include "absl/strings/ascii.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/util/internal/constants.h"

@ -32,6 +32,7 @@
#include "absl/base/call_once.h"
#include "absl/status/status.h"
#include "absl/strings/ascii.h"
#include "google/protobuf/stubs/bytestream.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -141,7 +142,7 @@ class StatusErrorListener : public converter::ErrorListener {
std::string GetLocString(const converter::LocationTrackerInterface& loc) {
std::string loc_string = loc.ToString();
StripWhitespace(&loc_string);
absl::StripAsciiWhitespace(&loc_string);
if (!loc_string.empty()) {
loc_string = absl::StrCat("(", loc_string, ")");
}

@ -509,6 +509,32 @@ TEST_P(JsonTest, FloatPrecision) {
IsOkAndHolds("[0.99000000953674316,0.87999999523162842]"));
}
TEST_P(JsonTest, FloatMinMaxValue) {
// 3.4028235e38 is FLT_MAX to 8-significant-digits. The final digit (5)
// is rounded up; that means that when parsing this as a 64-bit FP number,
// the value ends up higher than FLT_MAX. We still want to accept it though,
// as a reasonable representation of FLT_MAX.
auto m = ToProto<TestMessage>(R"json(
{
"repeatedFloatValue": [3.4028235e38, -3.4028235e38],
}
)json");
ASSERT_OK(m);
EXPECT_THAT(m->repeated_float_value(), ElementsAre(FLT_MAX, -FLT_MAX));
}
TEST_P(JsonTest, FloatOutOfRange) {
// Check that the slightly-lenient parsing demonstrated in FloatMinMaxValue
// doesn't mean we allow all values. The value being parsed differs only
// in the least significant (represented) digit.
auto m = ToProto<TestMessage>(R"json(
{
"floatValue": 3.4028236e38
}
)json");
EXPECT_THAT(m, StatusIs(absl::StatusCode::kInvalidArgument));
}
TEST_P(JsonTest, ParseLegacySingleRepeatedField) {
auto m = ToProto<TestMessage>(R"json({
"repeatedInt32Value": 1997,

@ -57,6 +57,7 @@
#include "google/protobuf/stubs/strutil.h"
#include "absl/container/fixed_array.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "google/protobuf/stubs/stringprintf.h"
#include "google/protobuf/util/field_comparator.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save