Index: third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_generator.h b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h |
similarity index 52% |
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_generator.h |
copy to third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h |
index 888b8d85e929d3cab46ed24fe25ef24f906457b4..dc6e4dc5a99116084206720471e7bb7d732f8bdf 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_generator.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.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 |
@@ -28,45 +28,59 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Author: kenton@google.com (Kenton Varda) |
-// Based on original Protocol Buffers design by |
-// Sanjay Ghemawat, Jeff Dean, and others. |
-// |
-// Generates Java code for a given .proto file. |
- |
-#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ |
#include <string> |
+ |
#include <google/protobuf/compiler/code_generator.h> |
+#include <google/protobuf/compiler/csharp/csharp_field_base.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
-namespace java { |
+namespace csharp { |
-// CodeGenerator implementation which generates Java code. If you create your |
-// own protocol compiler binary and you want it to support Java output, you |
-// can do so by registering an instance of this CodeGenerator with the |
-// CommandLineInterface in your main() function. |
-class LIBPROTOC_EXPORT JavaGenerator : public CodeGenerator { |
+class MessageFieldGenerator : public FieldGeneratorBase { |
public: |
- JavaGenerator(); |
- ~JavaGenerator(); |
+ MessageFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); |
+ ~MessageFieldGenerator(); |
+ |
+ virtual void GenerateCodecCode(io::Printer* printer); |
+ virtual void GenerateCloningCode(io::Printer* printer); |
+ virtual void GenerateFreezingCode(io::Printer* printer); |
+ virtual void GenerateMembers(io::Printer* printer); |
+ virtual void GenerateMergingCode(io::Printer* printer); |
+ virtual void GenerateParsingCode(io::Printer* printer); |
+ virtual void GenerateSerializationCode(io::Printer* printer); |
+ virtual void GenerateSerializedSizeCode(io::Printer* printer); |
- // implements CodeGenerator ---------------------------------------- |
- bool Generate(const FileDescriptor* file, |
- const string& parameter, |
- GeneratorContext* context, |
- string* error) const; |
+ virtual void WriteHash(io::Printer* printer); |
+ virtual void WriteEquals(io::Printer* printer); |
+ virtual void WriteToString(io::Printer* printer); |
private: |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); |
}; |
-} // namespace java |
+class MessageOneofFieldGenerator : public MessageFieldGenerator { |
+ public: |
+ MessageOneofFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); |
+ ~MessageOneofFieldGenerator(); |
+ |
+ virtual void GenerateCloningCode(io::Printer* printer); |
+ virtual void GenerateMembers(io::Printer* printer); |
+ virtual void WriteToString(io::Printer* printer); |
+ virtual void GenerateParsingCode(io::Printer* printer); |
+ |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator); |
+}; |
+ |
+} // namespace csharp |
} // namespace compiler |
} // namespace protobuf |
- |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ |
+ |
+#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ |
+ |