java_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_JAVA_HELPERS_H__
36 #define GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__
37 
38 #include <string>
43 
44 namespace google {
45 namespace protobuf {
46 namespace compiler {
47 namespace java {
48 
49 // Commonly-used separator comments. Thick is a line of '=', thin is a line
50 // of '-'.
51 extern const char kThickSeparator[];
52 extern const char kThinSeparator[];
53 
54 // If annotation_file is non-empty, prints a javax.annotation.Generated
55 // annotation to the given Printer. annotation_file will be referenced in the
56 // annotation's comments field. delimiter should be the Printer's delimiter
57 // character. annotation_file will be included verbatim into a Java literal
58 // string, so it should not contain quotes or invalid Java escape sequences;
59 // however, these are unlikely to appear in practice, as the value of
60 // annotation_file should be generated from the filename of the source file
61 // being annotated (which in turn must be a Java identifier plus ".java").
62 void PrintGeneratedAnnotation(io::Printer* printer, char delimiter = '$',
63  const std::string& annotation_file = "");
64 
65 // If a GeneratedMessageLite contains non-lite enums, then its verifier
66 // must be instantiated inline, rather than retrieved from the enum class.
67 void PrintEnumVerifierLogic(io::Printer* printer,
69  const std::map<std::string, std::string>& variables,
70  const char* var_name,
71  const char* terminating_string, bool enforce_lite);
72 
73 // Converts a name to camel-case. If cap_first_letter is true, capitalize the
74 // first letter.
76  bool cap_first_letter);
77 // Converts the field's name to camel-case, e.g. "foo_bar_baz" becomes
78 // "fooBarBaz" or "FooBarBaz", respectively.
81 
82 // Similar, but for method names. (Typically, this merely has the effect
83 // of lower-casing the first letter of the name.)
84 std::string UnderscoresToCamelCase(const MethodDescriptor* method);
85 
86 // Same as UnderscoresToCamelCase, but checks for reserved keywords
88 
89 // Similar to UnderscoresToCamelCase, but guarentees that the result is a
90 // complete Java identifier by adding a _ if needed.
92 
93 // Get an identifier that uniquely identifies this type within the file.
94 // This is used to declare static variables related to this type at the
95 // outermost file scope.
97 
98 // Strips ".proto" or ".protodevel" from the end of a filename.
99 std::string StripProto(const std::string& filename);
100 
101 // Gets the unqualified class name for the file. For each .proto file, there
102 // will be one Java class containing all the immutable messages and another
103 // Java class containing all the mutable messages.
104 // TODO(xiaofeng): remove the default value after updating client code.
105 std::string FileClassName(const FileDescriptor* file, bool immutable = true);
106 
107 // Returns the file's Java package name.
109 std::string FileJavaPackage(const FileDescriptor* file, bool immutable);
110 
111 // Returns output directory for the given package name.
113 
114 // TODO(xiaofeng): the following methods are kept for they are exposed
115 // publicly in //net/proto2/compiler/java/public/names.h. They return
116 // immutable names only and should be removed after mutable API is
117 // integrated into google3.
120 std::string ClassName(const ServiceDescriptor* descriptor);
122 
123 // Comma-separate list of option-specified interfaces implemented by the
124 // Message, to follow the "implements" declaration of the Message definition.
126 // Comma-separate list of option-specified interfaces implemented by the
127 // MutableMessage, to follow the "implements" declaration of the MutableMessage
128 // definition.
130 // Comma-separate list of option-specified interfaces implemented by the
131 // Builder, to follow the "implements" declaration of the Builder definition.
133 // Comma-separate list of option-specified interfaces extended by the
134 // MessageOrBuilder, to follow the "extends" declaration of the
135 // MessageOrBuilder definition.
137 
138 // Get the unqualified Java class name for mutable messages. i.e. without
139 // package or outer classnames.
141  return descriptor->name();
142 }
143 
144 // Whether the given descriptor is for one of the core descriptor protos. We
145 // cannot currently use the new runtime with core protos since there is a
146 // bootstrapping problem with obtaining their descriptors.
148  return descriptor->file()->name() == "net/proto2/proto/descriptor.proto" ||
149  descriptor->file()->name() == "google/protobuf/descriptor.proto";
150 }
151 
152 // Returns the stored type string used by the experimental runtime for oneof
153 // fields.
155 
156 
157 // Whether we should generate multiple java files for messages.
159  bool immutable) {
160  return descriptor->options().java_multiple_files();
161 }
162 
163 // Returns true if `descriptor` will be written to its own .java file.
164 // `immutable` should be set to true if we're generating for the immutable API.
165 template <typename Descriptor>
166 bool IsOwnFile(const Descriptor* descriptor, bool immutable) {
167  return descriptor->containing_type() == NULL &&
168  MultipleJavaFiles(descriptor->file(), immutable);
169 }
170 
171 template <>
172 inline bool IsOwnFile(const ServiceDescriptor* descriptor, bool immutable) {
173  return MultipleJavaFiles(descriptor->file(), immutable);
174 }
175 
176 // If `descriptor` describes an object with its own .java file,
177 // returns the name (relative to that .java file) of the file that stores
178 // annotation data for that descriptor. `suffix` is usually empty, but may
179 // (e.g.) be "OrBuilder" for some generated interfaces.
180 template <typename Descriptor>
182  const std::string& suffix) {
183  return descriptor->name() + suffix + ".java.pb.meta";
184 }
185 
186 template <typename Descriptor>
188  Descriptor* descriptor, bool immutable,
189  const std::string& suffix = "") {
190  if (context->options().annotate_code && IsOwnFile(descriptor, immutable)) {
191  PrintGeneratedAnnotation(printer, '$',
192  AnnotationFileName(descriptor, suffix));
193  }
194 }
195 
196 // Get the unqualified name that should be used for a field's field
197 // number constant.
199 
200 // Returns the type of the FieldDescriptor.
201 // This does nothing interesting for the open source release, but is used for
202 // hacks that improve compatibility with version 1 protocol buffers at Google.
204 
205 enum JavaType {
215 };
216 
218 
219 const char* PrimitiveTypeName(JavaType type);
220 
221 // Get the fully-qualified class name for a boxed primitive type, e.g.
222 // "java.lang.Integer" for JAVATYPE_INT. Returns NULL for enum and message
223 // types.
225 
226 // Get the name of the java enum constant representing this type. E.g.,
227 // "INT32" for FieldDescriptor::TYPE_INT32. The enum constant's full
228 // name is "com.google.protobuf.WireFormat.FieldType.INT32".
230 
231 class ClassNameResolver;
232 std::string DefaultValue(const FieldDescriptor* field, bool immutable,
233  ClassNameResolver* name_resolver);
235  ClassNameResolver* name_resolver) {
236  return DefaultValue(field, true, name_resolver);
237 }
240 
241 // Does this message class have descriptor and reflection methods?
243  bool enforce_lite) {
244  return !enforce_lite;
245 }
247  bool enforce_lite) {
248  return !enforce_lite;
249 }
251  bool enforce_lite) {
252  return !enforce_lite;
253 }
254 
255 // Should we generate generic services for this file?
256 inline bool HasGenericServices(const FileDescriptor* file, bool enforce_lite) {
257  return file->service_count() > 0 &&
258  HasDescriptorMethods(file, enforce_lite) &&
259  file->options().java_generic_services();
260 }
261 
262 // Methods for shared bitfields.
263 
264 // Gets the name of the shared bitfield for the given index.
266 
267 // Gets the name of the shared bitfield for the given bit index.
268 // Effectively, GetBitFieldName(bitIndex / 32)
269 std::string GetBitFieldNameForBit(int bitIndex);
270 
271 // Generates the java code for the expression that returns the boolean value
272 // of the bit of the shared bitfields for the given bit index.
273 // Example: "((bitField1_ & 0x04) == 0x04)"
274 std::string GenerateGetBit(int bitIndex);
275 
276 // Generates the java code for the expression that sets the bit of the shared
277 // bitfields for the given bit index.
278 // Example: "bitField1_ = (bitField1_ | 0x04)"
279 std::string GenerateSetBit(int bitIndex);
280 
281 // Generates the java code for the expression that clears the bit of the shared
282 // bitfields for the given bit index.
283 // Example: "bitField1_ = (bitField1_ & ~0x04)"
284 std::string GenerateClearBit(int bitIndex);
285 
286 // Does the same as GenerateGetBit but operates on the bit field on a local
287 // variable. This is used by the builder to copy the value in the builder to
288 // the message.
289 // Example: "((from_bitField1_ & 0x04) == 0x04)"
291 
292 // Does the same as GenerateSetBit but operates on the bit field on a local
293 // variable. This is used by the builder to copy the value in the builder to
294 // the message.
295 // Example: "to_bitField1_ = (to_bitField1_ | 0x04)"
296 std::string GenerateSetBitToLocal(int bitIndex);
297 
298 // Does the same as GenerateGetBit but operates on the bit field on a local
299 // variable. This is used by the parsing constructor to record if a repeated
300 // field is mutable.
301 // Example: "((mutable_bitField1_ & 0x04) == 0x04)"
303 
304 // Does the same as GenerateSetBit but operates on the bit field on a local
305 // variable. This is used by the parsing constructor to record if a repeated
306 // field is mutable.
307 // Example: "mutable_bitField1_ = (mutable_bitField1_ | 0x04)"
309 
310 // Returns whether the JavaType is a reference type.
312 
313 // Returns the capitalized name for calling relative functions in
314 // CodedInputStream
315 const char* GetCapitalizedType(const FieldDescriptor* field, bool immutable);
316 
317 // For encodings with fixed sizes, returns that size in bytes. Otherwise
318 // returns -1.
320 
321 // Comparators used to sort fields in MessageGenerator
323  inline bool operator()(const FieldDescriptor* a,
324  const FieldDescriptor* b) const {
325  return a->number() < b->number();
326  }
327 };
328 
330  bool operator()(const Descriptor::ExtensionRange* a,
331  const Descriptor::ExtensionRange* b) const {
332  return a->start < b->start;
333  }
334 };
335 
336 // Sort the fields of the given Descriptor by number into a new[]'d array
337 // and return it. The caller should delete the returned array.
339 
340 // Does this message class have any packed fields?
341 inline bool HasPackedFields(const Descriptor* descriptor) {
342  for (int i = 0; i < descriptor->field_count(); i++) {
343  if (descriptor->field(i)->is_packed()) {
344  return true;
345  }
346  }
347  return false;
348 }
349 
350 // Check a message type and its sub-message types recursively to see if any of
351 // them has a required field. Return true if a required field is found.
353 
354 // Whether a .proto file supports field presence test for non-message types.
356  return descriptor->syntax() != FileDescriptor::SYNTAX_PROTO3;
357 }
358 
359 // Whether generate classes expose public PARSER instances.
361  // TODO(liujisi): Mark the PARSER private in 3.1.x releases.
362  return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2;
363 }
364 
365 // Whether unknown enum values are kept (i.e., not stored in UnknownFieldSet
366 // but in the message and can be queried using additional getters that return
367 // ints.
369  return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO3;
370 }
371 
372 // Check whether a mesasge has repeated fields.
374 
375 inline bool IsMapEntry(const Descriptor* descriptor) {
376  return descriptor->options().map_entry();
377 }
378 
379 inline bool IsMapField(const FieldDescriptor* descriptor) {
380  return descriptor->is_map();
381 }
382 
383 inline bool IsAnyMessage(const Descriptor* descriptor) {
384  return descriptor->full_name() == "google.protobuf.Any";
385 }
386 
388  return descriptor->name() == "google/protobuf/wrappers.proto";
389 }
390 
391 inline bool CheckUtf8(const FieldDescriptor* descriptor) {
392  return descriptor->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
393  descriptor->file()->options().java_string_check_utf8();
394 }
395 
397  return "V3";
398 }
399 
400 void WriteUInt32ToUtf16CharSequence(uint32 number, std::vector<uint16>* output);
401 
403  std::vector<uint16>* output) {
405 }
406 
407 // Escape a UTF-16 character so it can be embedded in a Java string literal.
409 
410 // Only the lowest two bytes of the return value are used. The lowest byte
411 // is the integer value of a j/c/g/protobuf/FieldType enum. For the other
412 // byte:
413 // bit 0: whether the field is required.
414 // bit 1: whether the field requires UTF-8 validation.
415 // bit 2: whether the field needs isInitialized check.
416 // bit 3: whether the field is a map field with proto2 enum value.
417 // bits 4-7: unused
419 
420 // To get the total number of entries need to be built for experimental runtime
421 // and the first field number that are not in the table part
423  const FieldDescriptor** fields, int count);
424 } // namespace java
425 } // namespace compiler
426 } // namespace protobuf
427 } // namespace google
428 
429 #endif // GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__
google::protobuf::compiler::java::Context::options
const Options & options() const
Definition: java_context.h:82
google::protobuf::FieldDescriptor::Type
Type
Definition: src/google/protobuf/descriptor.h:521
google::protobuf::compiler::java::UnderscoresToCamelCase
std::string UnderscoresToCamelCase(const std::string &input, bool cap_next_letter)
Definition: java_helpers.cc:159
google::protobuf::compiler::java::AnnotationFileName
std::string AnnotationFileName(const Descriptor *descriptor, const std::string &suffix)
Definition: java_helpers.h:181
google::protobuf::compiler::java::ExtensionRangeOrdering::operator()
bool operator()(const Descriptor::ExtensionRange *a, const Descriptor::ExtensionRange *b) const
Definition: java_helpers.h:330
google::protobuf::compiler::java::GenerateClearBit
std::string GenerateClearBit(int bitIndex)
Definition: java_helpers.cc:672
google::protobuf::compiler::java::IsDescriptorProto
bool IsDescriptorProto(const Descriptor *descriptor)
Definition: java_helpers.h:147
google::protobuf::compiler::java::MaybePrintGeneratedAnnotation
void MaybePrintGeneratedAnnotation(Context *context, io::Printer *printer, Descriptor *descriptor, bool immutable, const std::string &suffix="")
Definition: java_helpers.h:187
name
GLuint const GLchar * name
Definition: glcorearb.h:3055
google::protobuf::compiler::java::UnderscoresToCamelCaseCheckReserved
std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor *field)
Definition: java_helpers.cc:212
google::protobuf::FieldDescriptor
Definition: src/google/protobuf/descriptor.h:515
google::protobuf::compiler::java::kThinSeparator
const char kThinSeparator[]
Definition: java_helpers.cc:62
google::protobuf::compiler::java::HasDescriptorMethods
bool HasDescriptorMethods(const Descriptor *descriptor, bool enforce_lite)
Definition: java_helpers.h:242
google::protobuf::compiler::java::FieldOrderingByNumber
Definition: java_helpers.h:322
google::protobuf::compiler::java::IsMapEntry
bool IsMapEntry(const Descriptor *descriptor)
Definition: java_helpers.h:375
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf::compiler::java::GenerateGetBitMutableLocal
std::string GenerateGetBitMutableLocal(int bitIndex)
Definition: java_helpers.cc:689
google::protobuf::compiler::java::IsByteStringWithCustomDefaultValue
bool IsByteStringWithCustomDefaultValue(const FieldDescriptor *field)
Definition: java_helpers.cc:612
field_type
zend_class_entry * field_type
Definition: php/ext/google/protobuf/message.c:2028
google::protobuf::compiler::java::HasRepeatedFields
bool HasRepeatedFields(const Descriptor *descriptor)
Definition: java_helpers.cc:882
google::protobuf::compiler::java::ShortMutableJavaClassName
std::string ShortMutableJavaClassName(const Descriptor *descriptor)
Definition: java_helpers.h:140
google::protobuf::compiler::java::GenerateSetBit
std::string GenerateSetBit(int bitIndex)
Definition: java_helpers.cc:668
google::protobuf::compiler::java::JAVATYPE_ENUM
@ JAVATYPE_ENUM
Definition: java_helpers.h:213
FileDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:125
google::protobuf::compiler::java::Context
Definition: java_context.h:65
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf::compiler::java::MultipleJavaFiles
bool MultipleJavaFiles(const FileDescriptor *descriptor, bool immutable)
Definition: java_helpers.h:158
google::protobuf::compiler::java::ImmutableDefaultValue
std::string ImmutableDefaultValue(const FieldDescriptor *field, ClassNameResolver *name_resolver)
Definition: java_helpers.h:234
google::protobuf::compiler::java::UnderscoresToCapitalizedCamelCase
std::string UnderscoresToCapitalizedCamelCase(const FieldDescriptor *field)
Definition: java_helpers.cc:200
google::protobuf::compiler::java::PrintEnumVerifierLogic
void PrintEnumVerifierLogic(io::Printer *printer, const FieldDescriptor *descriptor, const std::map< std::string, std::string > &variables, const char *var_name, const char *terminating_string, bool enforce_lite)
Definition: java_helpers.cc:138
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf::compiler::java::JAVATYPE_FLOAT
@ JAVATYPE_FLOAT
Definition: java_helpers.h:208
google::protobuf::compiler::java::HasGenericServices
bool HasGenericServices(const FileDescriptor *file, bool enforce_lite)
Definition: java_helpers.h:256
descriptor
Descriptor * descriptor
Definition: php/ext/google/protobuf/protobuf.h:936
google::protobuf::FileDescriptor::SYNTAX_PROTO2
@ SYNTAX_PROTO2
Definition: src/google/protobuf/descriptor.h:1393
google::protobuf::compiler::java::GetExperimentalJavaFieldType
int GetExperimentalJavaFieldType(const FieldDescriptor *field)
Definition: java_helpers.cc:961
google::protobuf::compiler::java::Options::annotate_code
bool annotate_code
Definition: java_options.h:59
Descriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:113
google::protobuf::compiler::java::CamelCaseFieldName
std::string CamelCaseFieldName(const FieldDescriptor *field)
Definition: java_helpers.cc:224
google::protobuf::compiler::java::ExtensionRangeOrdering
Definition: java_helpers.h:329
b
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:3228
google::protobuf::compiler::java::CheckUtf8
bool CheckUtf8(const FieldDescriptor *descriptor)
Definition: java_helpers.h:391
google::protobuf::compiler::java::ExtraMessageOrBuilderInterfaces
std::string ExtraMessageOrBuilderInterfaces(const Descriptor *descriptor)
Definition: java_helpers.cc:305
FieldDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:129
google::protobuf::compiler::java::IsMapField
bool IsMapField(const FieldDescriptor *descriptor)
Definition: java_helpers.h:379
google::protobuf::ServiceDescriptor
Definition: src/google/protobuf/descriptor.h:1152
google::protobuf::compiler::java::IsDefaultValueJavaDefault
bool IsDefaultValueJavaDefault(const FieldDescriptor *field)
Definition: java_helpers.cc:580
google::protobuf::compiler::java::BoxedPrimitiveTypeName
const char * BoxedPrimitiveTypeName(JavaType type)
Definition: java_helpers.cc:400
google::protobuf::compiler::java::JAVATYPE_MESSAGE
@ JAVATYPE_MESSAGE
Definition: java_helpers.h:214
FileOptions::java_generic_services
bool java_generic_services() const
Definition: descriptor.pb.h:9776
google::protobuf::compiler::java::SupportUnknownEnumValue
bool SupportUnknownEnumValue(const FileDescriptor *descriptor)
Definition: java_helpers.h:368
google::protobuf::compiler::java::IsWrappersProtoFile
bool IsWrappersProtoFile(const FileDescriptor *descriptor)
Definition: java_helpers.h:387
google::protobuf::compiler::java::JavaPackageToDir
std::string JavaPackageToDir(std::string package_name)
Definition: java_helpers.cc:265
google::protobuf::compiler::java::kThickSeparator
const char kThickSeparator[]
Definition: java_helpers.cc:60
google::protobuf::compiler::java::PrintGeneratedAnnotation
void PrintGeneratedAnnotation(io::Printer *printer, char delimiter, const std::string &annotation_file)
Definition: java_helpers.cc:124
google::protobuf::compiler::java::ExposePublicParser
bool ExposePublicParser(const FileDescriptor *descriptor)
Definition: java_helpers.h:360
google::protobuf::uint16
uint16_t uint16
Definition: protobuf/src/google/protobuf/stubs/port.h:154
google::protobuf::compiler::java::FileClassName
std::string FileClassName(const FileDescriptor *file, bool immutable)
Definition: java_helpers.cc:240
google::protobuf::compiler::java::GetJavaType
JavaType GetJavaType(const FieldDescriptor *field)
Definition: java_helpers.cc:321
google::protobuf::compiler::java::ExtraMessageInterfaces
std::string ExtraMessageInterfaces(const Descriptor *descriptor)
Definition: java_helpers.cc:292
google::protobuf::compiler::java::IsReferenceType
bool IsReferenceType(JavaType type)
Definition: java_helpers.cc:697
printer.h
google::protobuf::compiler::java::GenerateSetBitToLocal
std::string GenerateSetBitToLocal(int bitIndex)
Definition: java_helpers.cc:685
google::protobuf::compiler::java::GetBitFieldName
std::string GetBitFieldName(int index)
Definition: java_helpers.cc:631
google::protobuf::compiler::java::FixedSize
int FixedSize(FieldDescriptor::Type type)
Definition: java_helpers.cc:776
google::protobuf::FileDescriptor::options
const FileOptions & options() const
EnumDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:137
google::protobuf::compiler::java::FileJavaPackage
std::string FileJavaPackage(const FileDescriptor *file, bool immutable)
Definition: java_helpers.cc:245
google::protobuf::FileDescriptor::SYNTAX_PROTO3
@ SYNTAX_PROTO3
Definition: src/google/protobuf/descriptor.h:1394
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
google::protobuf::compiler::java::WriteUInt32ToUtf16CharSequence
void WriteUInt32ToUtf16CharSequence(uint32 number, std::vector< uint16 > *output)
Definition: java_helpers.cc:906
google::protobuf::io::Printer
Definition: printer.h:181
i
int i
Definition: gmock-matchers_test.cc:764
google::protobuf::compiler::java::GetType
FieldDescriptor::Type GetType(const FieldDescriptor *field)
Definition: java_helpers.cc:317
google::protobuf::compiler::java::SupportFieldPresence
bool SupportFieldPresence(const FileDescriptor *descriptor)
Definition: java_helpers.h:355
java
fields
static const upb_fielddef fields[107]
Definition: ruby/ext/google/protobuf_c/upb.c:7671
type
GLenum type
Definition: glcorearb.h:2695
google::protobuf::compiler::java::ClassName
std::string ClassName(const Descriptor *descriptor)
Definition: java_helpers.cc:271
google::protobuf::compiler::java::FieldTypeName
const char * FieldTypeName(FieldDescriptor::Type field_type)
Definition: java_helpers.cc:445
google::protobuf::compiler::java::GetBitFieldNameForBit
std::string GetBitFieldNameForBit(int bitIndex)
Definition: java_helpers.cc:638
google::protobuf::compiler::java::UniqueFileScopeIdentifier
std::string UniqueFileScopeIdentifier(const Descriptor *descriptor)
Definition: java_helpers.cc:220
google::protobuf::compiler::java::GenerateSetBitMutableLocal
std::string GenerateSetBitMutableLocal(int bitIndex)
Definition: java_helpers.cc:693
google::protobuf::compiler::java::JAVATYPE_INT
@ JAVATYPE_INT
Definition: java_helpers.h:206
google::protobuf::FileDescriptor::service_count
int service_count() const
google::protobuf::Descriptor
Definition: src/google/protobuf/descriptor.h:231
descriptor.h
google::protobuf::compiler::java::GetOneofStoredType
std::string GetOneofStoredType(const FieldDescriptor *field)
Definition: java_helpers.cc:433
google::protobuf::compiler::java::ExtraBuilderInterfaces
std::string ExtraBuilderInterfaces(const Descriptor *descriptor)
Definition: java_helpers.cc:299
google::protobuf::compiler::java::JAVATYPE_BYTES
@ JAVATYPE_BYTES
Definition: java_helpers.h:212
google::protobuf::FileDescriptor
Definition: src/google/protobuf/descriptor.h:1320
google::protobuf::compiler::java::FieldConstantName
std::string FieldConstantName(const FieldDescriptor *field)
Definition: java_helpers.cc:311
google::protobuf::compiler::java::FieldOrderingByNumber::operator()
bool operator()(const FieldDescriptor *a, const FieldDescriptor *b) const
Definition: java_helpers.h:323
google::protobuf::compiler::java::DefaultValue
std::string DefaultValue(const FieldDescriptor *field, bool immutable, ClassNameResolver *name_resolver)
Definition: java_helpers.cc:501
java_context.h
google::protobuf::compiler::java::StripProto
std::string StripProto(const std::string &filename)
Definition: java_helpers.cc:232
google::protobuf::compiler::java::JAVATYPE_LONG
@ JAVATYPE_LONG
Definition: java_helpers.h:207
google::protobuf::compiler::java::GenerateGetBit
std::string GenerateGetBit(int bitIndex)
Definition: java_helpers.cc:664
google::protobuf::compiler::java::HasRequiredFields
bool HasRequiredFields(const Descriptor *type, std::unordered_set< const Descriptor * > *already_seen)
Definition: java_helpers.cc:842
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf::compiler::java::GetCapitalizedType
const char * GetCapitalizedType(const FieldDescriptor *field, bool immutable)
Definition: java_helpers.cc:726
google::protobuf::compiler::java::ClassNameResolver
Definition: java_name_resolver.h:56
descriptor.pb.h
google::protobuf::compiler::java::JAVATYPE_DOUBLE
@ JAVATYPE_DOUBLE
Definition: java_helpers.h:209
google::protobuf::compiler::java::ExtraMutableMessageInterfaces
std::string ExtraMutableMessageInterfaces(const Descriptor *descriptor)
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
google::protobuf::compiler::java::IsOwnFile
bool IsOwnFile(const Descriptor *descriptor, bool immutable)
Definition: java_helpers.h:166
count
GLint GLsizei count
Definition: glcorearb.h:2830
google::protobuf::EnumDescriptor
Definition: src/google/protobuf/descriptor.h:918
google::protobuf::compiler::java::JavaType
JavaType
Definition: java_helpers.h:205
google::protobuf::compiler::java::HasPackedFields
bool HasPackedFields(const Descriptor *descriptor)
Definition: java_helpers.h:341
index
GLuint index
Definition: glcorearb.h:3055
google::protobuf::compiler::java::PrimitiveTypeName
const char * PrimitiveTypeName(JavaType type)
Definition: java_helpers.cc:367
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
google::protobuf::compiler::java::SortFieldsByNumber
const FieldDescriptor ** SortFieldsByNumber(const Descriptor *descriptor)
Definition: java_helpers.cc:826
google::protobuf::compiler::java::GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber
std::pair< int, int > GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber(const FieldDescriptor **fields, int count)
google::protobuf::compiler::java::JAVATYPE_BOOLEAN
@ JAVATYPE_BOOLEAN
Definition: java_helpers.h:210
google::protobuf::compiler::java::WriteIntToUtf16CharSequence
void WriteIntToUtf16CharSequence(int value, std::vector< uint16 > *output)
Definition: java_helpers.h:402
number
double number
Definition: cJSON.h:326
compiler
Definition: plugin.pb.cc:22
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf::compiler::java::GeneratedCodeVersionSuffix
std::string GeneratedCodeVersionSuffix()
Definition: java_helpers.h:396
google::protobuf::method
const Descriptor::ReservedRange const EnumValueDescriptor method
Definition: src/google/protobuf/descriptor.h:1973
google::protobuf::compiler::java::JAVATYPE_STRING
@ JAVATYPE_STRING
Definition: java_helpers.h:211
google::protobuf::compiler::java::GenerateGetBitFromLocal
std::string GenerateGetBitFromLocal(int bitIndex)
Definition: java_helpers.cc:681
google::protobuf::compiler::java::IsAnyMessage
bool IsAnyMessage(const Descriptor *descriptor)
Definition: java_helpers.h:383
google::protobuf::compiler::java::EscapeUtf16ToString
void EscapeUtf16ToString(uint16 code, std::string *output)
Definition: java_helpers.cc:1000


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55