google-protobuf 3.22.0-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of google-protobuf might be problematic. Click here for more details.

Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/ext/google/protobuf_c/convert.c +361 -0
  3. data/ext/google/protobuf_c/convert.h +75 -0
  4. data/ext/google/protobuf_c/defs.c +1280 -0
  5. data/ext/google/protobuf_c/defs.h +107 -0
  6. data/ext/google/protobuf_c/extconf.rb +27 -0
  7. data/ext/google/protobuf_c/map.c +687 -0
  8. data/ext/google/protobuf_c/map.h +66 -0
  9. data/ext/google/protobuf_c/message.c +1426 -0
  10. data/ext/google/protobuf_c/message.h +104 -0
  11. data/ext/google/protobuf_c/protobuf.c +480 -0
  12. data/ext/google/protobuf_c/protobuf.h +120 -0
  13. data/ext/google/protobuf_c/repeated_field.c +657 -0
  14. data/ext/google/protobuf_c/repeated_field.h +63 -0
  15. data/ext/google/protobuf_c/ruby-upb.c +13926 -0
  16. data/ext/google/protobuf_c/ruby-upb.h +10673 -0
  17. data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +22 -0
  18. data/ext/google/protobuf_c/third_party/utf8_range/naive.c +92 -0
  19. data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +157 -0
  20. data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +170 -0
  21. data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +21 -0
  22. data/ext/google/protobuf_c/wrap_memcpy.c +52 -0
  23. data/lib/google/2.6/protobuf_c.bundle +0 -0
  24. data/lib/google/2.7/protobuf_c.bundle +0 -0
  25. data/lib/google/3.0/protobuf_c.bundle +0 -0
  26. data/lib/google/3.1/protobuf_c.bundle +0 -0
  27. data/lib/google/3.2/protobuf_c.bundle +0 -0
  28. data/lib/google/protobuf/any_pb.rb +19 -0
  29. data/lib/google/protobuf/api_pb.rb +42 -0
  30. data/lib/google/protobuf/descriptor_dsl.rb +465 -0
  31. data/lib/google/protobuf/descriptor_pb.rb +298 -0
  32. data/lib/google/protobuf/duration_pb.rb +19 -0
  33. data/lib/google/protobuf/empty_pb.rb +17 -0
  34. data/lib/google/protobuf/field_mask_pb.rb +18 -0
  35. data/lib/google/protobuf/message_exts.rb +58 -0
  36. data/lib/google/protobuf/plugin_pb.rb +50 -0
  37. data/lib/google/protobuf/repeated_field.rb +201 -0
  38. data/lib/google/protobuf/source_context_pb.rb +18 -0
  39. data/lib/google/protobuf/struct_pb.rb +37 -0
  40. data/lib/google/protobuf/timestamp_pb.rb +19 -0
  41. data/lib/google/protobuf/type_pb.rb +92 -0
  42. data/lib/google/protobuf/well_known_types.rb +240 -0
  43. data/lib/google/protobuf/wrappers_pb.rb +50 -0
  44. data/lib/google/protobuf.rb +79 -0
  45. metadata +137 -0
@@ -0,0 +1,298 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/descriptor.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ descriptor_data = File.binread(__FILE__).split("\n__END__\n", 2)[1]
7
+ Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
8
+
9
+ module Google
10
+ module Protobuf
11
+ FileDescriptorSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorSet").msgclass
12
+ FileDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorProto").msgclass
13
+ DescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto").msgclass
14
+ DescriptorProto::ExtensionRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto.ExtensionRange").msgclass
15
+ DescriptorProto::ReservedRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto.ReservedRange").msgclass
16
+ ExtensionRangeOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ExtensionRangeOptions").msgclass
17
+ FieldDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto").msgclass
18
+ FieldDescriptorProto::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto.Type").enummodule
19
+ FieldDescriptorProto::Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto.Label").enummodule
20
+ OneofDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofDescriptorProto").msgclass
21
+ EnumDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumDescriptorProto").msgclass
22
+ EnumDescriptorProto::EnumReservedRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumDescriptorProto.EnumReservedRange").msgclass
23
+ EnumValueDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueDescriptorProto").msgclass
24
+ ServiceDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceDescriptorProto").msgclass
25
+ MethodDescriptorProto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodDescriptorProto").msgclass
26
+ FileOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileOptions").msgclass
27
+ FileOptions::OptimizeMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileOptions.OptimizeMode").enummodule
28
+ MessageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MessageOptions").msgclass
29
+ FieldOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions").msgclass
30
+ FieldOptions::CType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.CType").enummodule
31
+ FieldOptions::JSType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.JSType").enummodule
32
+ FieldOptions::OptionRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.OptionRetention").enummodule
33
+ FieldOptions::OptionTargetType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions.OptionTargetType").enummodule
34
+ OneofOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofOptions").msgclass
35
+ EnumOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumOptions").msgclass
36
+ EnumValueOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueOptions").msgclass
37
+ ServiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceOptions").msgclass
38
+ MethodOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodOptions").msgclass
39
+ MethodOptions::IdempotencyLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodOptions.IdempotencyLevel").enummodule
40
+ UninterpretedOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UninterpretedOption").msgclass
41
+ UninterpretedOption::NamePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UninterpretedOption.NamePart").msgclass
42
+ SourceCodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceCodeInfo").msgclass
43
+ SourceCodeInfo::Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceCodeInfo.Location").msgclass
44
+ GeneratedCodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo").msgclass
45
+ GeneratedCodeInfo::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo.Annotation").msgclass
46
+ GeneratedCodeInfo::Annotation::Semantic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo.Annotation.Semantic").enummodule
47
+ end
48
+ end
49
+
50
+ __END__
51
+
52
+ google/protobuf/descriptor.protogoogle.protobuf"G
53
+ FileDescriptorSet2
54
+ file ( 2$.google.protobuf.FileDescriptorProto"�
55
+ FileDescriptorProto
56
+ name ( 
57
+ package ( 
58
+
59
+ dependency ( 
60
+ public_dependency
61
+ (
62
+ weak_dependency (6
63
+ message_type ( 2 .google.protobuf.DescriptorProto7
64
+ enum_type ( 2$.google.protobuf.EnumDescriptorProto8
65
+ service ( 2'.google.protobuf.ServiceDescriptorProto8
66
+ extension ( 2%.google.protobuf.FieldDescriptorProto-
67
+ options ( 2.google.protobuf.FileOptions9
68
+ source_code_info ( 2.google.protobuf.SourceCodeInfo
69
+ syntax ( 
70
+ edition
71
  ( "�
72
+ DescriptorProto
73
+ name ( 4
74
+ field ( 2%.google.protobuf.FieldDescriptorProto8
75
+ extension ( 2%.google.protobuf.FieldDescriptorProto5
76
+ nested_type ( 2 .google.protobuf.DescriptorProto7
77
+ enum_type ( 2$.google.protobuf.EnumDescriptorProtoH
78
+ extension_range ( 2/.google.protobuf.DescriptorProto.ExtensionRange9
79
+
80
+ oneof_decl ( 2%.google.protobuf.OneofDescriptorProto0
81
+ options ( 2.google.protobuf.MessageOptionsF
82
+ reserved_range ( 2..google.protobuf.DescriptorProto.ReservedRange
83
+
84
+ ( e
85
+ ExtensionRange
86
+ start (
87
+ end (7
88
+ options ( 2&.google.protobuf.ExtensionRangeOptions+
89
+
90
+ start (
91
+ end ("g
92
+ ExtensionRangeOptionsC
93
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
94
+ FieldDescriptorProto
95
+ name ( 
96
+ number (:
97
+ label (2+.google.protobuf.FieldDescriptorProto.Label8
98
+ type (2*.google.protobuf.FieldDescriptorProto.Type
99
+ type_name ( 
100
+ extendee ( 
101
+
102
+ oneof_index (
103
+ json_name
104
+ ( .
105
+ options ( 2.google.protobuf.FieldOptions
106
+ proto3_optional ("�
107
+ Type
108
+ TYPE_DOUBLE
109
+
110
+ TYPE_FLOAT
111
+
112
+ TYPE_INT64
113
+ TYPE_UINT64
114
+
115
+ TYPE_INT32
116
+ TYPE_FIXED64
117
+ TYPE_FIXED32
118
+ TYPE_BOOL
119
+ TYPE_STRING 
120
+
121
+ TYPE_GROUP
122
+ 
123
+ TYPE_MESSAGE 
124
+
125
+ TYPE_BYTES 
126
+ TYPE_UINT32
127
+ TYPE_ENUM
128
+
129
+
130
+ TYPE_SINT32
131
+ TYPE_SINT64"C
132
+ Label
133
+ LABEL_OPTIONAL
134
+ LABEL_REQUIRED
135
+ LABEL_REPEATED"T
136
+ OneofDescriptorProto
137
+ name ( .
138
+ options ( 2.google.protobuf.OneofOptions"�
139
+ EnumDescriptorProto
140
+ name ( 8
141
+ value ( 2).google.protobuf.EnumValueDescriptorProto-
142
+ options ( 2.google.protobuf.EnumOptionsN
143
+ reserved_range ( 26.google.protobuf.EnumDescriptorProto.EnumReservedRange
144
+
145
+ EnumReservedRange
146
+ start (
147
+ end ("l
148
+ EnumValueDescriptorProto
149
+ name ( 
150
+ number (2
151
+ options ( 2!.google.protobuf.EnumValueOptions"�
152
+ ServiceDescriptorProto
153
+ name ( 6
154
+ method ( 2&.google.protobuf.MethodDescriptorProto0
155
+ options ( 2.google.protobuf.ServiceOptions"�
156
+ MethodDescriptorProto
157
+ name ( 
158
+
159
+ input_type ( 
160
+ output_type ( /
161
+ options ( 2.google.protobuf.MethodOptions
162
+ client_streaming (:false
163
+ server_streaming (:false"�
164
+ FileOptions
165
+ java_package ( 
166
+ java_outer_classname ( "
167
+ java_multiple_files
168
+ (:false)
169
+ java_generate_equals_and_hash (B%
170
+ java_string_check_utf8 (:falseF
171
+ optimize_for (2).google.protobuf.FileOptions.OptimizeMode:SPEED
172
+
173
+ go_package ( "
174
+ cc_generic_services (:false$
175
+ java_generic_services (:false"
176
+ py_generic_services (:false#
177
+ php_generic_services* (:false
178
+
179
+ deprecated (:false
180
+ cc_enable_arenas (:true
181
+ objc_class_prefix$ ( 
182
+ csharp_namespace% ( 
183
+ swift_prefix' ( 
184
+ php_class_prefix( ( 
185
+
186
+ php_metadata_namespace, ( 
187
+ ruby_package- ( C
188
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption":
189
+ OptimizeMode
190
+ SPEED
191
+ CODE_SIZE
192
+ LITE_RUNTIME* �����J&'"�
193
+ MessageOptions&
194
+ message_set_wire_format (:false.
195
+ no_standard_descriptor_accessor (:false
196
+
197
+ deprecated (:false
198
+ map_entry (2
199
+ &deprecated_legacy_json_field_conflicts (BC
200
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����JJJJ J 
201
+ "�
202
+ FieldOptions:
203
+ ctype (2#.google.protobuf.FieldOptions.CType:STRING
204
+ packed (?
205
+ jstype (2$.google.protobuf.FieldOptions.JSType: JS_NORMAL
206
+ lazy (:false
207
+ unverified_lazy (:false
208
+
209
+ deprecated (:false
210
+ weak
211
+ (:false
212
+ debug_redact (:false@
213
+ retention (2-.google.protobuf.FieldOptions.OptionRetention>
214
+ target (2..google.protobuf.FieldOptions.OptionTargetTypeC
215
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption"/
216
+ CType
217
+
218
+ STRING
219
+ CORD
220
+ STRING_PIECE"5
221
+ JSType
222
+ JS_NORMAL
223
+ JS_STRING
224
+ JS_NUMBER"U
225
+ OptionRetention
226
+ RETENTION_UNKNOWN
227
+ RETENTION_RUNTIME
228
+ RETENTION_SOURCE"�
229
+ OptionTargetType
230
+ TARGET_TYPE_UNKNOWN
231
+ TARGET_TYPE_FILE
232
+ TARGET_TYPE_EXTENSION_RANGE
233
+ TARGET_TYPE_MESSAGE
234
+ TARGET_TYPE_FIELD
235
+ TARGET_TYPE_ONEOF
236
+ TARGET_TYPE_ENUM
237
+ TARGET_TYPE_ENUM_ENTRY
238
+ TARGET_TYPE_SERVICE
239
+ TARGET_TYPE_METHOD * �����J"^
240
+ OneofOptionsC
241
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
242
+ EnumOptions
243
+ allow_alias (
244
+
245
+ deprecated (:false2
246
+ &deprecated_legacy_json_field_conflicts (BC
247
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����J"}
248
+ EnumValueOptions
249
+
250
+ deprecated (:falseC
251
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"{
252
+ ServiceOptions
253
+
254
+ deprecated! (:falseC
255
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption* �����"�
256
+
257
+
258
+ deprecated! (:false_
259
+ idempotency_level" (2/.google.protobuf.MethodOptions.IdempotencyLevel:IDEMPOTENCY_UNKNOWNC
260
+ uninterpreted_option� ( 2$.google.protobuf.UninterpretedOption"P
261
+ IdempotencyLevel
262
+ IDEMPOTENCY_UNKNOWN
263
+ NO_SIDE_EFFECTS
264
+
265
+ IDEMPOTENT* �����"�
266
+ UninterpretedOption;
267
+ name ( 2-.google.protobuf.UninterpretedOption.NamePart
268
+ identifier_value ( 
269
+ positive_int_value (
270
+ negative_int_value (
271
+ double_value (
272
+ string_value ( 
273
+ aggregate_value ( 3
274
+ NamePart
275
+ name_part ( 
276
+ is_extension ("�
277
+ SourceCodeInfo:
278
+ location ( 2(.google.protobuf.SourceCodeInfo.Location�
279
+ Location
280
+ path (B
281
+ span (B
282
+ leading_comments ( 
283
+ trailing_comments ( !
284
+ leading_detached_comments ( "�
285
+ GeneratedCodeInfoA
286
+
287
+ annotation ( 2-.google.protobuf.GeneratedCodeInfo.Annotation�
288
+
289
+ Annotation
290
+ path (B
291
+ source_file ( 
292
+ begin (
293
+ end (H
294
+ semantic (26.google.protobuf.GeneratedCodeInfo.Annotation.Semantic"(
295
+ Semantic
296
+ NONE
297
+ SET
298
+ ALIASB~
299
+ com.google.protobufBDescriptorProtosHZ-google.golang.org/protobuf/types/descriptorpb��GPB�Google.Protobuf.Reflection
@@ -0,0 +1,19 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/duration.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/protobuf/duration.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Duration" do
9
+ optional :seconds, :int64, 1
10
+ optional :nanos, :int32, 2
11
+ end
12
+ end
13
+ end
14
+
15
+ module Google
16
+ module Protobuf
17
+ Duration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/empty.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/protobuf/empty.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.Empty" do
9
+ end
10
+ end
11
+ end
12
+
13
+ module Google
14
+ module Protobuf
15
+ Empty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/field_mask.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/protobuf/field_mask.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.FieldMask" do
9
+ repeated :paths, :string, 1
10
+ end
11
+ end
12
+ end
13
+
14
+ module Google
15
+ module Protobuf
16
+ FieldMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass
17
+ end
18
+ end
@@ -0,0 +1,58 @@
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
+ module Google
32
+ module Protobuf
33
+ module MessageExts
34
+
35
+ #this is only called in jruby; mri loades the ClassMethods differently
36
+ def self.included(klass)
37
+ klass.extend(ClassMethods)
38
+ end
39
+
40
+ module ClassMethods
41
+ end
42
+
43
+ def to_json(options = {})
44
+ self.class.encode_json(self, options)
45
+ end
46
+
47
+ def to_proto(options = {})
48
+ self.class.encode(self, options)
49
+ end
50
+
51
+ end
52
+ class AbstractMessage
53
+ include MessageExts
54
+ extend MessageExts::ClassMethods
55
+ end
56
+ private_constant :AbstractMessage
57
+ end
58
+ end
@@ -0,0 +1,50 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/compiler/plugin.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/descriptor_pb'
7
+
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("google/protobuf/compiler/plugin.proto", :syntax => :proto2) do
10
+ add_message "google.protobuf.compiler.Version" do
11
+ optional :major, :int32, 1
12
+ optional :minor, :int32, 2
13
+ optional :patch, :int32, 3
14
+ optional :suffix, :string, 4
15
+ end
16
+ add_message "google.protobuf.compiler.CodeGeneratorRequest" do
17
+ repeated :file_to_generate, :string, 1
18
+ optional :parameter, :string, 2
19
+ repeated :proto_file, :message, 15, "google.protobuf.FileDescriptorProto"
20
+ optional :compiler_version, :message, 3, "google.protobuf.compiler.Version"
21
+ end
22
+ add_message "google.protobuf.compiler.CodeGeneratorResponse" do
23
+ optional :error, :string, 1
24
+ optional :supported_features, :uint64, 2
25
+ repeated :file, :message, 15, "google.protobuf.compiler.CodeGeneratorResponse.File"
26
+ end
27
+ add_message "google.protobuf.compiler.CodeGeneratorResponse.File" do
28
+ optional :name, :string, 1
29
+ optional :insertion_point, :string, 2
30
+ optional :content, :string, 15
31
+ optional :generated_code_info, :message, 16, "google.protobuf.GeneratedCodeInfo"
32
+ end
33
+ add_enum "google.protobuf.compiler.CodeGeneratorResponse.Feature" do
34
+ value :FEATURE_NONE, 0
35
+ value :FEATURE_PROTO3_OPTIONAL, 1
36
+ end
37
+ end
38
+ end
39
+
40
+ module Google
41
+ module Protobuf
42
+ module Compiler
43
+ Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.compiler.Version").msgclass
44
+ CodeGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.compiler.CodeGeneratorRequest").msgclass
45
+ CodeGeneratorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.compiler.CodeGeneratorResponse").msgclass
46
+ CodeGeneratorResponse::File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.compiler.CodeGeneratorResponse.File").msgclass
47
+ CodeGeneratorResponse::Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.compiler.CodeGeneratorResponse.Feature").enummodule
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,201 @@
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
+ require 'forwardable'
32
+
33
+ #
34
+ # This class makes RepeatedField act (almost-) like a Ruby Array.
35
+ # It has convenience methods that extend the core C or Java based
36
+ # methods.
37
+ #
38
+ # This is a best-effort to mirror Array behavior. Two comments:
39
+ # 1) patches always welcome :)
40
+ # 2) if performance is an issue, feel free to rewrite the method
41
+ # in jruby and C. The source code has plenty of examples
42
+ #
43
+ # KNOWN ISSUES
44
+ # - #[]= doesn't allow less used approaches such as `arr[1, 2] = 'fizz'`
45
+ # - #concat should return the orig array
46
+ # - #push should accept multiple arguments and push them all at the same time
47
+ #
48
+ module Google
49
+ module Protobuf
50
+ class RepeatedField
51
+ extend Forwardable
52
+
53
+ # methods defined in C or Java:
54
+ # +
55
+ # [], at
56
+ # []=
57
+ # concat
58
+ # clear
59
+ # dup, clone
60
+ # each
61
+ # push, <<
62
+ # replace
63
+ # length, size
64
+ # ==
65
+ # to_ary, to_a
66
+ # also all enumerable
67
+ #
68
+ # NOTE: using delegators rather than method_missing to make the
69
+ # relationship explicit instead of implicit
70
+ def_delegators :to_ary,
71
+ :&, :*, :-, :'<=>',
72
+ :assoc, :bsearch, :bsearch_index, :combination, :compact, :count,
73
+ :cycle, :dig, :drop, :drop_while, :eql?, :fetch, :find_index, :flatten,
74
+ :include?, :index, :inspect, :join,
75
+ :pack, :permutation, :product, :pretty_print, :pretty_print_cycle,
76
+ :rassoc, :repeated_combination, :repeated_permutation, :reverse,
77
+ :rindex, :rotate, :sample, :shuffle, :shelljoin,
78
+ :to_s, :transpose, :uniq, :|
79
+
80
+
81
+ def first(n=nil)
82
+ if n.nil?
83
+ return self[0]
84
+ elsif n < 0
85
+ raise ArgumentError, "negative array size"
86
+ else
87
+ return self[0...n]
88
+ end
89
+ end
90
+
91
+
92
+ def last(n=nil)
93
+ if n.nil?
94
+ return self[-1]
95
+ elsif n < 0
96
+ raise ArgumentError, "negative array size"
97
+ else
98
+ start = [self.size-n, 0].max
99
+ return self[start...self.size]
100
+ end
101
+ end
102
+
103
+
104
+ def pop(n=nil)
105
+ if n
106
+ results = []
107
+ n.times{ results << pop_one }
108
+ return results
109
+ else
110
+ return pop_one
111
+ end
112
+ end
113
+
114
+
115
+ def empty?
116
+ self.size == 0
117
+ end
118
+
119
+ # array aliases into enumerable
120
+ alias_method :each_index, :each_with_index
121
+ alias_method :slice, :[]
122
+ alias_method :values_at, :select
123
+ alias_method :map, :collect
124
+
125
+
126
+ class << self
127
+ def define_array_wrapper_method(method_name)
128
+ define_method(method_name) do |*args, &block|
129
+ arr = self.to_a
130
+ result = arr.send(method_name, *args)
131
+ self.replace(arr)
132
+ return result if result
133
+ return block ? block.call : result
134
+ end
135
+ end
136
+ private :define_array_wrapper_method
137
+
138
+
139
+ def define_array_wrapper_with_result_method(method_name)
140
+ define_method(method_name) do |*args, &block|
141
+ # result can be an Enumerator, Array, or nil
142
+ # Enumerator can sometimes be returned if a block is an optional argument and it is not passed in
143
+ # nil usually specifies that no change was made
144
+ result = self.to_a.send(method_name, *args, &block)
145
+ if result
146
+ new_arr = result.to_a
147
+ self.replace(new_arr)
148
+ if result.is_a?(Enumerator)
149
+ # generate a fresh enum; rewinding the exiting one, in Ruby 2.2, will
150
+ # reset the enum with the same length, but all the #next calls will
151
+ # return nil
152
+ result = new_arr.to_enum
153
+ # generate a wrapper enum so any changes which occur by a chained
154
+ # enum can be captured
155
+ ie = ProxyingEnumerator.new(self, result)
156
+ result = ie.to_enum
157
+ end
158
+ end
159
+ result
160
+ end
161
+ end
162
+ private :define_array_wrapper_with_result_method
163
+ end
164
+
165
+
166
+ %w(delete delete_at shift slice! unshift).each do |method_name|
167
+ define_array_wrapper_method(method_name)
168
+ end
169
+
170
+
171
+ %w(collect! compact! delete_if fill flatten! insert reverse!
172
+ rotate! select! shuffle! sort! sort_by! uniq!).each do |method_name|
173
+ define_array_wrapper_with_result_method(method_name)
174
+ end
175
+ alias_method :keep_if, :select!
176
+ alias_method :map!, :collect!
177
+ alias_method :reject!, :delete_if
178
+
179
+
180
+ # propagates changes made by user of enumerator back to the original repeated field.
181
+ # This only applies in cases where the calling function which created the enumerator,
182
+ # such as #sort!, modifies itself rather than a new array, such as #sort
183
+ class ProxyingEnumerator < Struct.new(:repeated_field, :external_enumerator)
184
+ def each(*args, &block)
185
+ results = []
186
+ external_enumerator.each_with_index do |val, i|
187
+ result = yield(val)
188
+ results << result
189
+ #nil means no change occurred from yield; usually occurs when #to_a is called
190
+ if result
191
+ repeated_field[i] = result if result != val
192
+ end
193
+ end
194
+ results
195
+ end
196
+ end
197
+
198
+
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,18 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/protobuf/source_context.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/protobuf/source_context.proto", :syntax => :proto3) do
8
+ add_message "google.protobuf.SourceContext" do
9
+ optional :file_name, :string, 1
10
+ end
11
+ end
12
+ end
13
+
14
+ module Google
15
+ module Protobuf
16
+ SourceContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass
17
+ end
18
+ end