aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp/csharp_message_field.cc
diff options
context:
space:
mode:
authorGaurav Vaish <gaurav.vaish@gmail.com>2016-03-24 11:44:56 -0700
committerGaurav Vaish <gaurav.vaish@gmail.com>2016-04-05 09:47:11 -0700
commit74d8b0bebc233331b1861354908f7fa0fde9d769 (patch)
treee99c0b9bb481959a32e32f5b2c539d7edaa74aae /src/google/protobuf/compiler/csharp/csharp_message_field.cc
parent452e2b2c5c607ab5d63cd813793f1aa960f19d1c (diff)
downloadprotobuf-74d8b0bebc233331b1861354908f7fa0fde9d769.tar.gz
protobuf-74d8b0bebc233331b1861354908f7fa0fde9d769.tar.bz2
protobuf-74d8b0bebc233331b1861354908f7fa0fde9d769.zip
Added access_level for types
* `csharp_options`: Added `Options` to encapsulate generator options. Supported options for now - file_extension, base_namespace * `{Blah}Generator`: Now accept `Options*` as parameter to constructor * `csharp_generator.cc`: Parse and populate options * `Makefile.am`: Added `csharp_options.h` * `extract_includes.bat.in`: Added `csharp_options.h` Refactoring code to two commits. This is the first commit
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_message_field.cc')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message_field.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_message_field.cc
index f81f769b..174bf995 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message_field.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message_field.cc
@@ -41,6 +41,7 @@
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_message_field.h>
+#include <google/protobuf/compiler/csharp/csharp_options.h>
namespace google {
namespace protobuf {
@@ -48,8 +49,8 @@ namespace compiler {
namespace csharp {
MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor,
- int fieldOrdinal)
- : FieldGeneratorBase(descriptor, fieldOrdinal) {
+ int fieldOrdinal, const Options *options)
+ : FieldGeneratorBase(descriptor, fieldOrdinal, options) {
variables_["has_property_check"] = name() + "_ != null";
variables_["has_not_property_check"] = name() + "_ == null";
}
@@ -144,8 +145,8 @@ void MessageFieldGenerator::GenerateCodecCode(io::Printer* printer) {
}
MessageOneofFieldGenerator::MessageOneofFieldGenerator(const FieldDescriptor* descriptor,
- int fieldOrdinal)
- : MessageFieldGenerator(descriptor, fieldOrdinal) {
+ int fieldOrdinal, const Options *options)
+ : MessageFieldGenerator(descriptor, fieldOrdinal, options) {
SetCommonOneofFieldVariables(&variables_);
}