protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
35 #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__
36 #define GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__
37 
38 #include <algorithm>
39 #include <cstdint>
40 #include <iterator>
41 #include <map>
42 #include <string>
43 
44 #include <google/protobuf/compiler/cpp/cpp_options.h>
46 #include <google/protobuf/compiler/scc.h>
47 #include <google/protobuf/compiler/code_generator.h>
48 #include <google/protobuf/descriptor.pb.h>
49 #include <google/protobuf/io/printer.h>
50 #include <google/protobuf/descriptor.h>
51 #include <google/protobuf/port.h>
52 #include <google/protobuf/stubs/strutil.h>
53 
54 // Must be included last.
55 #include <google/protobuf/port_def.inc>
56 
57 namespace google {
58 namespace protobuf {
59 namespace compiler {
60 namespace cpp {
61 
62 inline std::string ProtobufNamespace(const Options& /* options */) {
63  return "PROTOBUF_NAMESPACE_ID";
64 }
65 
66 inline std::string MacroPrefix(const Options& /* options */) {
67  return "GOOGLE_PROTOBUF";
68 }
69 
70 inline std::string DeprecatedAttribute(const Options& /* options */,
71  const FieldDescriptor* d) {
72  return d->options().deprecated() ? "PROTOBUF_DEPRECATED " : "";
73 }
74 
75 inline std::string DeprecatedAttribute(const Options& /* options */,
76  const EnumValueDescriptor* d) {
77  return d->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM " : "";
78 }
79 
80 // Commonly-used separator comments. Thick is a line of '=', thin is a line
81 // of '-'.
82 extern const char kThickSeparator[];
83 extern const char kThinSeparator[];
84 
85 void SetCommonVars(const Options& options,
86  std::map<std::string, std::string>* variables);
87 
89  const Options& options,
90  std::map<std::string, std::string>* variables);
91 
92 bool GetBootstrapBasename(const Options& options, const std::string& basename,
93  std::string* bootstrap_basename);
94 bool MaybeBootstrap(const Options& options, GeneratorContext* generator_context,
95  bool bootstrap_flag, std::string* basename);
96 bool IsBootstrapProto(const Options& options, const FileDescriptor* file);
97 
98 // Name space of the proto file. This namespace is such that the string
99 // "<namespace>::some_name" is the correct fully qualified namespace.
100 // This means if the package is empty the namespace is "", and otherwise
101 // the namespace is "::foo::bar::...::baz" without trailing semi-colons.
102 std::string Namespace(const FileDescriptor* d, const Options& options);
103 std::string Namespace(const Descriptor* d, const Options& options);
104 std::string Namespace(const FieldDescriptor* d, const Options& options);
105 std::string Namespace(const EnumDescriptor* d, const Options& options);
106 
107 // Returns true if it's safe to reset "field" to zero.
109 
112 
113 std::string QualifiedClassName(const Descriptor* d, const Options& options);
114 std::string QualifiedClassName(const EnumDescriptor* d, const Options& options);
115 
118 
119 // DEPRECATED just use ClassName or QualifiedClassName, a boolean is very
120 // unreadable at the callsite.
121 // Returns the non-nested type name for the given type. If "qualified" is
122 // true, prefix the type with the full namespace. For example, if you had:
123 // package foo.bar;
124 // message Baz { message Qux {} }
125 // Then the qualified ClassName for Qux would be:
126 // ::foo::bar::Baz_Qux
127 // While the non-qualified version would be:
128 // Baz_Qux
129 inline std::string ClassName(const Descriptor* descriptor, bool qualified) {
130  return qualified ? QualifiedClassName(descriptor, Options())
132 }
133 
134 inline std::string ClassName(const EnumDescriptor* descriptor, bool qualified) {
135  return qualified ? QualifiedClassName(descriptor, Options())
137 }
138 
139 // Returns the extension name prefixed with the class name if nested but without
140 // the package name.
142 
144  const Options& options);
146 
147 // Type name of default instance.
149  const Options& options);
150 
151 // Non-qualified name of the default_instance of this message.
153  const Options& options);
154 
155 // Non-qualified name of the default instance pointer. This is used only for
156 // implicit weak fields, where we need an extra indirection.
158  const Options& options);
159 
160 // Fully qualified name of the default_instance of this message.
162  const Options& options);
163 
164 // Fully qualified name of the default instance pointer.
166  const Options& options);
167 
168 // DescriptorTable variable name.
170  const Options& options);
171 
172 // When declaring symbol externs from another file, this macro will supply the
173 // dllexport needed for the target file, if any.
174 std::string FileDllExport(const FileDescriptor* file, const Options& options);
175 
176 // Name of the base class: google::protobuf::Message or google::protobuf::MessageLite.
178  const Options& options);
179 
180 // Adds an underscore if necessary to prevent conflicting with a keyword.
182 
183 // Get the (unqualified) name that should be used for this field in C++ code.
184 // The name is coerced to lower-case to emulate proto1 behavior. People
185 // should be using lowercase-with-underscores style for proto field names
186 // anyway, so normally this just returns field->name().
188 
189 // Returns an estimate of the compiler's alignment for the field. This
190 // can't guarantee to be correct because the generated code could be compiled on
191 // different systems with different alignment rules. The estimates below assume
192 // 64-bit pointers.
194 
195 // Get the unqualified name that should be used for a field's field
196 // number constant.
198 
199 // Returns the scope where the field was defined (for extensions, this is
200 // different from the message type to which the field applies).
201 inline const Descriptor* FieldScope(const FieldDescriptor* field) {
202  return field->is_extension() ? field->extension_scope()
203  : field->containing_type();
204 }
205 
206 // Returns the fully-qualified type name field->message_type(). Usually this
207 // is just ClassName(field->message_type(), true);
209  const Options& options);
210 
211 // Get the C++ type name for a primitive type (e.g. "double", "::google::protobuf::int32", etc.).
213 std::string PrimitiveTypeName(const Options& options,
215 
216 // Get the declared type name in CamelCase format, as is used e.g. for the
217 // methods of WireFormat. For example, TYPE_INT32 becomes "Int32".
219 
220 // Return the code that evaluates to the number when compiled.
222 
223 // Get code that evaluates to the field's default value.
224 std::string DefaultValue(const Options& options, const FieldDescriptor* field);
225 
226 // Compatibility function for callers outside proto2.
228 
229 // Convert a file name into a valid identifier.
231 
232 // For each .proto file generates a unique name. To prevent collisions of
233 // symbols in the global namespace
235  const Options& options);
236 inline std::string UniqueName(const std::string& name, const FileDescriptor* d,
237  const Options& options) {
238  return UniqueName(name, d->name(), options);
239 }
240 inline std::string UniqueName(const std::string& name, const Descriptor* d,
241  const Options& options) {
242  return UniqueName(name, d->file(), options);
243 }
244 inline std::string UniqueName(const std::string& name, const EnumDescriptor* d,
245  const Options& options) {
246  return UniqueName(name, d->file(), options);
247 }
248 inline std::string UniqueName(const std::string& name,
249  const ServiceDescriptor* d,
250  const Options& options) {
251  return UniqueName(name, d->file(), options);
252 }
253 
254 // Versions for call sites that only support the internal runtime (like proto1
255 // support).
256 inline Options InternalRuntimeOptions() {
257  Options options;
258  options.opensource_runtime = false;
259  return options;
260 }
261 inline std::string UniqueName(const std::string& name,
262  const std::string& filename) {
264 }
265 inline std::string UniqueName(const std::string& name,
266  const FileDescriptor* d) {
267  return UniqueName(name, d->name(), InternalRuntimeOptions());
268 }
269 inline std::string UniqueName(const std::string& name, const Descriptor* d) {
270  return UniqueName(name, d->file(), InternalRuntimeOptions());
271 }
272 inline std::string UniqueName(const std::string& name,
273  const EnumDescriptor* d) {
274  return UniqueName(name, d->file(), InternalRuntimeOptions());
275 }
276 inline std::string UniqueName(const std::string& name,
277  const ServiceDescriptor* d) {
278  return UniqueName(name, d->file(), InternalRuntimeOptions());
279 }
280 
281 // Return the qualified C++ name for a file level symbol.
283  const std::string& name,
284  const Options& options);
285 
286 // Escape C++ trigraphs by escaping question marks to \?
287 std::string EscapeTrigraphs(const std::string& to_escape);
288 
289 // Escaped function name to eliminate naming conflict.
291  const FieldDescriptor* field,
292  const std::string& prefix);
293 
294 // Returns true if generated messages have public unknown fields accessors
295 inline bool PublicUnknownFieldsAccessors(const Descriptor* message) {
296  return message->file()->syntax() != FileDescriptor::SYNTAX_PROTO3;
297 }
298 
299 // Returns the optimize mode for <file>, respecting <options.enforce_lite>.
301  const Options& options);
302 
303 // Determines whether unknown fields will be stored in an UnknownFieldSet or
304 // a string.
305 inline bool UseUnknownFieldSet(const FileDescriptor* file,
306  const Options& options) {
308 }
309 
310 inline bool IsWeak(const FieldDescriptor* field, const Options& options) {
311  if (field->options().weak()) {
312  GOOGLE_CHECK(!options.opensource_runtime);
313  return true;
314  }
315  return false;
316 }
317 
318 bool IsStringInlined(const FieldDescriptor* descriptor, const Options& options);
319 
320 // For a string field, returns the effective ctype. If the actual ctype is
321 // not supported, returns the default of STRING.
323  const Options& options);
324 
325 inline bool IsCord(const FieldDescriptor* field, const Options& options) {
326  return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING &&
328 }
329 
330 inline bool IsString(const FieldDescriptor* field, const Options& options) {
331  return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING &&
333 }
334 
335 inline bool IsStringPiece(const FieldDescriptor* field,
336  const Options& options) {
337  return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING &&
339 }
340 
341 class MessageSCCAnalyzer;
342 
343 // Does the given FileDescriptor use lazy fields?
344 bool HasLazyFields(const FileDescriptor* file, const Options& options,
345  MessageSCCAnalyzer* scc_analyzer);
346 
347 // Is the given field a supported lazy field?
348 bool IsLazy(const FieldDescriptor* field, const Options& options,
349  MessageSCCAnalyzer* scc_analyzer);
350 
352  const Options& options) {
353  return field->options().lazy() && !field->is_repeated() &&
356  !options.opensource_runtime;
357 }
358 
360  const Options& options,
361  MessageSCCAnalyzer* scc_analyzer) {
362  return IsLazy(field, options, scc_analyzer) && !field->options().lazy();
363 }
364 
365 inline bool IsFieldUsed(const FieldDescriptor* /* field */,
366  const Options& /* options */) {
367  return true;
368 }
369 
370 // Returns true if "field" is stripped.
371 inline bool IsFieldStripped(const FieldDescriptor* /*field*/,
372  const Options& /*options*/) {
373  return false;
374 }
375 
376 // Does the file contain any definitions that need extension_set.h?
378 
379 // Does the file have any repeated fields, necessitating the file to include
380 // repeated_field.h? This does not include repeated extensions, since those are
381 // all stored internally in an ExtensionSet, not a separate RepeatedField*.
383 
384 // Does the file have any string/bytes fields with ctype=STRING_PIECE? This
385 // does not include extensions, since ctype is ignored for extensions.
386 bool HasStringPieceFields(const FileDescriptor* file, const Options& options);
387 
388 // Does the file have any string/bytes fields with ctype=CORD? This does not
389 // include extensions, since ctype is ignored for extensions.
390 bool HasCordFields(const FileDescriptor* file, const Options& options);
391 
392 // Does the file have any map fields, necessitating the file to include
393 // map_field_inl.h and map.h.
394 bool HasMapFields(const FileDescriptor* file);
395 
396 // Does this file have any enum type definitions?
398 
399 // Does this file have generated parsing, serialization, and other
400 // standard methods for which reflection-based fallback implementations exist?
401 inline bool HasGeneratedMethods(const FileDescriptor* file,
402  const Options& options) {
404 }
405 
406 // Do message classes in this file have descriptor and reflection methods?
407 inline bool HasDescriptorMethods(const FileDescriptor* file,
408  const Options& options) {
410 }
411 
412 // Should we generate generic services for this file?
413 inline bool HasGenericServices(const FileDescriptor* file,
414  const Options& options) {
415  return file->service_count() > 0 &&
417  file->options().cc_generic_services();
418 }
419 
420 inline bool IsProto2MessageSet(const Descriptor* descriptor,
421  const Options& options) {
422  return !options.opensource_runtime &&
423  options.enforce_mode != EnforceOptimizeMode::kLiteRuntime &&
424  !options.lite_implicit_weak_fields &&
425  descriptor->options().message_set_wire_format() &&
426  descriptor->full_name() == "google.protobuf.bridge.MessageSet";
427 }
428 
429 inline bool IsMapEntryMessage(const Descriptor* descriptor) {
430  return descriptor->options().map_entry();
431 }
432 
433 // Returns true if the field's CPPTYPE is string or message.
435 
437  bool cap_next_letter);
438 
439 inline bool IsProto3(const FileDescriptor* file) {
440  return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
441 }
442 
443 inline bool HasHasbit(const FieldDescriptor* field) {
444  // This predicate includes proto3 message fields only if they have "optional".
445  // Foo submsg1 = 1; // HasHasbit() == false
446  // optional Foo submsg2 = 2; // HasHasbit() == true
447  // This is slightly odd, as adding "optional" to a singular proto3 field does
448  // not change the semantics or API. However whenever any field in a message
449  // has a hasbit, it forces reflection to include hasbit offsets for *all*
450  // fields, even if almost all of them are set to -1 (no hasbit). So to avoid
451  // causing a sudden size regression for ~all proto3 messages, we give proto3
452  // message fields a hasbit only if "optional" is present. If the user is
453  // explicitly writing "optional", it is likely they are writing it on
454  // primitive fields also.
455  return (field->has_optional_keyword() || field->is_required()) &&
456  !field->options().weak();
457 }
458 
459 // Returns true if 'enum' semantics are such that unknown values are preserved
460 // in the enum field itself, rather than going to the UnknownFieldSet.
462  return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3;
463 }
464 
465 inline bool IsCrossFileMessage(const FieldDescriptor* field) {
466  return field->type() == FieldDescriptor::TYPE_MESSAGE &&
467  field->message_type()->file() != field->file();
468 }
469 
471  return "_i_give_permission_to_break_this_code_default_" + FieldName(field) +
472  "_";
473 }
474 
475 bool IsAnyMessage(const FileDescriptor* descriptor, const Options& options);
476 bool IsAnyMessage(const Descriptor* descriptor, const Options& options);
477 
479 
480 inline std::string IncludeGuard(const FileDescriptor* file, bool pb_h,
481  const Options& options) {
482  // If we are generating a .pb.h file and the proto_h option is enabled, then
483  // the .pb.h gets an extra suffix.
484  std::string filename_identifier = FilenameIdentifier(
485  file->name() + (pb_h && options.proto_h ? ".pb.h" : ""));
486 
487  if (IsWellKnownMessage(file)) {
488  // For well-known messages we need third_party/protobuf and net/proto2 to
489  // have distinct include guards, because some source files include both and
490  // both need to be defined (the third_party copies will be in the
491  // google::protobuf_opensource namespace).
492  return MacroPrefix(options) + "_INCLUDED_" + filename_identifier;
493  } else {
494  // Ideally this case would use distinct include guards for opensource and
495  // google3 protos also. (The behavior of "first #included wins" is not
496  // ideal). But unfortunately some legacy code includes both and depends on
497  // the identical include guards to avoid compile errors.
498  //
499  // We should clean this up so that this case can be removed.
500  return "GOOGLE_PROTOBUF_INCLUDED_" + filename_identifier;
501  }
502 }
503 
504 // Returns the OptimizeMode for this file, furthermore it updates a status
505 // bool if has_opt_codesize_extension is non-null. If this status bool is true
506 // it means this file contains an extension that itself is defined as
507 // optimized_for = CODE_SIZE.
509  const Options& options,
510  bool* has_opt_codesize_extension);
512  const Options& options) {
513  return GetOptimizeFor(file, options, nullptr);
514 }
516  const Options& options) {
517  bool has_opt_codesize_extension;
518  if (GetOptimizeFor(file, options, &has_opt_codesize_extension) ==
520  has_opt_codesize_extension) {
521  // If this filedescriptor contains an extension from another file which
522  // is optimized_for = CODE_SIZE. We need to be careful in the ordering so
523  // we eagerly build the descriptors in the dependencies before building
524  // the descriptors of this file.
525  return true;
526  } else {
527  // If we have a generated code based parser we never need eager
528  // initialization of descriptors of our deps.
529  return false;
530  }
531 }
532 
533 // This orders the messages in a .pb.cc as it's outputted by file.cc
535  std::vector<const Descriptor*>* result);
536 inline std::vector<const Descriptor*> FlattenMessagesInFile(
537  const FileDescriptor* file) {
538  std::vector<const Descriptor*> result;
540  return result;
541 }
542 
543 template <typename F>
545  for (int i = 0; i < descriptor->nested_type_count(); i++)
546  ForEachMessage(descriptor->nested_type(i), std::forward<F&&>(func));
547  func(descriptor);
548 }
549 
550 template <typename F>
552  for (int i = 0; i < descriptor->message_type_count(); i++)
553  ForEachMessage(descriptor->message_type(i), std::forward<F&&>(func));
554 }
555 
556 bool HasWeakFields(const Descriptor* desc, const Options& options);
557 bool HasWeakFields(const FileDescriptor* desc, const Options& options);
558 
559 // Returns true if the "required" restriction check should be ignored for the
560 // given field.
562  const Options& options) {
563  // Do not check "required" for lazily verified lazy fields.
565 }
566 
567 struct MessageAnalysis {
568  bool is_recursive = false;
569  bool contains_cord = false;
570  bool contains_extension = false;
571  bool contains_required = false;
572  bool contains_weak = false; // Implicit weak as well.
573 };
574 
575 // This class is used in FileGenerator, to ensure linear instead of
576 // quadratic performance, if we do this per message we would get O(V*(V+E)).
577 // Logically this is just only used in message.cc, but in the header for
578 // FileGenerator to help share it.
579 class PROTOC_EXPORT MessageSCCAnalyzer {
580  public:
582 
583  MessageAnalysis GetSCCAnalysis(const SCC* scc);
584 
586  MessageAnalysis result = GetSCCAnalysis(GetSCC(descriptor));
587  return result.contains_required || result.contains_extension;
588  }
590  MessageAnalysis result = GetSCCAnalysis(GetSCC(descriptor));
591  return result.contains_weak;
592  }
593  const SCC* GetSCC(const Descriptor* descriptor) {
594  return analyzer_.GetSCC(descriptor);
595  }
596 
597  private:
598  struct DepsGenerator {
599  std::vector<const Descriptor*> operator()(const Descriptor* desc) const {
600  std::vector<const Descriptor*> deps;
601  for (int i = 0; i < desc->field_count(); i++) {
602  if (desc->field(i)->message_type()) {
603  deps.push_back(desc->field(i)->message_type());
604  }
605  }
606  return deps;
607  }
608  };
609  SCCAnalyzer<DepsGenerator> analyzer_;
611  std::map<const SCC*, MessageAnalysis> analysis_cache_;
612 };
613 
614 void ListAllFields(const Descriptor* d,
615  std::vector<const FieldDescriptor*>* fields);
616 void ListAllFields(const FileDescriptor* d,
617  std::vector<const FieldDescriptor*>* fields);
618 
619 template <class T>
620 void ForEachField(const Descriptor* d, T&& func) {
621  for (int i = 0; i < d->nested_type_count(); i++) {
622  ForEachField(d->nested_type(i), std::forward<T&&>(func));
623  }
624  for (int i = 0; i < d->extension_count(); i++) {
625  func(d->extension(i));
626  }
627  for (int i = 0; i < d->field_count(); i++) {
628  func(d->field(i));
629  }
630 }
631 
632 template <class T>
633 void ForEachField(const FileDescriptor* d, T&& func) {
634  for (int i = 0; i < d->message_type_count(); i++) {
635  ForEachField(d->message_type(i), std::forward<T&&>(func));
636  }
637  for (int i = 0; i < d->extension_count(); i++) {
638  func(d->extension(i));
639  }
640 }
641 
643  std::vector<const Descriptor*>* types);
644 
645 // Indicates whether we should use implicit weak fields for this file.
647  const Options& options);
648 
649 // Indicates whether to treat this field as implicitly weak.
650 bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options,
651  MessageSCCAnalyzer* scc_analyzer);
652 
653 inline bool HasSimpleBaseClass(const Descriptor* desc, const Options& options) {
654  if (!HasDescriptorMethods(desc->file(), options)) return false;
655  if (desc->extension_range_count() != 0) return false;
656  if (desc->field_count() == 0) return true;
657  // TODO(jorg): Support additional common message types with only one
658  // or two fields
659  return false;
660 }
661 
663  const Options& options) {
664  bool v = false;
665  ForEachMessage(file, [&v, &options](const Descriptor* desc) {
667  });
668  return v;
669 }
670 
672  const Options& options) {
673  if (!HasDescriptorMethods(desc->file(), options)) return "";
674  if (desc->extension_range_count() != 0) return "";
675  if (desc->field_count() == 0) {
676  return "ZeroFieldsBase";
677  }
678  // TODO(jorg): Support additional common message types with only one
679  // or two fields
680  return "";
681 }
682 
683 // Formatter is a functor class which acts as a closure around printer and
684 // the variable map. It's much like printer->Print except it supports both named
685 // variables that are substituted using a key value map and direct arguments. In
686 // the format string $1$, $2$, etc... are substituted for the first, second, ...
687 // direct argument respectively in the format call, it accepts both strings and
688 // integers. The implementation verifies all arguments are used and are "first"
689 // used in order of appearance in the argument list. For example,
690 //
691 // Format("return array[$1$];", 3) -> "return array[3];"
692 // Format("array[$2$] = $1$;", "Bla", 3) -> FATAL error (wrong order)
693 // Format("array[$1$] = $2$;", 3, "Bla") -> "array[3] = Bla;"
694 //
695 // The arguments can be used more than once like
696 //
697 // Format("array[$1$] = $2$; // Index = $1$", 3, "Bla") ->
698 // "array[3] = Bla; // Index = 3"
699 //
700 // If you use more arguments use the following style to help the reader,
701 //
702 // Format("int $1$() {\n"
703 // " array[$2$] = $3$;\n"
704 // " return $4$;"
705 // "}\n",
706 // funname, // 1
707 // idx, // 2
708 // varname, // 3
709 // retval); // 4
710 //
711 // but consider using named variables. Named variables like $foo$, with some
712 // identifier foo, are looked up in the map. One additional feature is that
713 // spaces are accepted between the '$' delimiters, $ foo$ will
714 // substiture to " bar" if foo stands for "bar", but in case it's empty
715 // will substitute to "". Hence, for example,
716 //
717 // Format(vars, "$dllexport $void fun();") -> "void fun();"
718 // "__declspec(export) void fun();"
719 //
720 // which is convenient to prevent double, leading or trailing spaces.
721 class PROTOC_EXPORT Formatter {
722  public:
723  explicit Formatter(io::Printer* printer) : printer_(printer) {}
725  const std::map<std::string, std::string>& vars)
726  : printer_(printer), vars_(vars) {}
727 
728  template <typename T>
729  void Set(const std::string& key, const T& value) {
730  vars_[key] = ToString(value);
731  }
732 
733  void AddMap(const std::map<std::string, std::string>& vars) {
734  for (const auto& keyval : vars) vars_[keyval.first] = keyval.second;
735  }
736 
737  template <typename... Args>
738  void operator()(const char* format, const Args&... args) const {
739  printer_->FormatInternal({ToString(args)...}, vars_, format);
740  }
741 
742  void Indent() const { printer_->Indent(); }
743  void Outdent() const { printer_->Outdent(); }
744  io::Printer* printer() const { return printer_; }
745 
746  class PROTOC_EXPORT ScopedIndenter {
747  public:
748  explicit ScopedIndenter(Formatter* format) : format_(format) {
749  format_->Indent();
750  }
751  ~ScopedIndenter() { format_->Outdent(); }
752 
753  private:
755  };
756 
757  PROTOBUF_NODISCARD ScopedIndenter ScopedIndent() {
758  return ScopedIndenter(this);
759  }
760  template <typename... Args>
761  PROTOBUF_NODISCARD ScopedIndenter ScopedIndent(const char* format,
762  const Args&&... args) {
763  (*this)(format, static_cast<Args&&>(args)...);
764  return ScopedIndenter(this);
765  }
766 
767  class PROTOC_EXPORT SaveState {
768  public:
770  : format_(format), vars_(format->vars_) {}
771  ~SaveState() { format_->vars_.swap(vars_); }
772 
773  private:
774  Formatter* format_;
775  std::map<std::string, std::string> vars_;
776  };
777 
778  private:
780  std::map<std::string, std::string> vars_;
781 
782  // Convenience overloads to accept different types as arguments.
783  static std::string ToString(const std::string& s) { return s; }
784  template <typename I, typename = typename std::enable_if<
786  static std::string ToString(I x) {
787  return StrCat(x);
788  }
789  static std::string ToString(strings::Hex x) { return StrCat(x); }
790  static std::string ToString(const FieldDescriptor* d) { return Payload(d); }
791  static std::string ToString(const Descriptor* d) { return Payload(d); }
792  static std::string ToString(const EnumDescriptor* d) { return Payload(d); }
794  return Payload(d);
795  }
796  static std::string ToString(const OneofDescriptor* d) { return Payload(d); }
797 
798  template <typename Descriptor>
800  std::vector<int> path;
801  descriptor->GetLocationPath(&path);
803  for (int index : path) {
804  annotation.add_path(index);
805  }
806  annotation.set_source_file(descriptor->file()->name());
807  return annotation.SerializeAsString();
808  }
809 };
810 
811 template <class T>
812 void PrintFieldComment(const Formatter& format, const T* field) {
813  // Print the field's (or oneof's) proto-syntax definition as a comment.
814  // We don't want to print group bodies so we cut off after the first
815  // line.
817  options.elide_group_body = true;
818  options.elide_oneof_body = true;
819  std::string def = field->DebugStringWithOptions(options);
820  format("// $1$\n", def.substr(0, def.find_first_of('\n')));
821 }
822 
823 class PROTOC_EXPORT NamespaceOpener {
824  public:
826  : printer_(format.printer()) {}
829  ChangeTo(name);
830  }
831  ~NamespaceOpener() { ChangeTo(""); }
832 
833  void ChangeTo(const std::string& name) {
834  std::vector<std::string> new_stack_ =
835  Split(name, "::", true);
836  size_t len = std::min(name_stack_.size(), new_stack_.size());
837  size_t common_idx = 0;
838  while (common_idx < len) {
839  if (name_stack_[common_idx] != new_stack_[common_idx]) break;
840  common_idx++;
841  }
842  for (auto it = name_stack_.crbegin();
843  it != name_stack_.crend() - common_idx; ++it) {
844  if (*it == "PROTOBUF_NAMESPACE_ID") {
845  printer_->Print("PROTOBUF_NAMESPACE_CLOSE\n");
846  } else {
847  printer_->Print("} // namespace $ns$\n", "ns", *it);
848  }
849  }
850  name_stack_.swap(new_stack_);
851  for (size_t i = common_idx; i < name_stack_.size(); ++i) {
852  if (name_stack_[i] == "PROTOBUF_NAMESPACE_ID") {
853  printer_->Print("PROTOBUF_NAMESPACE_OPEN\n");
854  } else {
855  printer_->Print("namespace $ns$ {\n", "ns", name_stack_[i]);
856  }
857  }
858  }
859 
860  private:
862  std::vector<std::string> name_stack_;
863 };
864 
865 enum class Utf8CheckMode {
866  kStrict = 0, // Parsing will fail if non UTF-8 data is in string fields.
867  kVerify = 1, // Only log an error but parsing will succeed.
868  kNone = 2, // No UTF-8 check.
869 };
870 
872  const Options& options);
873 
875  const Options& options, bool for_parse,
876  const char* parameters,
877  const Formatter& format);
878 
880  const Options& options, bool for_parse,
881  const char* parameters,
882  const Formatter& format);
883 
884 template <typename T>
885 struct FieldRangeImpl {
886  struct Iterator {
887  using iterator_category = std::forward_iterator_tag;
888  using value_type = const FieldDescriptor*;
890 
891  value_type operator*() { return descriptor->field(idx); }
892 
893  friend bool operator==(const Iterator& a, const Iterator& b) {
894  GOOGLE_DCHECK(a.descriptor == b.descriptor);
895  return a.idx == b.idx;
896  }
897  friend bool operator!=(const Iterator& a, const Iterator& b) {
898  return !(a == b);
899  }
900 
902  idx++;
903  return *this;
904  }
905 
906  int idx;
907  const T* descriptor;
908  };
909 
910  Iterator begin() const { return {0, descriptor}; }
911  Iterator end() const { return {descriptor->field_count(), descriptor}; }
912 
913  const T* descriptor;
914 };
915 
916 template <typename T>
917 FieldRangeImpl<T> FieldRange(const T* desc) {
918  return {desc};
919 }
920 
921 struct OneOfRangeImpl {
922  struct Iterator {
923  using iterator_category = std::forward_iterator_tag;
924  using value_type = const OneofDescriptor*;
926 
928 
929  friend bool operator==(const Iterator& a, const Iterator& b) {
930  GOOGLE_DCHECK(a.descriptor == b.descriptor);
931  return a.idx == b.idx;
932  }
933  friend bool operator!=(const Iterator& a, const Iterator& b) {
934  return !(a == b);
935  }
936 
938  idx++;
939  return *this;
940  }
941 
942  int idx;
943  const Descriptor* descriptor;
944  };
945 
946  Iterator begin() const { return {0, descriptor}; }
947  Iterator end() const {
949  }
950 
951  const Descriptor* descriptor;
952 };
953 
954 inline OneOfRangeImpl OneOfRange(const Descriptor* desc) { return {desc}; }
955 
956 PROTOC_EXPORT std::string StripProto(const std::string& filename);
957 
959 
960 bool ShouldVerify(const Descriptor* descriptor, const Options& options,
961  MessageSCCAnalyzer* scc_analyzer);
962 bool ShouldVerify(const FileDescriptor* file, const Options& options,
963  MessageSCCAnalyzer* scc_analyzer);
964 } // namespace cpp
965 } // namespace compiler
966 } // namespace protobuf
967 } // namespace google
968 
969 #include <google/protobuf/port_undef.inc>
970 
971 #endif // GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__
google::protobuf::FieldDescriptor::Type
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:521
google::protobuf::compiler::cpp::IsBootstrapProto
bool IsBootstrapProto(const Options &options, const FileDescriptor *file)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1268
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
deps
static _upb_DefPool_Init * deps[4]
Definition: certs.upbdefs.c:72
google::protobuf::compiler::cpp::EnforceOptimizeMode::kLiteRuntime
@ kLiteRuntime
google::protobuf::compiler::cpp::IsAnyMessage
bool IsAnyMessage(const FileDescriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:959
google::protobuf::compiler::cpp::Formatter::ScopedIndent
PROTOBUF_NODISCARD ScopedIndenter ScopedIndent()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:757
filename
const char * filename
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const EnumValueDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:793
google::protobuf::compiler::cpp::IsProto3
bool IsProto3(const FileDescriptor *file)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:439
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::difference_type
int difference_type
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:763
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::compiler::cpp::HasGeneratedMethods
bool HasGeneratedMethods(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:362
http2_test_server.format
format
Definition: http2_test_server.py:118
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::compiler::cpp::DefaultInstancePtr
std::string DefaultInstancePtr(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:377
google::protobuf::compiler::cpp::IsStringOrMessage
bool IsStringOrMessage(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:927
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::compiler::cpp::NamespaceOpener::NamespaceOpener
NamespaceOpener(const Formatter &format)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:825
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
google::protobuf::compiler::cpp::IsCord
bool IsCord(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:315
google::protobuf::compiler::cpp::HasHasbit
bool HasHasbit(const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:443
google::protobuf::compiler::cpp::Formatter::Formatter
Formatter(io::Printer *printer, const std::map< std::string, std::string > &vars)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:724
google::protobuf::compiler::SCC
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/scc.h:49
google::protobuf::compiler::cpp::FieldName
std::string FieldName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:416
google::protobuf::compiler::cpp::ProtobufNamespace
std::string ProtobufNamespace(const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:60
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const OneofDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:796
google::protobuf::compiler::cpp::MessageAnalysis
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:507
google::protobuf::compiler::cpp::StripProto
std::string StripProto(const std::string &filename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:480
google::protobuf::Descriptor::real_oneof_decl_count
int real_oneof_decl_count() const
grpc_generator::Printer::Print
virtual void Print(const std::map< std::string, std::string > &vars, const char *template_string)=0
google::protobuf::compiler::cpp::NamespaceOpener::NamespaceOpener
NamespaceOpener(const std::string &name, const Formatter &format)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:827
google::protobuf::compiler::cpp::IsFieldUsed
bool IsFieldUsed(const FieldDescriptor *, const Options &)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:365
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(I x)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:786
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf.internal._parameterized.parameters
def parameters(*testcases)
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py:315
google::protobuf::compiler::cpp::Formatter::ScopedIndenter::~ScopedIndenter
~ScopedIndenter()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:751
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:796
google::protobuf::compiler::cpp::Formatter::operator()
void operator()(const char *format, const Args &... args) const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:738
options
double_dict options[]
Definition: capstone_test.c:55
grpc_generator::Printer::Outdent
virtual void Outdent()=0
FileOptions_OptimizeMode
FileOptions_OptimizeMode
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:235
google::protobuf::compiler::cpp::FieldConstantName
std::string FieldConstantName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:457
google::protobuf::compiler::cpp::ForEachMessage
void ForEachMessage(const Descriptor *descriptor, F &&func)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:544
google::protobuf::compiler::cpp::HasEnumDefinitions
static bool HasEnumDefinitions(const Descriptor *message_type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:911
google::protobuf::compiler::cpp::NamespaceOpener
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:706
google::protobuf::compiler::cpp::HasLazyFields
static bool HasLazyFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:771
FileDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:128
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::compiler::cpp::FieldRangeImpl::begin
Iterator begin() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:910
google::protobuf::compiler::cpp::FieldScope
const Descriptor * FieldScope(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:185
google::protobuf::compiler::cpp::Formatter::Indent
void Indent() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:742
google::protobuf::compiler::cpp::Utf8CheckMode::kVerify
@ kVerify
google::protobuf::compiler::cpp::Formatter::AddMap
void AddMap(const std::map< std::string, std::string > &vars)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:733
file
Definition: bloaty/third_party/zlib/examples/gzappend.c:170
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::compiler::cpp::QualifiedClassName
std::string QualifiedClassName(const Descriptor *d, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:320
GeneratedCodeInfo_Annotation::add_path
void add_path(::PROTOBUF_NAMESPACE_ID::int32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:13754
google::protobuf::OneofDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:843
setup.name
name
Definition: setup.py:542
google::protobuf::strings::Hex
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:594
GeneratedCodeInfo_Annotation::set_source_file
void set_source_file(const std::string &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:13793
google::protobuf::compiler::cpp::IsStringInlined
bool IsStringInlined(const FieldDescriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:752
google::protobuf::compiler::cpp::HasPreservingUnknownEnumSemantics
bool HasPreservingUnknownEnumSemantics(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:414
google::protobuf::compiler::cpp::Formatter::SaveState::SaveState
SaveState(Formatter *format)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:769
check_documentation.path
path
Definition: check_documentation.py:57
google::protobuf::compiler::cpp::SuperClassName
std::string SuperClassName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:402
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
google::protobuf::compiler::cpp::EstimateAlignmentSize
int EstimateAlignmentSize(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:433
google::protobuf::compiler::cpp::MessageAnalysis::contains_weak
bool contains_weak
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:572
google::protobuf::compiler::cpp::MakeDefaultName
std::string MakeDefaultName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:439
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::operator!=
friend bool operator!=(const Iterator &a, const Iterator &b)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:897
google::protobuf::compiler::cpp::SetUnknownFieldsVariable
void SetUnknownFieldsVariable(const Descriptor *descriptor, const Options &options, std::map< std::string, std::string > *variables)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:232
google::protobuf::compiler::cpp::UniqueName
string UniqueName(const std::string &name, const std::string &filename, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:712
google::protobuf::compiler::cpp::GetOptimizeFor
FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:473
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1482
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
google::protobuf::compiler::cpp::FieldRangeImpl::descriptor
const T * descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:787
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::idx
int idx
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:780
google::protobuf::compiler::cpp::DeclaredTypeMethodName
const char * DeclaredTypeMethodName(FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:551
FieldOptions::CORD
static constexpr CType CORD
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4723
google::protobuf::compiler::cpp::HasMapFields
static bool HasMapFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:892
google::protobuf::compiler::cpp::FlattenMessagesInFile
void FlattenMessagesInFile(const FileDescriptor *file, std::vector< const Descriptor * > *result)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1103
google::protobuf::compiler::cpp::IsWeak
bool IsWeak(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:300
google::protobuf::compiler::cpp::HasWeakFields
bool HasWeakFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1110
google::protobuf::FileDescriptor::SYNTAX_PROTO3
@ SYNTAX_PROTO3
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1394
google::protobuf::compiler::cpp::GenerateUtf8CheckCodeForString
void GenerateUtf8CheckCodeForString(const FieldDescriptor *field, const Options &options, bool for_parse, const char *parameters, const Formatter &format)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1075
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::compiler::cpp::Formatter::Set
void Set(const std::string &key, const T &value)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:729
google::protobuf::compiler::cpp::FileDllExport
std::string FileDllExport(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:398
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:797
google::protobuf::compiler::cpp::HasStringPieceFields
static bool HasStringPieceFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:832
google::protobuf::compiler::cpp::UsingImplicitWeakFields
bool UsingImplicitWeakFields(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1124
google::protobuf::compiler::cpp::HasSimpleBaseClasses
bool HasSimpleBaseClasses(const FileDescriptor *file, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:662
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:760
google::protobuf::compiler::cpp::ExtensionName
std::string ExtensionName(const FieldDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:347
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
xds_interop_client.int
int
Definition: xds_interop_client.py:113
google::protobuf::compiler::cpp::MessageSCCAnalyzer::HasWeakField
bool HasWeakField(const Descriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:589
hpack_encoder_fixtures::Args
Args({0, 16384})
ToString
std::string ToString(const grpc::string_ref &r)
Definition: string_ref_helper.cc:24
google::protobuf::compiler::cpp::SafeFunctionName
std::string SafeFunctionName(const Descriptor *descriptor, const FieldDescriptor *field, const std::string &prefix)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:733
google::protobuf::compiler::cpp::QualifiedDefaultInstancePtr
std::string QualifiedDefaultInstancePtr(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:388
google::protobuf::compiler::cpp::Formatter::printer
io::Printer * printer() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:744
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::operator!=
friend bool operator!=(const Iterator &a, const Iterator &b)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:933
google::protobuf::compiler::cpp::Formatter::SaveState::~SaveState
~SaveState()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:771
google::protobuf::compiler::cpp::EffectiveStringCType
FieldOptions::CType EffectiveStringCType(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:947
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
google::protobuf::compiler::cpp::SimpleBaseClass
std::string SimpleBaseClass(const Descriptor *desc, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:671
google::protobuf::compiler::cpp::IsLazy
bool IsLazy(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:330
google::protobuf::compiler::cpp::IsLazilyVerifiedLazy
bool IsLazilyVerifiedLazy(const FieldDescriptor *field, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:351
google::protobuf::compiler::cpp::OneOfRangeImpl::descriptor
const Descriptor * descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:823
google::protobuf::compiler::cpp::ResolveKeyword
std::string ResolveKeyword(const string &name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:409
GeneratedCodeInfo_Annotation
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:6853
google::protobuf::compiler::cpp::IsImplicitWeakField
bool IsImplicitWeakField(const FieldDescriptor *field, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1130
google::protobuf::Descriptor::oneof_decl
const OneofDescriptor * oneof_decl(int index) const
google::protobuf::compiler::cpp::QualifiedFileLevelSymbol
std::string QualifiedFileLevelSymbol(const FileDescriptor *file, const std::string &name, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:718
google::protobuf::compiler::cpp::IsMapEntryMessage
bool IsMapEntryMessage(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:398
printer_
grpc_generator::Printer * printer_
Definition: src/compiler/python_generator.cc:86
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const FieldDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:790
def
int def(FILE *source, FILE *dest, int level)
Definition: bloaty/third_party/zlib/examples/zpipe.c:36
grpc_generator::Printer::Indent
virtual void Indent()=0
google::protobuf::compiler::cpp::MessageAnalysis::contains_cord
bool contains_cord
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:509
google::protobuf::compiler::cpp::MessageAnalysis::contains_extension
bool contains_extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:510
google::protobuf::compiler::cpp::FieldMessageTypeName
std::string FieldMessageTypeName(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:473
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf::compiler::cpp::OneOfRange
OneOfRangeImpl OneOfRange(const Descriptor *desc)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:826
FileOptions::LITE_RUNTIME
static constexpr OptimizeMode LITE_RUNTIME
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3831
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:761
google::protobuf::compiler::cpp::DefaultInstanceType
std::string DefaultInstanceType(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:367
google::protobuf::compiler::cpp::NamespaceOpener::ChangeTo
void ChangeTo(const std::string &name)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:833
google::protobuf::compiler::cpp::DescriptorTableName
std::string DescriptorTableName(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:393
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
google::protobuf::compiler::cpp::IsStringPiece
bool IsStringPiece(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:320
FieldOptions::STRING_PIECE
static constexpr CType STRING_PIECE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4725
google::protobuf::compiler::cpp::DefaultValue
std::string DefaultValue(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:622
google::protobuf::compiler::cpp::DeprecatedAttribute
std::string DeprecatedAttribute(const Options &options, bool deprecated)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:68
google::protobuf::compiler::cpp::UseUnknownFieldSet
bool UseUnknownFieldSet(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:295
cpp
Definition: third_party/bloaty/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py:1
google::protobuf::compiler::cpp::SetCommonVars
void SetCommonVars(const Options &options, std::map< std::string, std::string > *variables)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:210
min
#define min(a, b)
Definition: qsort.h:83
google::protobuf::compiler::cpp::NamespaceOpener::~NamespaceOpener
~NamespaceOpener()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:831
google::protobuf::compiler::cpp::Options
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h:52
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
google::protobuf::compiler::cpp::GetBootstrapBasename
bool GetBootstrapBasename(const Options &options, const std::string &basename, std::string *bootstrap_basename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1244
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::operator==
friend bool operator==(const Iterator &a, const Iterator &b)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:929
google::protobuf::compiler::cpp::IncludeGuard
std::string IncludeGuard(const FileDescriptor *file, bool pb_h, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:449
google::protobuf::compiler::cpp::InternalRuntimeOptions
Options InternalRuntimeOptions()
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:246
google::protobuf::compiler::cpp::QualifiedDefaultInstanceName
std::string QualifiedDefaultInstanceName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:382
EnumDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:143
google::protobuf::compiler::cpp::MessageAnalysis::contains_required
bool contains_required
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:511
google::protobuf::DebugStringOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:160
messages_pb2.Payload
Payload
Definition: messages_pb2.py:583
google::protobuf::compiler::cpp::IsCrossFileMessage
bool IsCrossFileMessage(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:430
google::protobuf::compiler::cpp::HasDescriptorMethods
bool HasDescriptorMethods(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:368
google::protobuf::compiler::cpp::ListAllFields
void ListAllFields(const Descriptor *d, std::vector< const FieldDescriptor * > *fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1204
F
#define F(b, c, d)
Definition: md4.c:112
google::protobuf::compiler::cpp::Utf8CheckMode::kNone
@ kNone
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const std::string &s)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:783
google::protobuf::compiler::cpp::MessageSCCAnalyzer::MessageSCCAnalyzer
MessageSCCAnalyzer(const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:581
FieldOptions::STRING
static constexpr CType STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4721
google::protobuf::compiler::cpp::OneOfRangeImpl::end
Iterator end() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:947
google::protobuf::io::Printer
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/printer.h:181
google::protobuf::compiler::cpp::NeedsEagerDescriptorAssignment
bool NeedsEagerDescriptorAssignment(const FileDescriptor *file, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:515
google::protobuf::compiler::cpp::FieldRange
FieldRangeImpl< T > FieldRange(const T *desc)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:791
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::operator++
Iterator & operator++()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:901
google::protobuf::compiler::cpp::HasCordFields
static bool HasCordFields(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:855
value
const char * value
Definition: hpack_parser_table.cc:165
google::protobuf::compiler::cpp::kThickSeparator
const char kThickSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:273
google::protobuf::compiler::cpp::Int32ToString
std::string Int32ToString(int number)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:599
google::protobuf::compiler::cpp::MessageSCCAnalyzer::HasRequiredFields
bool HasRequiredFields(const Descriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:585
google::protobuf::compiler::cpp::PrintFieldComment
void PrintFieldComment(const Formatter &format, const T *field)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:812
google::protobuf::compiler::cpp::Namespace
std::string Namespace(const std::string &package)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:337
google::protobuf::compiler::cpp::FieldRangeImpl::end
Iterator end() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:911
google::protobuf::compiler::cpp::IsWellKnownMessage
bool IsWellKnownMessage(const FileDescriptor *file)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:968
google::protobuf::compiler::cpp::Utf8CheckMode
Utf8CheckMode
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:986
google::protobuf::compiler::cpp::MessageSCCAnalyzer::DepsGenerator::operator()
std::vector< const Descriptor * > operator()(const Descriptor *desc) const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:599
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
func
const EVP_CIPHER *(* func)(void)
Definition: cipher_extra.c:73
key
const char * key
Definition: hpack_parser_table.cc:164
I
#define I(b, c, d)
Definition: md5.c:120
options_
DebugStringOptions options_
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:2390
google::protobuf::compiler::cpp::HasGenericServices
bool HasGenericServices(const FileDescriptor *file, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:374
google::protobuf::compiler::cpp::Formatter::ScopedIndent
PROTOBUF_NODISCARD ScopedIndenter ScopedIndent(const char *format, const Args &&... args)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:761
FieldOptions_CType
FieldOptions_CType
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:259
google::protobuf::compiler::cpp::EnableMessageOwnedArena
bool EnableMessageOwnedArena(const Descriptor *desc)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1489
google::protobuf::compiler::cpp::MessageSCCAnalyzer::GetSCC
const SCC * GetSCC(const Descriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:593
google::protobuf::compiler::cpp::IsString
bool IsString(const FieldDescriptor *field, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:330
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::operator*
value_type operator*()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:927
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::descriptor
const T * descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:781
google::protobuf::compiler::cpp::FilenameIdentifier
std::string FilenameIdentifier(const std::string &filename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:698
google::protobuf::compiler::cpp::MessageSCCAnalyzer
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:519
google::protobuf::compiler::cpp::DefaultInstanceName
std::string DefaultInstanceName(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:372
google::protobuf::compiler::cpp::IsFieldStripped
bool IsFieldStripped(const FieldDescriptor *, const Options &)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:371
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
google::protobuf::compiler::cpp::Formatter::Payload
static std::string Payload(const Descriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:799
google::protobuf::compiler::cpp::GenerateUtf8CheckCodeForCord
void GenerateUtf8CheckCodeForCord(const FieldDescriptor *field, const Options &options, bool for_parse, const char *parameters, const Formatter &format)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1084
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
google::protobuf::compiler::cpp::HasExtensionsOrExtendableMessage
static bool HasExtensionsOrExtendableMessage(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:873
google::protobuf::compiler::cpp::EscapeTrigraphs
std::string EscapeTrigraphs(const std::string &to_escape)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:728
google::protobuf::compiler::cpp::Formatter::ScopedIndenter::format_
Formatter * format_
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:754
google::protobuf::compiler::cpp::Formatter::ScopedIndenter
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:746
google::protobuf::compiler::cpp::QualifiedExtensionName
std::string QualifiedExtensionName(const FieldDescriptor *d, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:353
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
google::protobuf::EnumValueDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1075
google::protobuf::Split
std::vector< string > Split(const string &full, const char *delim, bool skip_empty=true)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.h:235
google::protobuf::compiler::cpp::ClassName
std::string ClassName(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:302
google::protobuf::compiler::cpp::HasRepeatedFields
static bool HasRepeatedFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:807
GOOGLE_CHECK
#define GOOGLE_CHECK(EXPRESSION)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:153
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::FieldDescriptor::TYPE_MESSAGE
@ TYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:536
google::protobuf::compiler::cpp::HasSimpleBaseClass
bool HasSimpleBaseClass(const Descriptor *desc, const Options &options)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:653
desc
#define desc
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:338
google::protobuf::compiler::SCCAnalyzer
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/scc.h:63
types
static const struct nv types[]
Definition: adig.c:83
google::protobuf::compiler::cpp::UnderscoresToCamelCase
std::string UnderscoresToCamelCase(const std::string &input, bool cap_next_letter)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:247
google::protobuf::compiler::cpp::PrimitiveTypeName
const char * PrimitiveTypeName(FieldDescriptor::CppType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:488
google::protobuf::compiler::cpp::ForEachField
void ForEachField(const Descriptor *d, T &&func)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:566
absl::inlined_vector_internal::Iterator
Pointer< A > Iterator
Definition: abseil-cpp/absl/container/internal/inlined_vector.h:64
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::compiler::cpp::ListAllTypesForServices
void ListAllTypesForServices(const FileDescriptor *fd, std::vector< const Descriptor * > *types)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1232
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::compiler::cpp::ShouldIgnoreRequiredFieldCheck
static bool ShouldIgnoreRequiredFieldCheck(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:501
google::protobuf::compiler::cpp::GetUtf8CheckMode
static Utf8CheckMode GetUtf8CheckMode(const FieldDescriptor *field, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1003
google::protobuf::compiler::cpp::Formatter::Outdent
void Outdent() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:743
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const EnumDescriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:792
google::protobuf::compiler::cpp::PublicUnknownFieldsAccessors
bool PublicUnknownFieldsAccessors(const Descriptor *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:285
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(const Descriptor *d)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:791
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::difference_type
int difference_type
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:799
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::idx
int idx
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:816
make_curve25519_tables.d
int d
Definition: make_curve25519_tables.py:53
google::protobuf::compiler::cpp::MacroPrefix
std::string MacroPrefix(const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:64
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf::compiler::cpp::Formatter::ScopedIndenter::ScopedIndenter
ScopedIndenter(Formatter *format)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:748
google::protobuf::compiler::cpp::IsProto2MessageSet
bool IsProto2MessageSet(const Descriptor *descriptor, const Options &options)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:381
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
google::protobuf::compiler::cpp::Utf8CheckMode::kStrict
@ kStrict
google::protobuf::compiler::cpp::OneOfRangeImpl::begin
Iterator begin() const
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:946
google::protobuf::compiler::cpp::kThinSeparator
const char kThinSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:275
file::name
char * name
Definition: bloaty/third_party/zlib/examples/gzappend.c:176
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::operator*
value_type operator*()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:891
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
enum_descriptor
VALUE enum_descriptor(VALUE self)
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/message.c:794
google::protobuf::compiler::GeneratorContext
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/code_generator.h:119
google::protobuf::compiler::cpp::ShouldVerify
bool ShouldVerify(const Descriptor *descriptor, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:954
google::protobuf::compiler::cpp::Formatter::ToString
static std::string ToString(strings::Hex x)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:789
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
grpc::protobuf::ServiceDescriptor
GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:88
google::protobuf::compiler::cpp::CanInitializeByZeroing
bool CanInitializeByZeroing(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:278
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::operator++
Iterator & operator++()
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:937
google::protobuf::FieldDescriptor::CppType
CppType
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:553
compiler
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc:21
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::compiler::cpp::Formatter::Formatter
Formatter(io::Printer *printer)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:723
google::protobuf::compiler::cpp::MessageAnalysis::is_recursive
bool is_recursive
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:508
google::protobuf::compiler::cpp::Formatter
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:637
FileOptions::CODE_SIZE
static constexpr OptimizeMode CODE_SIZE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3829
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::compiler::cpp::OneOfRangeImpl::Iterator::descriptor
const Descriptor * descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:817
google::protobuf::compiler::cpp::FieldRangeImpl::Iterator::operator==
friend bool operator==(const Iterator &a, const Iterator &b)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:893
framework.helpers.highlighter.Formatter
Formatter
Definition: highlighter.py:53
google::protobuf::compiler::cpp::MaybeBootstrap
bool MaybeBootstrap(const Options &options, GeneratorContext *generator_context, bool bootstrap_flag, std::string *basename)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc:1273
cpp_names.h
google::protobuf::compiler::cpp::IsEagerlyVerifiedLazy
bool IsEagerlyVerifiedLazy(const FieldDescriptor *field, const Options &options, MessageSCCAnalyzer *scc_analyzer)
Definition: protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h:359


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:05