Index: third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.h |
similarity index 63% |
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.h |
copy to third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.h |
index 4f7532f4492daf2b71b903e3a15ef50bfefb004c..4d9b4bd7ca0ba1ba975b7ea5cc030aee91283926 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.h |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -33,8 +33,8 @@ |
// Based on original Protocol Buffers design by |
// Sanjay Ghemawat, Jeff Dean, and others. |
-#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ |
#include <map> |
#include <string> |
@@ -42,25 +42,34 @@ |
namespace google { |
namespace protobuf { |
+ namespace compiler { |
+ namespace java { |
+ class Context; // context.h |
+ class ClassNameResolver; // name_resolver.h |
+ } |
+ } |
+} |
+ |
+namespace protobuf { |
namespace compiler { |
namespace java { |
-class StringFieldGenerator : public FieldGenerator { |
+class ImmutableStringFieldLiteGenerator : public ImmutableFieldLiteGenerator { |
public: |
- explicit StringFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~StringFieldGenerator(); |
+ explicit ImmutableStringFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableStringFieldLiteGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldLiteGenerator ------------------------------------ |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
void GenerateMembers(io::Printer* printer) const; |
void GenerateBuilderMembers(io::Printer* printer) const; |
void GenerateInitializationCode(io::Printer* printer) const; |
- void GenerateBuilderClearCode(io::Printer* printer) const; |
void GenerateMergingCode(io::Printer* printer) const; |
- void GenerateBuildingCode(io::Printer* printer) const; |
+ void GenerateDynamicMethodMakeImmutableCode(io::Printer* printer) const; |
void GenerateParsingCode(io::Printer* printer) const; |
void GenerateParsingDoneCode(io::Printer* printer) const; |
void GenerateSerializationCode(io::Printer* printer) const; |
@@ -68,41 +77,65 @@ class StringFieldGenerator : public FieldGenerator { |
void GenerateFieldBuilderInitializationCode(io::Printer* printer) const; |
void GenerateEqualsCode(io::Printer* printer) const; |
void GenerateHashCode(io::Printer* printer) const; |
+ |
string GetBoxedType() const; |
- private: |
+ protected: |
const FieldDescriptor* descriptor_; |
map<string, string> variables_; |
const int messageBitIndex_; |
const int builderBitIndex_; |
+ Context* context_; |
+ ClassNameResolver* name_resolver_; |
+ |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringFieldLiteGenerator); |
+}; |
+ |
+class ImmutableStringOneofFieldLiteGenerator |
+ : public ImmutableStringFieldLiteGenerator { |
+ public: |
+ ImmutableStringOneofFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableStringOneofFieldLiteGenerator(); |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); |
+ private: |
+ void GenerateMembers(io::Printer* printer) const; |
+ void GenerateBuilderMembers(io::Printer* printer) const; |
+ void GenerateMergingCode(io::Printer* printer) const; |
+ void GenerateParsingCode(io::Printer* printer) const; |
+ void GenerateSerializationCode(io::Printer* printer) const; |
+ void GenerateSerializedSizeCode(io::Printer* printer) const; |
+ |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringOneofFieldLiteGenerator); |
}; |
-class RepeatedStringFieldGenerator : public FieldGenerator { |
+class RepeatedImmutableStringFieldLiteGenerator |
+ : public ImmutableFieldLiteGenerator { |
public: |
- explicit RepeatedStringFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~RepeatedStringFieldGenerator(); |
+ explicit RepeatedImmutableStringFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~RepeatedImmutableStringFieldLiteGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldLiteGenerator ------------------------------------ |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
void GenerateMembers(io::Printer* printer) const; |
void GenerateBuilderMembers(io::Printer* printer) const; |
void GenerateInitializationCode(io::Printer* printer) const; |
- void GenerateBuilderClearCode(io::Printer* printer) const; |
void GenerateMergingCode(io::Printer* printer) const; |
- void GenerateBuildingCode(io::Printer* printer) const; |
+ void GenerateDynamicMethodMakeImmutableCode(io::Printer* printer) const; |
void GenerateParsingCode(io::Printer* printer) const; |
- void GenerateParsingCodeFromPacked(io::Printer* printer) const; |
void GenerateParsingDoneCode(io::Printer* printer) const; |
void GenerateSerializationCode(io::Printer* printer) const; |
void GenerateSerializedSizeCode(io::Printer* printer) const; |
void GenerateFieldBuilderInitializationCode(io::Printer* printer) const; |
void GenerateEqualsCode(io::Printer* printer) const; |
void GenerateHashCode(io::Printer* printer) const; |
+ |
string GetBoxedType() const; |
private: |
@@ -110,8 +143,10 @@ class RepeatedStringFieldGenerator : public FieldGenerator { |
map<string, string> variables_; |
const int messageBitIndex_; |
const int builderBitIndex_; |
+ Context* context_; |
+ ClassNameResolver* name_resolver_; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedStringFieldGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableStringFieldLiteGenerator); |
}; |
} // namespace java |
@@ -119,4 +154,4 @@ class RepeatedStringFieldGenerator : public FieldGenerator { |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ |