diff options
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc b/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc index 735d164a..1fda7ddf 100644 --- a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc +++ b/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc @@ -39,25 +39,32 @@ #include <google/protobuf/compiler/csharp/csharp_source_generator_base.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> +#include <google/protobuf/compiler/csharp/csharp_names.h> +#include <google/protobuf/compiler/csharp/csharp_options.h> namespace google { namespace protobuf { namespace compiler { namespace csharp { -SourceGeneratorBase::SourceGeneratorBase(const FileDescriptor* descriptor) - : descriptor_(descriptor) { +SourceGeneratorBase::SourceGeneratorBase(const FileDescriptor* descriptor, + const Options *options) + : descriptor_(descriptor), options_(options) { } SourceGeneratorBase::~SourceGeneratorBase() { } void SourceGeneratorBase::WriteGeneratedCodeAttributes(io::Printer* printer) { - // This hook can be used to reintroduce generated code attributes in the future. + printer->Print("[global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n"); } std::string SourceGeneratorBase::class_access_level() { - return IsDescriptorProto(descriptor_) ? "internal" : "public"; // public_classes is always on. + return (IsDescriptorProto(descriptor_) || this->options()->internal_access) ? "internal" : "public"; +} + +const Options* SourceGeneratorBase::options() { + return this->options_; } } // namespace csharp |