| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 MessageFieldGenerator::~MessageFieldGenerator() { | 59 MessageFieldGenerator::~MessageFieldGenerator() { |
| 60 | 60 |
| 61 } | 61 } |
| 62 | 62 |
| 63 void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { | 63 void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { |
| 64 printer->Print( | 64 printer->Print( |
| 65 variables_, | 65 variables_, |
| 66 "private $type_name$ $name$_;\n"); | 66 "private $type_name$ $name$_;\n"); |
| 67 WritePropertyDocComment(printer, descriptor_); | 67 WritePropertyDocComment(printer, descriptor_); |
| 68 AddDeprecatedFlag(printer); | 68 AddPublicMemberAttributes(printer); |
| 69 printer->Print( | 69 printer->Print( |
| 70 variables_, | 70 variables_, |
| 71 "$access_level$ $type_name$ $property_name$ {\n" | 71 "$access_level$ $type_name$ $property_name$ {\n" |
| 72 " get { return $name$_; }\n" | 72 " get { return $name$_; }\n" |
| 73 " set {\n" | 73 " set {\n" |
| 74 " $name$_ = value;\n" | 74 " $name$_ = value;\n" |
| 75 " }\n" | 75 " }\n" |
| 76 "}\n"); | 76 "}\n"); |
| 77 } | 77 } |
| 78 | 78 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 : MessageFieldGenerator(descriptor, fieldOrdinal, options) { | 152 : MessageFieldGenerator(descriptor, fieldOrdinal, options) { |
| 153 SetCommonOneofFieldVariables(&variables_); | 153 SetCommonOneofFieldVariables(&variables_); |
| 154 } | 154 } |
| 155 | 155 |
| 156 MessageOneofFieldGenerator::~MessageOneofFieldGenerator() { | 156 MessageOneofFieldGenerator::~MessageOneofFieldGenerator() { |
| 157 | 157 |
| 158 } | 158 } |
| 159 | 159 |
| 160 void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { | 160 void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { |
| 161 WritePropertyDocComment(printer, descriptor_); | 161 WritePropertyDocComment(printer, descriptor_); |
| 162 AddDeprecatedFlag(printer); | 162 AddPublicMemberAttributes(printer); |
| 163 printer->Print( | 163 printer->Print( |
| 164 variables_, | 164 variables_, |
| 165 "$access_level$ $type_name$ $property_name$ {\n" | 165 "$access_level$ $type_name$ $property_name$ {\n" |
| 166 " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : null; }
\n" | 166 " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : null; }
\n" |
| 167 " set {\n" | 167 " set {\n" |
| 168 " $oneof_name$_ = value;\n" | 168 " $oneof_name$_ = value;\n" |
| 169 " $oneof_name$Case_ = value == null ? $oneof_property_name$OneofCase.None
: $oneof_property_name$OneofCase.$property_name$;\n" | 169 " $oneof_name$Case_ = value == null ? $oneof_property_name$OneofCase.None
: $oneof_property_name$OneofCase.$property_name$;\n" |
| 170 " }\n" | 170 " }\n" |
| 171 "}\n"); | 171 "}\n"); |
| 172 } | 172 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 191 | 191 |
| 192 void MessageOneofFieldGenerator::GenerateCloningCode(io::Printer* printer) { | 192 void MessageOneofFieldGenerator::GenerateCloningCode(io::Printer* printer) { |
| 193 printer->Print(variables_, | 193 printer->Print(variables_, |
| 194 "$property_name$ = other.$property_name$.Clone();\n"); | 194 "$property_name$ = other.$property_name$.Clone();\n"); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace csharp | 197 } // namespace csharp |
| 198 } // namespace compiler | 198 } // namespace compiler |
| 199 } // namespace protobuf | 199 } // namespace protobuf |
| 200 } // namespace google | 200 } // namespace google |
| OLD | NEW |