aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/java/java_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/java/java_helpers.h')
-rw-r--r--src/google/protobuf/compiler/java/java_helpers.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h
index dd9b65b8..375bd67d 100644
--- a/src/google/protobuf/compiler/java/java_helpers.h
+++ b/src/google/protobuf/compiler/java/java_helpers.h
@@ -62,6 +62,15 @@ extern const char kThinSeparator[];
void PrintGeneratedAnnotation(io::Printer* printer, char delimiter = '$',
const string& annotation_file = "");
+// If a GeneratedMessageLite contains non-lite enums, then its verifier
+// must be instantiated inline, rather than retrieved from the enum class.
+void PrintEnumVerifierLogic(io::Printer* printer,
+ const FieldDescriptor* descriptor,
+ const std::map<string, string>& variables,
+ const char* var_name,
+ const char* terminating_string,
+ bool enforce_lite);
+
// Converts a name to camel-case. If cap_first_letter is true, capitalize the
// first letter.
string UnderscoresToCamelCase(const string& name, bool cap_first_letter);
@@ -93,7 +102,8 @@ string StripProto(const string& filename);
string FileClassName(const FileDescriptor* file, bool immutable = true);
// Returns the file's Java package name.
-string FileJavaPackage(const FileDescriptor* file, bool immutable = true);
+string FileJavaPackage(const FileDescriptor* file);
+string FileJavaPackage(const FileDescriptor* file, bool immutable);
// Returns output directory for the given package name.
string JavaPackageToDir(string package_name);
@@ -107,7 +117,7 @@ string ToJavaName(const string& full_name,
const FileDescriptor* file);
// TODO(xiaofeng): the following methods are kept for they are exposed
-// publicly in //google/protobuf/compiler/java/names.h. They return
+// publicly in //net/proto2/compiler/java/public/names.h. They return
// immutable names only and should be removed after mutable API is
// integrated into google3.
string ClassName(const Descriptor* descriptor);
@@ -140,7 +150,8 @@ inline string ShortMutableJavaClassName(const Descriptor* descriptor) {
// cannot currently use the new runtime with core protos since there is a
// bootstrapping problem with obtaining their descriptors.
inline bool IsDescriptorProto(const Descriptor* descriptor) {
- return descriptor->file()->name() == "google/protobuf/descriptor.proto";
+ return descriptor->file()->name() == "net/proto2/proto/descriptor.proto" ||
+ descriptor->file()->name() == "google/protobuf/descriptor.proto";
}
@@ -391,10 +402,6 @@ inline string GeneratedCodeVersionSuffix() {
return "V3";
}
-inline bool EnableExperimentalRuntime(Context* context) {
- return false;
-}
-
void WriteUInt32ToUtf16CharSequence(uint32 number, std::vector<uint16>* output);
inline void WriteIntToUtf16CharSequence(int value,
@@ -422,6 +429,6 @@ std::pair<int, int> GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber(
} // namespace java
} // namespace compiler
} // namespace protobuf
-
} // namespace google
+
#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__