protobufjs 5.0.1 → 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 (170) hide show
  1. package/.travis.yml +2 -1
  2. package/README.md +144 -22
  3. package/bin/pbjs +2 -2
  4. package/bower.json +2 -2
  5. package/cli/pbjs/targets/amd.js +1 -1
  6. package/cli/pbjs/targets/json.js +8 -0
  7. package/cli/pbjs/util.js +1 -1
  8. package/cli/pbjs.js +1 -1
  9. package/dist/protobuf-light.js +166 -128
  10. package/dist/protobuf-light.min.js +88 -81
  11. package/dist/protobuf-light.min.js.gz +0 -0
  12. package/dist/protobuf-light.min.map +4 -4
  13. package/dist/protobuf.js +171 -129
  14. package/dist/protobuf.min.js +106 -98
  15. package/dist/protobuf.min.js.gz +0 -0
  16. package/dist/protobuf.min.map +4 -4
  17. package/docs/ProtoBuf.Builder.Message.html +1408 -971
  18. package/docs/ProtoBuf.Builder.Service.html +266 -197
  19. package/docs/ProtoBuf.Builder.html +758 -542
  20. package/docs/ProtoBuf.DotProto.Parser.html +223 -161
  21. package/docs/ProtoBuf.DotProto.Tokenizer.html +344 -248
  22. package/docs/ProtoBuf.DotProto.html +20 -12
  23. package/docs/ProtoBuf.Element.html +554 -554
  24. package/docs/ProtoBuf.Map.html +158 -123
  25. package/docs/ProtoBuf.Reflect.Element.html +286 -143
  26. package/docs/ProtoBuf.Reflect.Enum.Value.html +329 -228
  27. package/docs/ProtoBuf.Reflect.Enum.html +757 -537
  28. package/docs/ProtoBuf.Reflect.Extension.html +73 -56
  29. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +1013 -740
  30. package/docs/ProtoBuf.Reflect.Message.Field.html +926 -649
  31. package/docs/ProtoBuf.Reflect.Message.OneOf.html +327 -245
  32. package/docs/ProtoBuf.Reflect.Message.html +915 -651
  33. package/docs/ProtoBuf.Reflect.Namespace.html +648 -447
  34. package/docs/ProtoBuf.Reflect.Service.Method.html +363 -251
  35. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +545 -397
  36. package/docs/ProtoBuf.Reflect.Service.html +721 -511
  37. package/docs/ProtoBuf.Reflect.T.html +268 -197
  38. package/docs/ProtoBuf.Reflect.html +20 -12
  39. package/docs/ProtoBuf.Util.html +169 -118
  40. package/docs/ProtoBuf.html +840 -628
  41. package/docs/ProtoBuf.js.html +177 -134
  42. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  43. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  44. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  45. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  46. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  47. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  48. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  49. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  50. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  51. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  52. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  53. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  54. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  55. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  56. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  57. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  58. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  59. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  60. package/docs/index.html +7 -5
  61. package/docs/styles/jsdoc-default.css +95 -75
  62. package/docs/styles/prettify-tomorrow.css +1 -1
  63. package/examples/protoify/json.js +123 -123
  64. package/examples/protoify/json.json +123 -123
  65. package/examples/websocket/server.js +4 -4
  66. package/externs/protobuf.js +1 -1
  67. package/jsdoc.json +1 -1
  68. package/package.json +2 -2
  69. package/scripts/build.js +53 -53
  70. package/src/ProtoBuf/Builder/Message.js +9 -5
  71. package/src/ProtoBuf/Builder.js +19 -2
  72. package/src/ProtoBuf/DotProto/Parser.js +5 -1
  73. package/src/ProtoBuf/Reflect/Element.js +13 -1
  74. package/src/ProtoBuf/Reflect/Message/Field.js +2 -2
  75. package/src/ProtoBuf/Reflect/Message.js +6 -1
  76. package/src/ProtoBuf/Util.js +116 -116
  77. package/src/bower.json +1 -1
  78. package/src/google/protobuf/descriptor.json +27 -1
  79. package/tests/bench.txt +373 -373
  80. package/tests/complex.json +8 -1
  81. package/tests/custom-options.json +169 -169
  82. package/tests/extend.json +71 -71
  83. package/tests/imports.json +83 -83
  84. package/tests/nodeunit-browser/nodeunit.css +70 -70
  85. package/tests/nodeunit-browser/nodeunit.js +2108 -2108
  86. package/tests/options.json +32 -32
  87. package/tests/proto2js/Bar.json +46 -46
  88. package/tests/suite.js +43 -1
  89. package/sandbox/gapi/googleapis/google/api/annotations.proto +0 -29
  90. package/sandbox/gapi/googleapis/google/api/http.proto +0 -245
  91. package/sandbox/gapi/googleapis/google/datastore/v1beta3/datastore.proto +0 -281
  92. package/sandbox/gapi/googleapis/google/datastore/v1beta3/entity.proto +0 -189
  93. package/sandbox/gapi/googleapis/google/datastore/v1beta3/query.proto +0 -281
  94. package/sandbox/gapi/googleapis/google/longrunning/operations.proto +0 -144
  95. package/sandbox/gapi/googleapis/google/protobuf/any.proto +0 -98
  96. package/sandbox/gapi/googleapis/google/protobuf/any_test.proto +0 -41
  97. package/sandbox/gapi/googleapis/google/protobuf/api.proto +0 -201
  98. package/sandbox/gapi/googleapis/google/protobuf/descriptor.proto +0 -773
  99. package/sandbox/gapi/googleapis/google/protobuf/duration.proto +0 -95
  100. package/sandbox/gapi/googleapis/google/protobuf/empty.proto +0 -50
  101. package/sandbox/gapi/googleapis/google/protobuf/field_mask.proto +0 -167
  102. package/sandbox/gapi/googleapis/google/protobuf/map_lite_unittest.proto +0 -130
  103. package/sandbox/gapi/googleapis/google/protobuf/map_proto2_unittest.proto +0 -60
  104. package/sandbox/gapi/googleapis/google/protobuf/map_unittest.proto +0 -129
  105. package/sandbox/gapi/googleapis/google/protobuf/map_unittest_proto3.proto +0 -120
  106. package/sandbox/gapi/googleapis/google/protobuf/source_context.proto +0 -47
  107. package/sandbox/gapi/googleapis/google/protobuf/struct.proto +0 -94
  108. package/sandbox/gapi/googleapis/google/protobuf/timestamp.proto +0 -107
  109. package/sandbox/gapi/googleapis/google/protobuf/type.proto +0 -176
  110. package/sandbox/gapi/googleapis/google/protobuf/unittest.proto +0 -878
  111. package/sandbox/gapi/googleapis/google/protobuf/unittest_arena.proto +0 -46
  112. package/sandbox/gapi/googleapis/google/protobuf/unittest_custom_options.proto +0 -394
  113. package/sandbox/gapi/googleapis/google/protobuf/unittest_drop_unknown_fields.proto +0 -58
  114. package/sandbox/gapi/googleapis/google/protobuf/unittest_embed_optimize_for.proto +0 -51
  115. package/sandbox/gapi/googleapis/google/protobuf/unittest_empty.proto +0 -38
  116. package/sandbox/gapi/googleapis/google/protobuf/unittest_enormous_descriptor.proto +0 -1048
  117. package/sandbox/gapi/googleapis/google/protobuf/unittest_import.proto +0 -66
  118. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_lite.proto +0 -52
  119. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_proto3.proto +0 -68
  120. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public.proto +0 -41
  121. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_lite.proto +0 -43
  122. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_proto3.proto +0 -42
  123. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite.proto +0 -385
  124. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite_imports_nonlite.proto +0 -44
  125. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset.proto +0 -82
  126. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset_wire_format.proto +0 -52
  127. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena.proto +0 -202
  128. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_import.proto +0 -37
  129. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_lite.proto +0 -42
  130. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_field_presence.proto +0 -138
  131. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_generic_services.proto +0 -54
  132. package/sandbox/gapi/googleapis/google/protobuf/unittest_optimize_for.proto +0 -67
  133. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum.proto +0 -71
  134. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum2.proto +0 -50
  135. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3.proto +0 -388
  136. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3_arena.proto +0 -206
  137. package/sandbox/gapi/googleapis/google/protobuf/unittest_well_known_types.proto +0 -112
  138. package/sandbox/gapi/googleapis/google/protobuf/unknown_enum_test.proto +0 -62
  139. package/sandbox/gapi/googleapis/google/protobuf/wrappers.proto +0 -117
  140. package/sandbox/gapi/googleapis/google/rpc/code.proto +0 -190
  141. package/sandbox/gapi/googleapis/google/rpc/error_details.proto +0 -157
  142. package/sandbox/gapi/googleapis/google/rpc/status.proto +0 -90
  143. package/sandbox/gapi/googleapis/google/type/color.proto +0 -163
  144. package/sandbox/gapi/googleapis/google/type/date.proto +0 -43
  145. package/sandbox/gapi/googleapis/google/type/dayofweek.proto +0 -50
  146. package/sandbox/gapi/googleapis/google/type/latlng.proto +0 -36
  147. package/sandbox/gapi/googleapis/google/type/money.proto +0 -40
  148. package/sandbox/gapi/googleapis/google/type/timeofday.proto +0 -42
  149. package/sandbox/gapi/test.js +0 -17
  150. package/sandbox/gapi/test.proto +0 -12
  151. package/sandbox/issue146/MyOptions.proto +0 -28
  152. package/sandbox/issue146/Sample.proto +0 -21
  153. package/sandbox/issue146/main.js +0 -3
  154. package/sandbox/issue147/enum.proto +0 -8
  155. package/sandbox/issue147/main.js +0 -3
  156. package/sandbox/issue182/commands.proto +0 -10
  157. package/sandbox/issue182/execute.js +0 -22
  158. package/sandbox/issue182/session_commands.proto +0 -14
  159. package/sandbox/issue289/A.proto +0 -8
  160. package/sandbox/issue289/B.proto +0 -8
  161. package/sandbox/issue289/common.proto +0 -5
  162. package/sandbox/issue289/main.js +0 -7
  163. package/sandbox/issue300/IAuth.proto +0 -14
  164. package/sandbox/issue300/Request.proto +0 -14
  165. package/sandbox/issue300/main.js +0 -26
  166. package/sandbox/issue347/index.js +0 -27
  167. package/sandbox/issue355/main.proto +0 -15
  168. package/sandbox/issue42/innerextend.proto +0 -18
  169. package/sandbox/issue42/main.js +0 -8
  170. package/sandbox/issue42/outerextend.proto +0 -17
@@ -1,202 +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 proto file contains copies of TestAllTypes and friends, but with arena
36
- // support disabled in code generation. It allows us to test the performance
37
- // impact against baseline (non-arena) google.protobuf.
38
-
39
- syntax = "proto2";
40
-
41
- // Some generic_services option(s) added automatically.
42
- // See: http://go/proto2-generic-services-default
43
- option cc_generic_services = true; // auto-added
44
- option java_generic_services = true; // auto-added
45
- option py_generic_services = true; // auto-added
46
- option cc_enable_arenas = false;
47
- option objc_class_prefix = "NOARN";
48
-
49
- import "google/protobuf/unittest_import.proto";
50
- import "google/protobuf/unittest_arena.proto";
51
-
52
- // We don't put this in a package within proto2 because we need to make sure
53
- // that the generated code doesn't depend on being in the proto2 namespace.
54
- // In test_util.h we do "using namespace unittest = protobuf_unittest".
55
- package protobuf_unittest_no_arena;
56
-
57
- // Protos optimized for SPEED use a strict superset of the generated code
58
- // of equivalent ones optimized for CODE_SIZE, so we should optimize all our
59
- // tests for speed unless explicitly testing code size optimization.
60
- option optimize_for = SPEED;
61
-
62
- option java_outer_classname = "UnittestProto";
63
-
64
- // This proto includes every type of field in both singular and repeated
65
- // forms.
66
- message TestAllTypes {
67
- message NestedMessage {
68
- // The field name "b" fails to compile in proto1 because it conflicts with
69
- // a local variable named "b" in one of the generated methods. Doh.
70
- // This file needs to compile in proto1 to test backwards-compatibility.
71
- optional int32 bb = 1;
72
- }
73
-
74
- enum NestedEnum {
75
- FOO = 1;
76
- BAR = 2;
77
- BAZ = 3;
78
- NEG = -1; // Intentionally negative.
79
- }
80
-
81
- // Singular
82
- optional int32 optional_int32 = 1;
83
- optional int64 optional_int64 = 2;
84
- optional uint32 optional_uint32 = 3;
85
- optional uint64 optional_uint64 = 4;
86
- optional sint32 optional_sint32 = 5;
87
- optional sint64 optional_sint64 = 6;
88
- optional fixed32 optional_fixed32 = 7;
89
- optional fixed64 optional_fixed64 = 8;
90
- optional sfixed32 optional_sfixed32 = 9;
91
- optional sfixed64 optional_sfixed64 = 10;
92
- optional float optional_float = 11;
93
- optional double optional_double = 12;
94
- optional bool optional_bool = 13;
95
- optional string optional_string = 14;
96
- optional bytes optional_bytes = 15;
97
-
98
- optional group OptionalGroup = 16 {
99
- optional int32 a = 17;
100
- }
101
-
102
- optional NestedMessage optional_nested_message = 18;
103
- optional ForeignMessage optional_foreign_message = 19;
104
- optional protobuf_unittest_import.ImportMessage optional_import_message = 20;
105
-
106
- optional NestedEnum optional_nested_enum = 21;
107
- optional ForeignEnum optional_foreign_enum = 22;
108
- optional protobuf_unittest_import.ImportEnum optional_import_enum = 23;
109
-
110
- optional string optional_string_piece = 24 [ctype=STRING_PIECE];
111
- optional string optional_cord = 25 [ctype=CORD];
112
-
113
- // Defined in unittest_import_public.proto
114
- optional protobuf_unittest_import.PublicImportMessage
115
- optional_public_import_message = 26;
116
-
117
- optional NestedMessage optional_message = 27 [lazy=true];
118
-
119
- // Repeated
120
- repeated int32 repeated_int32 = 31;
121
- repeated int64 repeated_int64 = 32;
122
- repeated uint32 repeated_uint32 = 33;
123
- repeated uint64 repeated_uint64 = 34;
124
- repeated sint32 repeated_sint32 = 35;
125
- repeated sint64 repeated_sint64 = 36;
126
- repeated fixed32 repeated_fixed32 = 37;
127
- repeated fixed64 repeated_fixed64 = 38;
128
- repeated sfixed32 repeated_sfixed32 = 39;
129
- repeated sfixed64 repeated_sfixed64 = 40;
130
- repeated float repeated_float = 41;
131
- repeated double repeated_double = 42;
132
- repeated bool repeated_bool = 43;
133
- repeated string repeated_string = 44;
134
- repeated bytes repeated_bytes = 45;
135
-
136
- repeated group RepeatedGroup = 46 {
137
- optional int32 a = 47;
138
- }
139
-
140
- repeated NestedMessage repeated_nested_message = 48;
141
- repeated ForeignMessage repeated_foreign_message = 49;
142
- repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50;
143
-
144
- repeated NestedEnum repeated_nested_enum = 51;
145
- repeated ForeignEnum repeated_foreign_enum = 52;
146
- repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
147
-
148
- repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
149
- repeated string repeated_cord = 55 [ctype=CORD];
150
-
151
- repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
152
-
153
- // Singular with defaults
154
- optional int32 default_int32 = 61 [default = 41 ];
155
- optional int64 default_int64 = 62 [default = 42 ];
156
- optional uint32 default_uint32 = 63 [default = 43 ];
157
- optional uint64 default_uint64 = 64 [default = 44 ];
158
- optional sint32 default_sint32 = 65 [default = -45 ];
159
- optional sint64 default_sint64 = 66 [default = 46 ];
160
- optional fixed32 default_fixed32 = 67 [default = 47 ];
161
- optional fixed64 default_fixed64 = 68 [default = 48 ];
162
- optional sfixed32 default_sfixed32 = 69 [default = 49 ];
163
- optional sfixed64 default_sfixed64 = 70 [default = -50 ];
164
- optional float default_float = 71 [default = 51.5 ];
165
- optional double default_double = 72 [default = 52e3 ];
166
- optional bool default_bool = 73 [default = true ];
167
- optional string default_string = 74 [default = "hello"];
168
- optional bytes default_bytes = 75 [default = "world"];
169
-
170
- optional NestedEnum default_nested_enum = 81 [default = BAR ];
171
- optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
172
- optional protobuf_unittest_import.ImportEnum
173
- default_import_enum = 83 [default = IMPORT_BAR];
174
-
175
- optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];
176
- optional string default_cord = 85 [ctype=CORD,default="123"];
177
-
178
- // For oneof test
179
- oneof oneof_field {
180
- uint32 oneof_uint32 = 111;
181
- NestedMessage oneof_nested_message = 112;
182
- string oneof_string = 113;
183
- bytes oneof_bytes = 114;
184
- NestedMessage lazy_oneof_nested_message = 115 [lazy=true];
185
- }
186
- }
187
-
188
- // Define these after TestAllTypes to make sure the compiler can handle
189
- // that.
190
- message ForeignMessage {
191
- optional int32 c = 1;
192
- }
193
-
194
- enum ForeignEnum {
195
- FOREIGN_FOO = 4;
196
- FOREIGN_BAR = 5;
197
- FOREIGN_BAZ = 6;
198
- }
199
-
200
- message TestNoArenaMessage {
201
- optional proto2_arena_unittest.ArenaMessage arena_message = 1;
202
- };
@@ -1,37 +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
- syntax = "proto2";
32
-
33
- package proto2_arena_unittest;
34
-
35
- message ImportNoArenaNestedMessage {
36
- optional int32 d = 1;
37
- };
@@ -1,42 +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
- syntax = "proto2";
32
-
33
- option optimize_for = LITE_RUNTIME;
34
-
35
- // We don't put this in a package within proto2 because we need to make sure
36
- // that the generated code doesn't depend on being in the proto2 namespace.
37
- // In test_util.h we do "using namespace unittest = protobuf_unittest".
38
- package protobuf_unittest_no_arena;
39
-
40
- message ForeignMessageLite {
41
- optional int32 c = 1;
42
- }
@@ -1,138 +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
- // A proto file used to test a message type with no explicit field presence.
32
-
33
- syntax = "proto3";
34
-
35
- // We want to test embedded proto2 messages, so include some proto2 types.
36
- import "google/protobuf/unittest.proto";
37
-
38
- package proto2_nofieldpresence_unittest;
39
-
40
- // This proto includes every type of field in both singular and repeated
41
- // forms.
42
- message TestAllTypes {
43
- message NestedMessage {
44
- int32 bb = 1;
45
- }
46
-
47
- enum NestedEnum {
48
- FOO = 0;
49
- BAR = 1;
50
- BAZ = 2;
51
- }
52
-
53
- // Singular
54
- // TODO: remove 'optional' labels as soon as CL 69188077 is LGTM'd to make
55
- // 'optional' optional.
56
- int32 optional_int32 = 1;
57
- int64 optional_int64 = 2;
58
- uint32 optional_uint32 = 3;
59
- uint64 optional_uint64 = 4;
60
- sint32 optional_sint32 = 5;
61
- sint64 optional_sint64 = 6;
62
- fixed32 optional_fixed32 = 7;
63
- fixed64 optional_fixed64 = 8;
64
- sfixed32 optional_sfixed32 = 9;
65
- sfixed64 optional_sfixed64 = 10;
66
- float optional_float = 11;
67
- double optional_double = 12;
68
- bool optional_bool = 13;
69
- string optional_string = 14;
70
- bytes optional_bytes = 15;
71
-
72
- NestedMessage optional_nested_message = 18;
73
- ForeignMessage optional_foreign_message = 19;
74
- protobuf_unittest.TestAllTypes optional_proto2_message = 20;
75
-
76
- NestedEnum optional_nested_enum = 21;
77
- ForeignEnum optional_foreign_enum = 22;
78
- // N.B.: proto2-enum-type fields not allowed, because their default values
79
- // might not be zero.
80
- //optional protobuf_unittest.ForeignEnum optional_proto2_enum = 23;
81
-
82
- string optional_string_piece = 24 [ctype=STRING_PIECE];
83
- string optional_cord = 25 [ctype=CORD];
84
-
85
- NestedMessage optional_lazy_message = 30 [lazy=true];
86
-
87
- // Repeated
88
- repeated int32 repeated_int32 = 31;
89
- repeated int64 repeated_int64 = 32;
90
- repeated uint32 repeated_uint32 = 33;
91
- repeated uint64 repeated_uint64 = 34;
92
- repeated sint32 repeated_sint32 = 35;
93
- repeated sint64 repeated_sint64 = 36;
94
- repeated fixed32 repeated_fixed32 = 37;
95
- repeated fixed64 repeated_fixed64 = 38;
96
- repeated sfixed32 repeated_sfixed32 = 39;
97
- repeated sfixed64 repeated_sfixed64 = 40;
98
- repeated float repeated_float = 41;
99
- repeated double repeated_double = 42;
100
- repeated bool repeated_bool = 43;
101
- repeated string repeated_string = 44;
102
- repeated bytes repeated_bytes = 45;
103
-
104
- repeated NestedMessage repeated_nested_message = 48;
105
- repeated ForeignMessage repeated_foreign_message = 49;
106
- repeated protobuf_unittest.TestAllTypes repeated_proto2_message = 50;
107
-
108
- repeated NestedEnum repeated_nested_enum = 51;
109
- repeated ForeignEnum repeated_foreign_enum = 52;
110
-
111
- repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
112
- repeated string repeated_cord = 55 [ctype=CORD];
113
-
114
- repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
115
-
116
- oneof oneof_field {
117
- uint32 oneof_uint32 = 111;
118
- NestedMessage oneof_nested_message = 112;
119
- string oneof_string = 113;
120
- NestedEnum oneof_enum = 114;
121
- }
122
- }
123
-
124
- message TestProto2Required {
125
- protobuf_unittest.TestRequired proto2 = 1;
126
- }
127
-
128
- // Define these after TestAllTypes to make sure the compiler can handle
129
- // that.
130
- message ForeignMessage {
131
- int32 c = 1;
132
- }
133
-
134
- enum ForeignEnum {
135
- FOREIGN_FOO = 0;
136
- FOREIGN_BAR = 1;
137
- FOREIGN_BAZ = 2;
138
- }
@@ -1,54 +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
- syntax = "proto2";
34
- package google.protobuf.no_generic_services_test;
35
-
36
-
37
- // *_generic_services are false by default.
38
-
39
- message TestMessage {
40
- optional int32 a = 1;
41
- extensions 1000 to max;
42
- }
43
-
44
- enum TestEnum {
45
- FOO = 1;
46
- }
47
-
48
- extend TestMessage {
49
- optional int32 test_extension = 1000;
50
- }
51
-
52
- service TestService {
53
- rpc Foo(TestMessage) returns(TestMessage);
54
- }
@@ -1,67 +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
- // A proto file which uses optimize_for = CODE_SIZE.
36
-
37
- syntax = "proto2";
38
- import "google/protobuf/unittest.proto";
39
-
40
- package protobuf_unittest;
41
-
42
- option optimize_for = CODE_SIZE;
43
-
44
- message TestOptimizedForSize {
45
- optional int32 i = 1;
46
- optional ForeignMessage msg = 19;
47
-
48
- extensions 1000 to max;
49
-
50
- extend TestOptimizedForSize {
51
- optional int32 test_extension = 1234;
52
- optional TestRequiredOptimizedForSize test_extension2 = 1235;
53
- }
54
-
55
- oneof foo {
56
- int32 integer_field = 2;
57
- string string_field = 3;
58
- }
59
- }
60
-
61
- message TestRequiredOptimizedForSize {
62
- required int32 x = 1;
63
- }
64
-
65
- message TestOptionalOptimizedForSize {
66
- optional TestRequiredOptimizedForSize o = 1;
67
- }
@@ -1,71 +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
- syntax = "proto3";
32
-
33
- package proto3_preserve_unknown_enum_unittest;
34
- option objc_class_prefix = "UnknownEnums";
35
-
36
- option csharp_namespace = "Google.Protobuf.TestProtos";
37
-
38
- enum MyEnum {
39
- FOO = 0;
40
- BAR = 1;
41
- BAZ = 2;
42
- }
43
-
44
- enum MyEnumPlusExtra {
45
- E_FOO = 0;
46
- E_BAR = 1;
47
- E_BAZ = 2;
48
- E_EXTRA = 3;
49
- }
50
-
51
- message MyMessage {
52
- MyEnum e = 1;
53
- repeated MyEnum repeated_e = 2;
54
- repeated MyEnum repeated_packed_e = 3 [packed=true];
55
- repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4; // not packed
56
- oneof o {
57
- MyEnum oneof_e_1 = 5;
58
- MyEnum oneof_e_2 = 6;
59
- }
60
- }
61
-
62
- message MyMessagePlusExtra {
63
- MyEnumPlusExtra e = 1;
64
- repeated MyEnumPlusExtra repeated_e = 2;
65
- repeated MyEnumPlusExtra repeated_packed_e = 3 [packed=true];
66
- repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed=true];
67
- oneof o {
68
- MyEnumPlusExtra oneof_e_1 = 5;
69
- MyEnumPlusExtra oneof_e_2 = 6;
70
- }
71
- }
@@ -1,50 +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
- syntax = "proto2";
32
-
33
- package proto2_preserve_unknown_enum_unittest;
34
-
35
- enum MyEnum {
36
- FOO = 0;
37
- BAR = 1;
38
- BAZ = 2;
39
- }
40
-
41
- message MyMessage {
42
- optional MyEnum e = 1;
43
- repeated MyEnum repeated_e = 2;
44
- repeated MyEnum repeated_packed_e = 3 [packed=true];
45
- repeated MyEnum repeated_packed_unexpected_e = 4; // not packed
46
- oneof o {
47
- MyEnum oneof_e_1 = 5;
48
- MyEnum oneof_e_2 = 6;
49
- }
50
- }