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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 " $classname$OrBuilder {\n", | 99 " $classname$OrBuilder {\n", |
100 "classname", name_resolver_->GetImmutableClassName(descriptor_), | 100 "classname", name_resolver_->GetImmutableClassName(descriptor_), |
101 "extra_interfaces", ExtraBuilderInterfaces(descriptor_), | 101 "extra_interfaces", ExtraBuilderInterfaces(descriptor_), |
102 "extendible", | 102 "extendible", |
103 descriptor_->extension_range_count() > 0 ? "Extendable" : ""); | 103 descriptor_->extension_range_count() > 0 ? "Extendable" : ""); |
104 printer->Indent(); | 104 printer->Indent(); |
105 | 105 |
106 GenerateCommonBuilderMethods(printer); | 106 GenerateCommonBuilderMethods(printer); |
107 | 107 |
108 // oneof | 108 // oneof |
109 std::map<string, string> vars; | 109 map<string, string> vars; |
110 for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { | 110 for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { |
111 vars["oneof_name"] = context_->GetOneofGeneratorInfo( | 111 vars["oneof_name"] = context_->GetOneofGeneratorInfo( |
112 descriptor_->oneof_decl(i))->name; | 112 descriptor_->oneof_decl(i))->name; |
113 vars["oneof_capitalized_name"] = context_->GetOneofGeneratorInfo( | 113 vars["oneof_capitalized_name"] = context_->GetOneofGeneratorInfo( |
114 descriptor_->oneof_decl(i))->capitalized_name; | 114 descriptor_->oneof_decl(i))->capitalized_name; |
115 vars["oneof_index"] = SimpleItoa(descriptor_->oneof_decl(i)->index()); | 115 vars["oneof_index"] = SimpleItoa(descriptor_->oneof_decl(i)->index()); |
116 | 116 |
117 // oneofCase() and clearOneof() | 117 // oneofCase() and clearOneof() |
118 printer->Print(vars, | 118 printer->Print(vars, |
119 "public $oneof_capitalized_name$Case\n" | 119 "public $oneof_capitalized_name$Case\n" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 "\n", | 170 "\n", |
171 "classname", name_resolver_->GetImmutableClassName(descriptor_)); | 171 "classname", name_resolver_->GetImmutableClassName(descriptor_)); |
172 } | 172 } |
173 | 173 |
174 // =================================================================== | 174 // =================================================================== |
175 | 175 |
176 } // namespace java | 176 } // namespace java |
177 } // namespace compiler | 177 } // namespace compiler |
178 } // namespace protobuf | 178 } // namespace protobuf |
179 } // namespace google | 179 } // namespace google |
OLD | NEW |