protobufjs 4.1.2 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/.travis.yml +3 -1
  2. package/README.md +147 -25
  3. package/bin/pbjs +2 -2
  4. package/bower.json +3 -3
  5. package/cli/pbjs/targets/amd.js +1 -1
  6. package/cli/pbjs/targets/json.js +9 -1
  7. package/cli/pbjs/targets/proto.js +48 -24
  8. package/cli/pbjs/util.js +1 -1
  9. package/cli/pbjs.js +9 -2
  10. package/dist/README.md +10 -10
  11. package/dist/{ProtoBuf-light.js → protobuf-light.js} +207 -152
  12. package/dist/protobuf-light.min.js +94 -0
  13. package/dist/protobuf-light.min.js.gz +0 -0
  14. package/dist/protobuf-light.min.map +8 -0
  15. package/dist/{ProtoBuf.js → protobuf.js} +265 -175
  16. package/dist/protobuf.min.js +116 -0
  17. package/dist/protobuf.min.js.gz +0 -0
  18. package/dist/protobuf.min.map +8 -0
  19. package/docs/ProtoBuf.Builder.Message.html +1473 -967
  20. package/docs/ProtoBuf.Builder.Service.html +266 -197
  21. package/docs/ProtoBuf.Builder.html +758 -542
  22. package/docs/ProtoBuf.DotProto.Parser.html +223 -161
  23. package/docs/ProtoBuf.DotProto.Tokenizer.html +344 -248
  24. package/docs/ProtoBuf.DotProto.html +20 -12
  25. package/docs/ProtoBuf.Element.html +554 -554
  26. package/docs/ProtoBuf.Map.html +158 -123
  27. package/docs/ProtoBuf.Reflect.Element.html +286 -143
  28. package/docs/ProtoBuf.Reflect.Enum.Value.html +329 -228
  29. package/docs/ProtoBuf.Reflect.Enum.html +757 -537
  30. package/docs/ProtoBuf.Reflect.Extension.html +73 -56
  31. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +1013 -740
  32. package/docs/ProtoBuf.Reflect.Message.Field.html +926 -649
  33. package/docs/ProtoBuf.Reflect.Message.OneOf.html +327 -245
  34. package/docs/ProtoBuf.Reflect.Message.html +919 -652
  35. package/docs/ProtoBuf.Reflect.Namespace.html +648 -447
  36. package/docs/ProtoBuf.Reflect.Service.Method.html +363 -251
  37. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +545 -397
  38. package/docs/ProtoBuf.Reflect.Service.html +721 -511
  39. package/docs/ProtoBuf.Reflect.T.html +268 -197
  40. package/docs/ProtoBuf.Reflect.html +20 -12
  41. package/docs/ProtoBuf.Util.html +169 -118
  42. package/docs/ProtoBuf.html +840 -628
  43. package/docs/ProtoBuf.js.html +271 -180
  44. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  45. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  46. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  47. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  48. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  49. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  50. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  51. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  52. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  53. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  54. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  55. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  56. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  57. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  58. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  59. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  60. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  61. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  62. package/docs/index.html +7 -5
  63. package/docs/styles/jsdoc-default.css +95 -75
  64. package/docs/styles/prettify-tomorrow.css +1 -1
  65. package/donate.png +0 -0
  66. package/examples/protoify/json.js +123 -123
  67. package/examples/protoify/json.json +123 -123
  68. package/examples/websocket/server.js +4 -4
  69. package/externs/{ProtoBuf.js → protobuf.js} +933 -922
  70. package/index.js +1 -18
  71. package/jsdoc.json +1 -1
  72. package/package.json +11 -11
  73. package/protobuf.png +0 -0
  74. package/scripts/build.js +53 -58
  75. package/src/ProtoBuf/Builder/Message.js +18 -9
  76. package/src/ProtoBuf/Builder/Service.js +3 -0
  77. package/src/ProtoBuf/Builder.js +34 -10
  78. package/src/ProtoBuf/DotProto/Parser.js +58 -23
  79. package/src/ProtoBuf/Reflect/Element.js +17 -4
  80. package/src/ProtoBuf/Reflect/Message/Field.js +6 -5
  81. package/src/ProtoBuf/Reflect/Message.js +9 -4
  82. package/src/ProtoBuf/Util.js +116 -116
  83. package/src/bower.json +2 -2
  84. package/src/google/protobuf/descriptor.json +55 -15
  85. package/src/{ProtoBuf.js → protobuf.js} +0 -0
  86. package/src/wrap.js +4 -4
  87. package/tests/bench.txt +373 -373
  88. package/tests/complex.json +8 -1
  89. package/tests/custom-options.json +169 -169
  90. package/tests/extend.json +71 -71
  91. package/tests/imports-weak.proto +7 -0
  92. package/tests/imports.json +83 -83
  93. package/tests/nodeunit-browser/nodeunit.css +70 -70
  94. package/tests/nodeunit-browser/nodeunit.js +2108 -2108
  95. package/tests/options.json +32 -32
  96. package/tests/proto2js/Bar.json +46 -46
  97. package/tests/suite.js +107 -82
  98. package/ProtoBuf.png +0 -0
  99. package/dist/ProtoBuf-light.min.js +0 -87
  100. package/dist/ProtoBuf-light.min.js.gz +0 -0
  101. package/dist/ProtoBuf-light.min.map +0 -8
  102. package/dist/ProtoBuf.min.js +0 -108
  103. package/dist/ProtoBuf.min.js.gz +0 -0
  104. package/dist/ProtoBuf.min.map +0 -8
  105. package/externs/ByteBuffer.js +0 -767
  106. package/externs/Long.js +0 -328
  107. package/sandbox/gapi/googleapis/google/api/annotations.proto +0 -29
  108. package/sandbox/gapi/googleapis/google/api/http.proto +0 -245
  109. package/sandbox/gapi/googleapis/google/datastore/v1beta3/datastore.proto +0 -281
  110. package/sandbox/gapi/googleapis/google/datastore/v1beta3/entity.proto +0 -189
  111. package/sandbox/gapi/googleapis/google/datastore/v1beta3/query.proto +0 -281
  112. package/sandbox/gapi/googleapis/google/longrunning/operations.proto +0 -144
  113. package/sandbox/gapi/googleapis/google/protobuf/any.proto +0 -98
  114. package/sandbox/gapi/googleapis/google/protobuf/any_test.proto +0 -41
  115. package/sandbox/gapi/googleapis/google/protobuf/api.proto +0 -201
  116. package/sandbox/gapi/googleapis/google/protobuf/descriptor.proto +0 -773
  117. package/sandbox/gapi/googleapis/google/protobuf/duration.proto +0 -95
  118. package/sandbox/gapi/googleapis/google/protobuf/empty.proto +0 -50
  119. package/sandbox/gapi/googleapis/google/protobuf/field_mask.proto +0 -167
  120. package/sandbox/gapi/googleapis/google/protobuf/map_lite_unittest.proto +0 -130
  121. package/sandbox/gapi/googleapis/google/protobuf/map_proto2_unittest.proto +0 -60
  122. package/sandbox/gapi/googleapis/google/protobuf/map_unittest.proto +0 -129
  123. package/sandbox/gapi/googleapis/google/protobuf/map_unittest_proto3.proto +0 -120
  124. package/sandbox/gapi/googleapis/google/protobuf/source_context.proto +0 -47
  125. package/sandbox/gapi/googleapis/google/protobuf/struct.proto +0 -94
  126. package/sandbox/gapi/googleapis/google/protobuf/timestamp.proto +0 -107
  127. package/sandbox/gapi/googleapis/google/protobuf/type.proto +0 -176
  128. package/sandbox/gapi/googleapis/google/protobuf/unittest.proto +0 -878
  129. package/sandbox/gapi/googleapis/google/protobuf/unittest_arena.proto +0 -46
  130. package/sandbox/gapi/googleapis/google/protobuf/unittest_custom_options.proto +0 -394
  131. package/sandbox/gapi/googleapis/google/protobuf/unittest_drop_unknown_fields.proto +0 -58
  132. package/sandbox/gapi/googleapis/google/protobuf/unittest_embed_optimize_for.proto +0 -51
  133. package/sandbox/gapi/googleapis/google/protobuf/unittest_empty.proto +0 -38
  134. package/sandbox/gapi/googleapis/google/protobuf/unittest_enormous_descriptor.proto +0 -1048
  135. package/sandbox/gapi/googleapis/google/protobuf/unittest_import.proto +0 -66
  136. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_lite.proto +0 -52
  137. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_proto3.proto +0 -68
  138. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public.proto +0 -41
  139. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_lite.proto +0 -43
  140. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_proto3.proto +0 -42
  141. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite.proto +0 -385
  142. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite_imports_nonlite.proto +0 -44
  143. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset.proto +0 -82
  144. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset_wire_format.proto +0 -52
  145. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena.proto +0 -202
  146. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_import.proto +0 -37
  147. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_lite.proto +0 -42
  148. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_field_presence.proto +0 -138
  149. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_generic_services.proto +0 -54
  150. package/sandbox/gapi/googleapis/google/protobuf/unittest_optimize_for.proto +0 -67
  151. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum.proto +0 -71
  152. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum2.proto +0 -50
  153. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3.proto +0 -388
  154. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3_arena.proto +0 -206
  155. package/sandbox/gapi/googleapis/google/protobuf/unittest_well_known_types.proto +0 -112
  156. package/sandbox/gapi/googleapis/google/protobuf/unknown_enum_test.proto +0 -62
  157. package/sandbox/gapi/googleapis/google/protobuf/wrappers.proto +0 -117
  158. package/sandbox/gapi/googleapis/google/rpc/code.proto +0 -190
  159. package/sandbox/gapi/googleapis/google/rpc/error_details.proto +0 -157
  160. package/sandbox/gapi/googleapis/google/rpc/status.proto +0 -90
  161. package/sandbox/gapi/googleapis/google/type/color.proto +0 -163
  162. package/sandbox/gapi/googleapis/google/type/date.proto +0 -43
  163. package/sandbox/gapi/googleapis/google/type/dayofweek.proto +0 -50
  164. package/sandbox/gapi/googleapis/google/type/latlng.proto +0 -36
  165. package/sandbox/gapi/googleapis/google/type/money.proto +0 -40
  166. package/sandbox/gapi/googleapis/google/type/timeofday.proto +0 -42
  167. package/sandbox/gapi/test.js +0 -17
  168. package/sandbox/gapi/test.proto +0 -12
  169. package/sandbox/issue146/MyOptions.proto +0 -28
  170. package/sandbox/issue146/Sample.proto +0 -21
  171. package/sandbox/issue146/main.js +0 -3
  172. package/sandbox/issue147/enum.proto +0 -8
  173. package/sandbox/issue147/main.js +0 -3
  174. package/sandbox/issue182/commands.proto +0 -10
  175. package/sandbox/issue182/execute.js +0 -22
  176. package/sandbox/issue182/session_commands.proto +0 -14
  177. package/sandbox/issue289/A.proto +0 -8
  178. package/sandbox/issue289/B.proto +0 -8
  179. package/sandbox/issue289/common.proto +0 -5
  180. package/sandbox/issue289/main.js +0 -7
  181. package/sandbox/issue300/IAuth.proto +0 -14
  182. package/sandbox/issue300/Request.proto +0 -14
  183. package/sandbox/issue300/main.js +0 -26
  184. package/sandbox/issue42/innerextend.proto +0 -18
  185. package/sandbox/issue42/main.js +0 -8
  186. package/sandbox/issue42/outerextend.proto +0 -17
  187. package/tests/gtfs-realtime.proto +0 -552
  188. package/webpack.config.js +0 -9
@@ -1,385 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- //
33
- // This is like unittest.proto but with optimize_for = LITE_RUNTIME.
34
-
35
- syntax = "proto2";
36
- package protobuf_unittest;
37
-
38
- import "google/protobuf/unittest_import_lite.proto";
39
-
40
- option optimize_for = LITE_RUNTIME;
41
-
42
- option java_package = "com.google.protobuf";
43
-
44
- // Same as TestAllTypes but with the lite runtime.
45
- message TestAllTypesLite {
46
- message NestedMessage {
47
- optional int32 bb = 1;
48
- }
49
-
50
- enum NestedEnum {
51
- FOO = 1;
52
- BAR = 2;
53
- BAZ = 3;
54
- }
55
-
56
- // Singular
57
- optional int32 optional_int32 = 1;
58
- optional int64 optional_int64 = 2;
59
- optional uint32 optional_uint32 = 3;
60
- optional uint64 optional_uint64 = 4;
61
- optional sint32 optional_sint32 = 5;
62
- optional sint64 optional_sint64 = 6;
63
- optional fixed32 optional_fixed32 = 7;
64
- optional fixed64 optional_fixed64 = 8;
65
- optional sfixed32 optional_sfixed32 = 9;
66
- optional sfixed64 optional_sfixed64 = 10;
67
- optional float optional_float = 11;
68
- optional double optional_double = 12;
69
- optional bool optional_bool = 13;
70
- optional string optional_string = 14;
71
- optional bytes optional_bytes = 15;
72
-
73
- optional group OptionalGroup = 16 {
74
- optional int32 a = 17;
75
- }
76
-
77
- optional NestedMessage optional_nested_message = 18;
78
- optional ForeignMessageLite optional_foreign_message = 19;
79
- optional protobuf_unittest_import.ImportMessageLite
80
- optional_import_message = 20;
81
-
82
- optional NestedEnum optional_nested_enum = 21;
83
- optional ForeignEnumLite optional_foreign_enum = 22;
84
- optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23;
85
-
86
- optional string optional_string_piece = 24 [ctype=STRING_PIECE];
87
- optional string optional_cord = 25 [ctype=CORD];
88
-
89
- // Defined in unittest_import_public.proto
90
- optional protobuf_unittest_import.PublicImportMessageLite
91
- optional_public_import_message = 26;
92
-
93
- optional NestedMessage optional_lazy_message = 27 [lazy=true];
94
-
95
- // Repeated
96
- repeated int32 repeated_int32 = 31;
97
- repeated int64 repeated_int64 = 32;
98
- repeated uint32 repeated_uint32 = 33;
99
- repeated uint64 repeated_uint64 = 34;
100
- repeated sint32 repeated_sint32 = 35;
101
- repeated sint64 repeated_sint64 = 36;
102
- repeated fixed32 repeated_fixed32 = 37;
103
- repeated fixed64 repeated_fixed64 = 38;
104
- repeated sfixed32 repeated_sfixed32 = 39;
105
- repeated sfixed64 repeated_sfixed64 = 40;
106
- repeated float repeated_float = 41;
107
- repeated double repeated_double = 42;
108
- repeated bool repeated_bool = 43;
109
- repeated string repeated_string = 44;
110
- repeated bytes repeated_bytes = 45;
111
-
112
- repeated group RepeatedGroup = 46 {
113
- optional int32 a = 47;
114
- }
115
-
116
- repeated NestedMessage repeated_nested_message = 48;
117
- repeated ForeignMessageLite repeated_foreign_message = 49;
118
- repeated protobuf_unittest_import.ImportMessageLite
119
- repeated_import_message = 50;
120
-
121
- repeated NestedEnum repeated_nested_enum = 51;
122
- repeated ForeignEnumLite repeated_foreign_enum = 52;
123
- repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53;
124
-
125
- repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
126
- repeated string repeated_cord = 55 [ctype=CORD];
127
-
128
- repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
129
-
130
- // Singular with defaults
131
- optional int32 default_int32 = 61 [default = 41 ];
132
- optional int64 default_int64 = 62 [default = 42 ];
133
- optional uint32 default_uint32 = 63 [default = 43 ];
134
- optional uint64 default_uint64 = 64 [default = 44 ];
135
- optional sint32 default_sint32 = 65 [default = -45 ];
136
- optional sint64 default_sint64 = 66 [default = 46 ];
137
- optional fixed32 default_fixed32 = 67 [default = 47 ];
138
- optional fixed64 default_fixed64 = 68 [default = 48 ];
139
- optional sfixed32 default_sfixed32 = 69 [default = 49 ];
140
- optional sfixed64 default_sfixed64 = 70 [default = -50 ];
141
- optional float default_float = 71 [default = 51.5 ];
142
- optional double default_double = 72 [default = 52e3 ];
143
- optional bool default_bool = 73 [default = true ];
144
- optional string default_string = 74 [default = "hello"];
145
- optional bytes default_bytes = 75 [default = "world"];
146
-
147
- optional NestedEnum default_nested_enum = 81 [default = BAR];
148
- optional ForeignEnumLite default_foreign_enum = 82
149
- [default = FOREIGN_LITE_BAR];
150
- optional protobuf_unittest_import.ImportEnumLite
151
- default_import_enum = 83 [default = IMPORT_LITE_BAR];
152
-
153
- optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];
154
- optional string default_cord = 85 [ctype=CORD,default="123"];
155
-
156
- // For oneof test
157
- oneof oneof_field {
158
- uint32 oneof_uint32 = 111;
159
- NestedMessage oneof_nested_message = 112;
160
- string oneof_string = 113;
161
- bytes oneof_bytes = 114;
162
- }
163
- }
164
-
165
- message ForeignMessageLite {
166
- optional int32 c = 1;
167
- }
168
-
169
- enum ForeignEnumLite {
170
- FOREIGN_LITE_FOO = 4;
171
- FOREIGN_LITE_BAR = 5;
172
- FOREIGN_LITE_BAZ = 6;
173
- }
174
-
175
- message TestPackedTypesLite {
176
- repeated int32 packed_int32 = 90 [packed = true];
177
- repeated int64 packed_int64 = 91 [packed = true];
178
- repeated uint32 packed_uint32 = 92 [packed = true];
179
- repeated uint64 packed_uint64 = 93 [packed = true];
180
- repeated sint32 packed_sint32 = 94 [packed = true];
181
- repeated sint64 packed_sint64 = 95 [packed = true];
182
- repeated fixed32 packed_fixed32 = 96 [packed = true];
183
- repeated fixed64 packed_fixed64 = 97 [packed = true];
184
- repeated sfixed32 packed_sfixed32 = 98 [packed = true];
185
- repeated sfixed64 packed_sfixed64 = 99 [packed = true];
186
- repeated float packed_float = 100 [packed = true];
187
- repeated double packed_double = 101 [packed = true];
188
- repeated bool packed_bool = 102 [packed = true];
189
- repeated ForeignEnumLite packed_enum = 103 [packed = true];
190
- }
191
-
192
- message TestAllExtensionsLite {
193
- extensions 1 to max;
194
- }
195
-
196
- extend TestAllExtensionsLite {
197
- // Singular
198
- optional int32 optional_int32_extension_lite = 1;
199
- optional int64 optional_int64_extension_lite = 2;
200
- optional uint32 optional_uint32_extension_lite = 3;
201
- optional uint64 optional_uint64_extension_lite = 4;
202
- optional sint32 optional_sint32_extension_lite = 5;
203
- optional sint64 optional_sint64_extension_lite = 6;
204
- optional fixed32 optional_fixed32_extension_lite = 7;
205
- optional fixed64 optional_fixed64_extension_lite = 8;
206
- optional sfixed32 optional_sfixed32_extension_lite = 9;
207
- optional sfixed64 optional_sfixed64_extension_lite = 10;
208
- optional float optional_float_extension_lite = 11;
209
- optional double optional_double_extension_lite = 12;
210
- optional bool optional_bool_extension_lite = 13;
211
- optional string optional_string_extension_lite = 14;
212
- optional bytes optional_bytes_extension_lite = 15;
213
-
214
- optional group OptionalGroup_extension_lite = 16 {
215
- optional int32 a = 17;
216
- }
217
-
218
- optional TestAllTypesLite.NestedMessage optional_nested_message_extension_lite
219
- = 18;
220
- optional ForeignMessageLite optional_foreign_message_extension_lite = 19;
221
- optional protobuf_unittest_import.ImportMessageLite
222
- optional_import_message_extension_lite = 20;
223
-
224
- optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21;
225
- optional ForeignEnumLite optional_foreign_enum_extension_lite = 22;
226
- optional protobuf_unittest_import.ImportEnumLite
227
- optional_import_enum_extension_lite = 23;
228
-
229
- optional string optional_string_piece_extension_lite = 24
230
- [ctype=STRING_PIECE];
231
- optional string optional_cord_extension_lite = 25 [ctype=CORD];
232
-
233
- optional protobuf_unittest_import.PublicImportMessageLite
234
- optional_public_import_message_extension_lite = 26;
235
-
236
- optional TestAllTypesLite.NestedMessage
237
- optional_lazy_message_extension_lite = 27 [lazy=true];
238
-
239
- // Repeated
240
- repeated int32 repeated_int32_extension_lite = 31;
241
- repeated int64 repeated_int64_extension_lite = 32;
242
- repeated uint32 repeated_uint32_extension_lite = 33;
243
- repeated uint64 repeated_uint64_extension_lite = 34;
244
- repeated sint32 repeated_sint32_extension_lite = 35;
245
- repeated sint64 repeated_sint64_extension_lite = 36;
246
- repeated fixed32 repeated_fixed32_extension_lite = 37;
247
- repeated fixed64 repeated_fixed64_extension_lite = 38;
248
- repeated sfixed32 repeated_sfixed32_extension_lite = 39;
249
- repeated sfixed64 repeated_sfixed64_extension_lite = 40;
250
- repeated float repeated_float_extension_lite = 41;
251
- repeated double repeated_double_extension_lite = 42;
252
- repeated bool repeated_bool_extension_lite = 43;
253
- repeated string repeated_string_extension_lite = 44;
254
- repeated bytes repeated_bytes_extension_lite = 45;
255
-
256
- repeated group RepeatedGroup_extension_lite = 46 {
257
- optional int32 a = 47;
258
- }
259
-
260
- repeated TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite
261
- = 48;
262
- repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49;
263
- repeated protobuf_unittest_import.ImportMessageLite
264
- repeated_import_message_extension_lite = 50;
265
-
266
- repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51;
267
- repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52;
268
- repeated protobuf_unittest_import.ImportEnumLite
269
- repeated_import_enum_extension_lite = 53;
270
-
271
- repeated string repeated_string_piece_extension_lite = 54
272
- [ctype=STRING_PIECE];
273
- repeated string repeated_cord_extension_lite = 55 [ctype=CORD];
274
-
275
- repeated TestAllTypesLite.NestedMessage
276
- repeated_lazy_message_extension_lite = 57 [lazy=true];
277
-
278
- // Singular with defaults
279
- optional int32 default_int32_extension_lite = 61 [default = 41 ];
280
- optional int64 default_int64_extension_lite = 62 [default = 42 ];
281
- optional uint32 default_uint32_extension_lite = 63 [default = 43 ];
282
- optional uint64 default_uint64_extension_lite = 64 [default = 44 ];
283
- optional sint32 default_sint32_extension_lite = 65 [default = -45 ];
284
- optional sint64 default_sint64_extension_lite = 66 [default = 46 ];
285
- optional fixed32 default_fixed32_extension_lite = 67 [default = 47 ];
286
- optional fixed64 default_fixed64_extension_lite = 68 [default = 48 ];
287
- optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49 ];
288
- optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50 ];
289
- optional float default_float_extension_lite = 71 [default = 51.5 ];
290
- optional double default_double_extension_lite = 72 [default = 52e3 ];
291
- optional bool default_bool_extension_lite = 73 [default = true ];
292
- optional string default_string_extension_lite = 74 [default = "hello"];
293
- optional bytes default_bytes_extension_lite = 75 [default = "world"];
294
-
295
- optional TestAllTypesLite.NestedEnum
296
- default_nested_enum_extension_lite = 81 [default = BAR];
297
- optional ForeignEnumLite
298
- default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR];
299
- optional protobuf_unittest_import.ImportEnumLite
300
- default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR];
301
-
302
- optional string default_string_piece_extension_lite = 84 [ctype=STRING_PIECE,
303
- default="abc"];
304
- optional string default_cord_extension_lite = 85 [ctype=CORD, default="123"];
305
-
306
- // For oneof test
307
- optional uint32 oneof_uint32_extension_lite = 111;
308
- optional TestAllTypesLite.NestedMessage oneof_nested_message_extension_lite = 112;
309
- optional string oneof_string_extension_lite = 113;
310
- optional bytes oneof_bytes_extension_lite = 114;
311
- }
312
-
313
- message TestPackedExtensionsLite {
314
- extensions 1 to max;
315
- }
316
-
317
- extend TestPackedExtensionsLite {
318
- repeated int32 packed_int32_extension_lite = 90 [packed = true];
319
- repeated int64 packed_int64_extension_lite = 91 [packed = true];
320
- repeated uint32 packed_uint32_extension_lite = 92 [packed = true];
321
- repeated uint64 packed_uint64_extension_lite = 93 [packed = true];
322
- repeated sint32 packed_sint32_extension_lite = 94 [packed = true];
323
- repeated sint64 packed_sint64_extension_lite = 95 [packed = true];
324
- repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true];
325
- repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true];
326
- repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true];
327
- repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true];
328
- repeated float packed_float_extension_lite = 100 [packed = true];
329
- repeated double packed_double_extension_lite = 101 [packed = true];
330
- repeated bool packed_bool_extension_lite = 102 [packed = true];
331
- repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true];
332
- }
333
-
334
- message TestNestedExtensionLite {
335
- extend TestAllExtensionsLite {
336
- optional int32 nested_extension = 12345;
337
- }
338
- }
339
-
340
- // Test that deprecated fields work. We only verify that they compile (at one
341
- // point this failed).
342
- message TestDeprecatedLite {
343
- optional int32 deprecated_field = 1 [deprecated = true];
344
- }
345
-
346
- // See the comments of the same type in unittest.proto.
347
- message TestParsingMergeLite {
348
- message RepeatedFieldsGenerator {
349
- repeated TestAllTypesLite field1 = 1;
350
- repeated TestAllTypesLite field2 = 2;
351
- repeated TestAllTypesLite field3 = 3;
352
- repeated group Group1 = 10 {
353
- optional TestAllTypesLite field1 = 11;
354
- }
355
- repeated group Group2 = 20 {
356
- optional TestAllTypesLite field1 = 21;
357
- }
358
- repeated TestAllTypesLite ext1 = 1000;
359
- repeated TestAllTypesLite ext2 = 1001;
360
- }
361
- required TestAllTypesLite required_all_types = 1;
362
- optional TestAllTypesLite optional_all_types = 2;
363
- repeated TestAllTypesLite repeated_all_types = 3;
364
- optional group OptionalGroup = 10 {
365
- optional TestAllTypesLite optional_group_all_types = 11;
366
- }
367
- repeated group RepeatedGroup = 20 {
368
- optional TestAllTypesLite repeated_group_all_types = 21;
369
- }
370
- extensions 1000 to max;
371
- extend TestParsingMergeLite {
372
- optional TestAllTypesLite optional_ext = 1000;
373
- repeated TestAllTypesLite repeated_ext = 1001;
374
- }
375
- }
376
-
377
- // TestEmptyMessageLite is used to test unknown fields support in lite mode.
378
- message TestEmptyMessageLite{
379
- }
380
-
381
- // Like above, but declare all field numbers as potential extensions. No
382
- // actual extensions should ever be defined for this type.
383
- message TestEmptyMessageWithExtensionsLite {
384
- extensions 1 to max;
385
- }
@@ -1,44 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- //
33
- // Tests that a "lite" message can import a regular message.
34
-
35
- syntax = "proto2";
36
- package protobuf_unittest;
37
-
38
- import "google/protobuf/unittest.proto";
39
-
40
- option optimize_for = LITE_RUNTIME;
41
-
42
- message TestLiteImportsNonlite {
43
- optional TestAllTypes message = 1;
44
- }
@@ -1,82 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- // Based on original Protocol Buffers design by
33
- // Sanjay Ghemawat, Jeff Dean, and others.
34
- //
35
- // This file is similar to unittest_mset_wire_format.proto, but does not
36
- // have a TestMessageSet, so it can be downgraded to proto1.
37
-
38
- syntax = "proto2";
39
-
40
- import "google/protobuf/unittest_mset_wire_format.proto";
41
-
42
- package protobuf_unittest;
43
-
44
- option cc_enable_arenas = true;
45
- option optimize_for = SPEED;
46
-
47
- message TestMessageSetContainer {
48
- optional proto2_wireformat_unittest.TestMessageSet message_set = 1;
49
- }
50
-
51
- message TestMessageSetExtension1 {
52
- extend proto2_wireformat_unittest.TestMessageSet {
53
- optional TestMessageSetExtension1 message_set_extension = 1545008;
54
- }
55
- optional int32 i = 15;
56
- }
57
-
58
- message TestMessageSetExtension2 {
59
- extend proto2_wireformat_unittest.TestMessageSet {
60
- optional TestMessageSetExtension2 message_set_extension = 1547769;
61
- }
62
- optional string str = 25;
63
- }
64
-
65
- // This message was used to generate
66
- // //net/proto2/python/internal/testdata/message_set_message, but is commented
67
- // out since it must not actually exist in code, to simulate an "unknown"
68
- // extension.
69
- // message TestMessageSetUnknownExtension {
70
- // extend TestMessageSet {
71
- // optional TestMessageSetUnknownExtension message_set_extension = 56141421;
72
- // }
73
- // optional int64 a = 1;
74
- // }
75
-
76
- // MessageSet wire format is equivalent to this.
77
- message RawMessageSet {
78
- repeated group Item = 1 {
79
- required int32 type_id = 2;
80
- required bytes message = 3;
81
- }
82
- }
@@ -1,52 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- // Based on original Protocol Buffers design by
33
- // Sanjay Ghemawat, Jeff Dean, and others.
34
- //
35
- // This file contains messages for testing message_set_wire_format.
36
-
37
- syntax = "proto2";
38
- package proto2_wireformat_unittest;
39
-
40
- option cc_enable_arenas = true;
41
- option optimize_for = SPEED;
42
- option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
43
-
44
- // A message with message_set_wire_format.
45
- message TestMessageSet {
46
- option message_set_wire_format = true;
47
- extensions 4 to max;
48
- }
49
-
50
- message TestMessageSetWireFormatContainer {
51
- optional TestMessageSet message_set = 1;
52
- }