diff options
Diffstat (limited to 'src/google/protobuf/compiler/java/java_helpers.h')
-rw-r--r-- | src/google/protobuf/compiler/java/java_helpers.h | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h index 829ec3d7..bd565ced 100644 --- a/src/google/protobuf/compiler/java/java_helpers.h +++ b/src/google/protobuf/compiler/java/java_helpers.h @@ -74,6 +74,10 @@ string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field); // of lower-casing the first letter of the name.) string UnderscoresToCamelCase(const MethodDescriptor* method); +// Similar to UnderscoresToCamelCase, but guarentees that the result is a +// complete Java identifier by adding a _ if needed. +string CamelCaseFieldName(const FieldDescriptor* field); + // Get an identifier that uniquely identifies this type within the file. // This is used to declare static variables related to this type at the // outermost file scope. @@ -242,15 +246,6 @@ inline bool HasGenericServices(const FileDescriptor *file, bool enforce_lite) { file->options().java_generic_services(); } -inline bool IsLazy(const FieldDescriptor* descriptor, bool enforce_lite) { - // Currently, the proto-lite version supports lazy field. - // TODO(niwasaki): Support lazy fields also for other proto runtimes. - if (HasDescriptorMethods(descriptor->file(), enforce_lite)) { - return false; - } - return descriptor->options().lazy(); -} - // Methods for shared bitfields. // Gets the name of the shared bitfield for the given index. @@ -372,10 +367,6 @@ inline bool IsMapField(const FieldDescriptor* descriptor) { return descriptor->is_map(); } -inline bool PreserveUnknownFields(const Descriptor* descriptor) { - return descriptor->file()->syntax() != FileDescriptor::SYNTAX_PROTO3; -} - inline bool IsAnyMessage(const Descriptor* descriptor) { return descriptor->full_name() == "google.protobuf.Any"; } |