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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { | 59 void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { |
60 printer->Print( | 60 printer->Print( |
61 variables_, | 61 variables_, |
62 "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\
n" | 62 "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\
n" |
63 " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n"
); | 63 " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n"
); |
64 printer->Print(variables_, | 64 printer->Print(variables_, |
65 "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::Repeate
dField<$type_name$>();\n"); | 65 "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::Repeate
dField<$type_name$>();\n"); |
66 WritePropertyDocComment(printer, descriptor_); | 66 WritePropertyDocComment(printer, descriptor_); |
67 AddDeprecatedFlag(printer); | 67 AddPublicMemberAttributes(printer); |
68 printer->Print( | 68 printer->Print( |
69 variables_, | 69 variables_, |
70 "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" | 70 "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" |
71 " get { return $name$_; }\n" | 71 " get { return $name$_; }\n" |
72 "}\n"); | 72 "}\n"); |
73 } | 73 } |
74 | 74 |
75 void RepeatedEnumFieldGenerator::GenerateMergingCode(io::Printer* printer) { | 75 void RepeatedEnumFieldGenerator::GenerateMergingCode(io::Printer* printer) { |
76 printer->Print( | 76 printer->Print( |
77 variables_, | 77 variables_, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 "$name$_ = other.$name$_.Clone();\n"); | 118 "$name$_ = other.$name$_.Clone();\n"); |
119 } | 119 } |
120 | 120 |
121 void RepeatedEnumFieldGenerator::GenerateFreezingCode(io::Printer* printer) { | 121 void RepeatedEnumFieldGenerator::GenerateFreezingCode(io::Printer* printer) { |
122 } | 122 } |
123 | 123 |
124 } // namespace csharp | 124 } // namespace csharp |
125 } // namespace compiler | 125 } // namespace compiler |
126 } // namespace protobuf | 126 } // namespace protobuf |
127 } // namespace google | 127 } // namespace google |
OLD | NEW |