Index: third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_names.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_names.h |
similarity index 64% |
copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h |
copy to third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_names.h |
index a90e84d7b1d9974d3e0cbf730ddb41a0b1886d26..ccd2e720895962c4f091cacfc52be91b26542a22 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_names.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 |
@@ -32,41 +32,51 @@ |
// Based on original Protocol Buffers design by |
// Sanjay Ghemawat, Jeff Dean, and others. |
// |
-// Generates C++ code for a given .proto file. |
+// Provides a mechanism for mapping a descriptor to the |
+// fully-qualified name of the corresponding C# class. |
-#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ |
#include <string> |
-#include <google/protobuf/compiler/code_generator.h> |
namespace google { |
namespace protobuf { |
+ |
+class Descriptor; |
+class EnumDescriptor; |
+class FileDescriptor; |
+class ServiceDescriptor; |
+ |
namespace compiler { |
-namespace cpp { |
+namespace csharp { |
-// 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 { |
- public: |
- CppGenerator(); |
- ~CppGenerator(); |
+// Requires: |
+// descriptor != NULL |
+// |
+// Returns: |
+// The namespace to use for given file descriptor. |
+string GetFileNamespace(const FileDescriptor* descriptor); |
- // implements CodeGenerator ---------------------------------------- |
- bool Generate(const FileDescriptor* file, |
- const string& parameter, |
- GeneratorContext* generator_context, |
- string* error) const; |
+// Requires: |
+// descriptor != NULL |
+// |
+// Returns: |
+// The fully-qualified C# class name. |
+string GetClassName(const Descriptor* descriptor); |
- private: |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); |
-}; |
+// Requires: |
+// descriptor != NULL |
+// |
+// Returns: |
+// The fully-qualified name of the C# class that provides |
+// access to the file descriptor. Proto compiler generates |
+// such class for each .proto file processed. |
+std::string GetUmbrellaClassName(const FileDescriptor* descriptor); |
-} // namespace cpp |
+} // namespace csharp |
} // namespace compiler |
} // namespace protobuf |
- |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ |
+ |
+#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ |