1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008 Google Inc. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 9 #define GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 10 11 #include <string> 12 13 #include "google/protobuf/compiler/code_generator.h" 14 #include "google/protobuf/io/printer.h" 15 16 namespace google { 17 namespace protobuf { 18 namespace compiler { 19 namespace csharp { 20 21 struct Options; 22 23 class SourceGeneratorBase { 24 protected: 25 SourceGeneratorBase(const Options* options); 26 virtual ~SourceGeneratorBase(); 27 28 SourceGeneratorBase(const SourceGeneratorBase&) = delete; 29 SourceGeneratorBase& operator=(const SourceGeneratorBase&) = delete; 30 31 std::string class_access_level(); 32 const Options* options(); 33 34 // Write any attributes used to decorate generated function members (methods and properties). 35 // Should not be used to decorate types. 36 void WriteGeneratedCodeAttributes(io::Printer* printer); 37 38 private: 39 const Options *options_; 40 }; 41 42 } // namespace csharp 43 } // namespace compiler 44 } // namespace protobuf 45 } // namespace google 46 47 #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 48 49