Index: third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h |
similarity index 59% |
copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h |
copy to third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h |
index a90e84d7b1d9974d3e0cbf730ddb41a0b1886d26..083641578a6d4e0e1354ca499611ed1337438aef 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_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,50 @@ |
// (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 C++ code for a given .proto file. |
- |
-#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ |
#include <string> |
+ |
#include <google/protobuf/compiler/code_generator.h> |
+#include <google/protobuf/compiler/csharp/csharp_primitive_field.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
-namespace cpp { |
+namespace csharp { |
+ |
+class EnumFieldGenerator : public PrimitiveFieldGenerator { |
+ public: |
+ EnumFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); |
+ ~EnumFieldGenerator(); |
+ |
+ virtual void GenerateCodecCode(io::Printer* printer); |
+ virtual void GenerateParsingCode(io::Printer* printer); |
+ virtual void GenerateSerializationCode(io::Printer* printer); |
+ virtual void GenerateSerializedSizeCode(io::Printer* printer); |
-// CodeGenerator implementation which generates a C++ source file and |
-// header. If you create your own protocol compiler binary and you want |
-// it to support C++ output, you can do so by registering an instance of this |
-// CodeGenerator with the CommandLineInterface in your main() function. |
-class LIBPROTOC_EXPORT CppGenerator : public CodeGenerator { |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); |
+}; |
+ |
+class EnumOneofFieldGenerator : public PrimitiveOneofFieldGenerator { |
public: |
- CppGenerator(); |
- ~CppGenerator(); |
+ EnumOneofFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); |
+ ~EnumOneofFieldGenerator(); |
- // implements CodeGenerator ---------------------------------------- |
- bool Generate(const FileDescriptor* file, |
- const string& parameter, |
- GeneratorContext* generator_context, |
- string* error) const; |
+ virtual void GenerateParsingCode(io::Printer* printer); |
+ virtual void GenerateSerializationCode(io::Printer* printer); |
+ virtual void GenerateSerializedSizeCode(io::Printer* printer); |
private: |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumOneofFieldGenerator); |
}; |
-} // namespace cpp |
+} // namespace csharp |
} // namespace compiler |
} // namespace protobuf |
- |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
+ |
+#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ |
+ |