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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 optional double optional_double_field = 5; | 153 optional double optional_double_field = 5; |
154 required double required_double_field = 6; | 154 required double required_double_field = 6; |
155 repeated double repeated_double_field = 7; | 155 repeated double repeated_double_field = 7; |
156 optional double default_double_field = 8 [default = 2.0]; | 156 optional double default_double_field = 8 [default = 2.0]; |
157 } | 157 } |
158 | 158 |
159 message TestClone { | 159 message TestClone { |
160 optional string str = 1; | 160 optional string str = 1; |
161 optional Simple1 simple1 = 3; | 161 optional Simple1 simple1 = 3; |
162 repeated Simple1 simple2 = 5; | 162 repeated Simple1 simple2 = 5; |
163 optional bytes bytes_field = 6; | |
164 optional string unused = 7; | 163 optional string unused = 7; |
165 extensions 10 to max; | 164 extensions 10 to max; |
166 } | 165 } |
167 | 166 |
168 message CloneExtension { | 167 message CloneExtension { |
169 extend TestClone { | 168 extend TestClone { |
170 optional CloneExtension ext_field = 100; | 169 optional CloneExtension ext_field = 100; |
171 } | 170 } |
172 optional string ext = 2; | 171 optional string ext = 2; |
173 } | 172 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 int32 aone = 10 [default = 1234]; | 221 int32 aone = 10 [default = 1234]; |
223 int32 atwo = 11; | 222 int32 atwo = 11; |
224 } | 223 } |
225 | 224 |
226 oneof default_oneof_b { | 225 oneof default_oneof_b { |
227 int32 bone = 12; | 226 int32 bone = 12; |
228 int32 btwo = 13 [default = 1234]; | 227 int32 btwo = 13 [default = 1234]; |
229 } | 228 } |
230 } | 229 } |
231 | 230 |
232 message TestEndsWithBytes { | |
233 optional int32 value = 1; | |
234 optional bytes data = 2; | |
235 } | |
236 | |
237 | |
238 message TestMapFieldsNoBinary { | |
239 | |
240 map<string, string> map_string_string = 1; | |
241 map<string, int32> map_string_int32 = 2; | |
242 map<string, int64> map_string_int64 = 3; | |
243 map<string, bool> map_string_bool = 4; | |
244 map<string, double> map_string_double = 5; | |
245 map<string, MapValueEnumNoBinary> map_string_enum = 6; | |
246 map<string, MapValueMessageNoBinary> map_string_msg = 7; | |
247 | |
248 map<int32, string> map_int32_string = 8; | |
249 map<int64, string> map_int64_string = 9; | |
250 map<bool, string> map_bool_string = 10; | |
251 | |
252 optional TestMapFieldsNoBinary test_map_fields = 11; | |
253 map<string, TestMapFieldsNoBinary> map_string_testmapfields = 12; | |
254 } | |
255 | |
256 enum MapValueEnumNoBinary { | |
257 MAP_VALUE_FOO_NOBINARY = 0; | |
258 MAP_VALUE_BAR_NOBINARY = 1; | |
259 MAP_VALUE_BAZ_NOBINARY = 2; | |
260 } | |
261 | |
262 message MapValueMessageNoBinary { | |
263 | |
264 optional int32 foo = 1; | |
265 } | |
266 | |
267 message Deeply { | |
268 message Nested { | |
269 message Message { | |
270 optional int32 count = 1; | |
271 } | |
272 } | |
273 } | |
OLD | NEW |