effigy_wire 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/BIN_README.txt +18 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +3 -0
  6. data/Gemfile.lock +40 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +7 -0
  9. data/Rakefile +2 -0
  10. data/bin/clarity-protobuf/clean +36 -0
  11. data/bin/clarity-protobuf/copy +75 -0
  12. data/bin/effigy/compile-proto +81 -0
  13. data/bin/effigy/mk-require-turds +43 -0
  14. data/bin/effigy/package +56 -0
  15. data/bin/effigy/tweak-proto +30 -0
  16. data/bin/effigy/tweak-rb +20 -0
  17. data/effigy_wire.gemspec +24 -0
  18. data/lib/effigy/wire/demo.pb.rb +205 -0
  19. data/lib/effigy/wire/dota_commonmessages.pb.rb +209 -0
  20. data/lib/effigy/wire/dota_modifiers.pb.rb +78 -0
  21. data/lib/effigy/wire/dota_usermessages.pb.rb +1315 -0
  22. data/lib/effigy/wire/netmessages.pb.rb +177 -0
  23. data/lib/effigy/wire/networkbasetypes.pb.rb +268 -0
  24. data/lib/effigy/wire/s1/s1_dota_usermessages.pb.rb +102 -0
  25. data/lib/effigy/wire/s1/s1_netmessages.pb.rb +121 -0
  26. data/lib/effigy/wire/s1/s1_usermessages.pb.rb +271 -0
  27. data/lib/effigy/wire/s1.rb +3 -0
  28. data/lib/effigy/wire/s2/s2_base_gcmessages.pb.rb +57 -0
  29. data/lib/effigy/wire/s2/s2_dota_gcmessages_common.pb.rb +214 -0
  30. data/lib/effigy/wire/s2/s2_dota_match_metadata.pb.rb +106 -0
  31. data/lib/effigy/wire/s2/s2_dota_usermessages.pb.rb +117 -0
  32. data/lib/effigy/wire/s2/s2_gameevents.pb.rb +172 -0
  33. data/lib/effigy/wire/s2/s2_netmessages.pb.rb +158 -0
  34. data/lib/effigy/wire/s2/s2_te.pb.rb +330 -0
  35. data/lib/effigy/wire/s2/s2_usermessages.pb.rb +514 -0
  36. data/lib/effigy/wire/s2.rb +3 -0
  37. data/lib/effigy/wire.rb +9 -0
  38. data/lib/effigy.rb +3 -0
  39. data/proto/demo.proto +157 -0
  40. data/proto/dota_commonmessages.proto +183 -0
  41. data/proto/dota_modifiers.proto +54 -0
  42. data/proto/dota_usermessages.proto +1152 -0
  43. data/proto/netmessages.proto +133 -0
  44. data/proto/networkbasetypes.proto +219 -0
  45. data/proto/s1/google/protobuf/descriptor.proto +622 -0
  46. data/proto/s1/s1_dota_usermessages.proto +89 -0
  47. data/proto/s1/s1_netmessages.proto +86 -0
  48. data/proto/s1/s1_usermessages.proto +217 -0
  49. data/proto/s2/google/protobuf/descriptor.proto +622 -0
  50. data/proto/s2/s2_base_gcmessages.proto +37 -0
  51. data/proto/s2/s2_dota_gcmessages_common.proto +177 -0
  52. data/proto/s2/s2_dota_match_metadata.proto +67 -0
  53. data/proto/s2/s2_dota_usermessages.proto +104 -0
  54. data/proto/s2/s2_gameevents.proto +125 -0
  55. data/proto/s2/s2_netmessages.proto +120 -0
  56. data/proto/s2/s2_te.proto +276 -0
  57. data/proto/s2/s2_usermessages.proto +434 -0
  58. metadata +148 -0
@@ -0,0 +1,622 @@
1
+ package effigy.wire.s1.google.protobuf;
2
+
3
+ // Protocol Buffers - Google's data interchange format
4
+ // Copyright 2008 Google Inc. All rights reserved.
5
+ // http://code.google.com/p/protobuf/
6
+ //
7
+ // Redistribution and use in source and binary forms, with or without
8
+ // modification, are permitted provided that the following conditions are
9
+ // met:
10
+ //
11
+ // * Redistributions of source code must retain the above copyright
12
+ // notice, this list of conditions and the following disclaimer.
13
+ // * Redistributions in binary form must reproduce the above
14
+ // copyright notice, this list of conditions and the following disclaimer
15
+ // in the documentation and/or other materials provided with the
16
+ // distribution.
17
+ // * Neither the name of Google Inc. nor the names of its
18
+ // contributors may be used to endorse or promote products derived from
19
+ // this software without specific prior written permission.
20
+ //
21
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+
33
+ // Author: kenton@google.com (Kenton Varda)
34
+ // Based on original Protocol Buffers design by
35
+ // Sanjay Ghemawat, Jeff Dean, and others.
36
+ //
37
+ // The messages in this file describe the definitions found in .proto files.
38
+ // A valid .proto file can be translated directly to a FileDescriptorProto
39
+ // without any other information (e.g. without reading its imports).
40
+
41
+
42
+
43
+ package google.protobuf;
44
+ option java_package = "com.google.protobuf";
45
+ option java_outer_classname = "DescriptorProtos";
46
+
47
+ // descriptor.proto must be optimized for speed because reflection-based
48
+ // algorithms don't work during bootstrapping.
49
+ option optimize_for = SPEED;
50
+
51
+ // The protocol compiler can output a FileDescriptorSet containing the .proto
52
+ // files it parses.
53
+ message FileDescriptorSet {
54
+ repeated FileDescriptorProto file = 1;
55
+ }
56
+
57
+ // Describes a complete .proto file.
58
+ message FileDescriptorProto {
59
+ optional string name = 1; // file name, relative to root of source tree
60
+ optional string package = 2; // e.g. "foo", "foo.bar", etc.
61
+
62
+ // Names of files imported by this file.
63
+ repeated string dependency = 3;
64
+ // Indexes of the public imported files in the dependency list above.
65
+ repeated int32 public_dependency = 10;
66
+ // Indexes of the weak imported files in the dependency list.
67
+ // For Google-internal migration only. Do not use.
68
+ repeated int32 weak_dependency = 11;
69
+
70
+ // All top-level definitions in this file.
71
+ repeated DescriptorProto message_type = 4;
72
+ repeated EnumDescriptorProto enum_type = 5;
73
+ repeated ServiceDescriptorProto service = 6;
74
+ repeated FieldDescriptorProto extension = 7;
75
+
76
+ optional FileOptions options = 8;
77
+
78
+ // This field contains optional information about the original source code.
79
+ // You may safely remove this entire field whithout harming runtime
80
+ // functionality of the descriptors -- the information is needed only by
81
+ // development tools.
82
+ optional SourceCodeInfo source_code_info = 9;
83
+ }
84
+
85
+ // Describes a message type.
86
+ message DescriptorProto {
87
+ optional string name = 1;
88
+
89
+ repeated FieldDescriptorProto field = 2;
90
+ repeated FieldDescriptorProto extension = 6;
91
+
92
+ repeated DescriptorProto nested_type = 3;
93
+ repeated EnumDescriptorProto enum_type = 4;
94
+
95
+ message ExtensionRange {
96
+ optional int32 start = 1;
97
+ optional int32 end = 2;
98
+ }
99
+ repeated ExtensionRange extension_range = 5;
100
+
101
+ optional MessageOptions options = 7;
102
+ }
103
+
104
+ // Describes a field within a message.
105
+ message FieldDescriptorProto {
106
+ enum Type {
107
+ // 0 is reserved for errors.
108
+ // Order is weird for historical reasons.
109
+ TYPE_DOUBLE = 1;
110
+ TYPE_FLOAT = 2;
111
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
112
+ // negative values are likely.
113
+ TYPE_INT64 = 3;
114
+ TYPE_UINT64 = 4;
115
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
116
+ // negative values are likely.
117
+ TYPE_INT32 = 5;
118
+ TYPE_FIXED64 = 6;
119
+ TYPE_FIXED32 = 7;
120
+ TYPE_BOOL = 8;
121
+ TYPE_STRING = 9;
122
+ TYPE_GROUP = 10; // Tag-delimited aggregate.
123
+ TYPE_MESSAGE = 11; // Length-delimited aggregate.
124
+
125
+ // New in version 2.
126
+ TYPE_BYTES = 12;
127
+ TYPE_UINT32 = 13;
128
+ TYPE_ENUM = 14;
129
+ TYPE_SFIXED32 = 15;
130
+ TYPE_SFIXED64 = 16;
131
+ TYPE_SINT32 = 17; // Uses ZigZag encoding.
132
+ TYPE_SINT64 = 18; // Uses ZigZag encoding.
133
+ };
134
+
135
+ enum Label {
136
+ // 0 is reserved for errors
137
+ LABEL_OPTIONAL = 1;
138
+ LABEL_REQUIRED = 2;
139
+ LABEL_REPEATED = 3;
140
+ // TODO(sanjay): Should we add LABEL_MAP?
141
+ };
142
+
143
+ optional string name = 1;
144
+ optional int32 number = 3;
145
+ optional Label label = 4;
146
+
147
+ // If type_name is set, this need not be set. If both this and type_name
148
+ // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.
149
+ optional Type type = 5;
150
+
151
+ // For message and enum types, this is the name of the type. If the name
152
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
153
+ // rules are used to find the type (i.e. first the nested types within this
154
+ // message are searched, then within the parent, on up to the root
155
+ // namespace).
156
+ optional string type_name = 6;
157
+
158
+ // For extensions, this is the name of the type being extended. It is
159
+ // resolved in the same manner as type_name.
160
+ optional string extendee = 2;
161
+
162
+ // For numeric types, contains the original text representation of the value.
163
+ // For booleans, "true" or "false".
164
+ // For strings, contains the default text contents (not escaped in any way).
165
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
166
+ // TODO(kenton): Base-64 encode?
167
+ optional string default_value = 7;
168
+
169
+ optional FieldOptions options = 8;
170
+ }
171
+
172
+ // Describes an enum type.
173
+ message EnumDescriptorProto {
174
+ optional string name = 1;
175
+
176
+ repeated EnumValueDescriptorProto value = 2;
177
+
178
+ optional EnumOptions options = 3;
179
+ }
180
+
181
+ // Describes a value within an enum.
182
+ message EnumValueDescriptorProto {
183
+ optional string name = 1;
184
+ optional int32 number = 2;
185
+
186
+ optional EnumValueOptions options = 3;
187
+ }
188
+
189
+ // Describes a service.
190
+ message ServiceDescriptorProto {
191
+ optional string name = 1;
192
+ repeated MethodDescriptorProto method = 2;
193
+
194
+ optional ServiceOptions options = 3;
195
+ }
196
+
197
+ // Describes a method of a service.
198
+ message MethodDescriptorProto {
199
+ optional string name = 1;
200
+
201
+ // Input and output type names. These are resolved in the same way as
202
+ // FieldDescriptorProto.type_name, but must refer to a message type.
203
+ optional string input_type = 2;
204
+ optional string output_type = 3;
205
+
206
+ optional MethodOptions options = 4;
207
+ }
208
+
209
+
210
+ // ===================================================================
211
+ // Options
212
+
213
+ // Each of the definitions above may have "options" attached. These are
214
+ // just annotations which may cause code to be generated slightly differently
215
+ // or may contain hints for code that manipulates protocol messages.
216
+ //
217
+ // Clients may define custom options as extensions of the *Options messages.
218
+ // These extensions may not yet be known at parsing time, so the parser cannot
219
+ // store the values in them. Instead it stores them in a field in the *Options
220
+ // message called uninterpreted_option. This field must have the same name
221
+ // across all *Options messages. We then use this field to populate the
222
+ // extensions when we build a descriptor, at which point all protos have been
223
+ // parsed and so all extensions are known.
224
+ //
225
+ // Extension numbers for custom options may be chosen as follows:
226
+ // * For options which will only be used within a single application or
227
+ // organization, or for experimental options, use field numbers 50000
228
+ // through 99999. It is up to you to ensure that you do not use the
229
+ // same number for multiple options.
230
+ // * For options which will be published and used publicly by multiple
231
+ // independent entities, e-mail protobuf-global-extension-registry@google.com
232
+ // to reserve extension numbers. Simply provide your project name (e.g.
233
+ // Object-C plugin) and your porject website (if available) -- there's no need
234
+ // to explain how you intend to use them. Usually you only need one extension
235
+ // number. You can declare multiple options with only one extension number by
236
+ // putting them in a sub-message. See the Custom Options section of the docs
237
+ // for examples:
238
+ // http://code.google.com/apis/protocolbuffers/docs/proto.html#options
239
+ // If this turns out to be popular, a web service will be set up
240
+ // to automatically assign option numbers.
241
+
242
+
243
+ message FileOptions {
244
+
245
+ // Sets the Java package where classes generated from this .proto will be
246
+ // placed. By default, the proto package is used, but this is often
247
+ // inappropriate because proto packages do not normally start with backwards
248
+ // domain names.
249
+ optional string java_package = 1;
250
+
251
+
252
+ // If set, all the classes from the .proto file are wrapped in a single
253
+ // outer class with the given name. This applies to both Proto1
254
+ // (equivalent to the old "--one_java_file" option) and Proto2 (where
255
+ // a .proto always translates to a single class, but you may want to
256
+ // explicitly choose the class name).
257
+ optional string java_outer_classname = 8;
258
+
259
+ // If set true, then the Java code generator will generate a separate .java
260
+ // file for each top-level message, enum, and service defined in the .proto
261
+ // file. Thus, these types will *not* be nested inside the outer class
262
+ // named by java_outer_classname. However, the outer class will still be
263
+ // generated to contain the file's getDescriptor() method as well as any
264
+ // top-level extensions defined in the file.
265
+ optional bool java_multiple_files = 10 [default=false];
266
+
267
+ // If set true, then the Java code generator will generate equals() and
268
+ // hashCode() methods for all messages defined in the .proto file. This is
269
+ // purely a speed optimization, as the AbstractMessage base class includes
270
+ // reflection-based implementations of these methods.
271
+ optional bool java_generate_equals_and_hash = 20 [default=false];
272
+
273
+ // Generated classes can be optimized for speed or code size.
274
+ enum OptimizeMode {
275
+ SPEED = 1; // Generate complete code for parsing, serialization,
276
+ // etc.
277
+ CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
278
+ LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
279
+ }
280
+ optional OptimizeMode optimize_for = 9 [default=SPEED];
281
+
282
+ // Sets the Go package where structs generated from this .proto will be
283
+ // placed. There is no default.
284
+ optional string go_package = 11;
285
+
286
+
287
+
288
+ // Should generic services be generated in each language? "Generic" services
289
+ // are not specific to any particular RPC system. They are generated by the
290
+ // main code generators in each language (without additional plugins).
291
+ // Generic services were the only kind of service generation supported by
292
+ // early versions of proto2.
293
+ //
294
+ // Generic services are now considered deprecated in favor of using plugins
295
+ // that generate code specific to your particular RPC system. Therefore,
296
+ // these default to false. Old code which depends on generic services should
297
+ // explicitly set them to true.
298
+ optional bool cc_generic_services = 16 [default=false];
299
+ optional bool java_generic_services = 17 [default=false];
300
+ optional bool py_generic_services = 18 [default=false];
301
+
302
+ // The parser stores options it doesn't recognize here. See above.
303
+ repeated UninterpretedOption uninterpreted_option = 999;
304
+
305
+ // Clients can define custom options in extensions of this message. See above.
306
+ extensions 1000 to max;
307
+ }
308
+
309
+ message MessageOptions {
310
+ // Set true to use the old proto1 MessageSet wire format for extensions.
311
+ // This is provided for backwards-compatibility with the MessageSet wire
312
+ // format. You should not use this for any other reason: It's less
313
+ // efficient, has fewer features, and is more complicated.
314
+ //
315
+ // The message must be defined exactly as follows:
316
+ // message Foo {
317
+ // option message_set_wire_format = true;
318
+ // extensions 4 to max;
319
+ // }
320
+ // Note that the message cannot have any defined fields; MessageSets only
321
+ // have extensions.
322
+ //
323
+ // All extensions of your type must be singular messages; e.g. they cannot
324
+ // be int32s, enums, or repeated messages.
325
+ //
326
+ // Because this is an option, the above two restrictions are not enforced by
327
+ // the protocol compiler.
328
+ optional bool message_set_wire_format = 1 [default=false];
329
+
330
+ // Disables the generation of the standard "descriptor()" accessor, which can
331
+ // conflict with a field of the same name. This is meant to make migration
332
+ // from proto1 easier; new code should avoid fields named "descriptor".
333
+ optional bool no_standard_descriptor_accessor = 2 [default=false];
334
+
335
+ // The parser stores options it doesn't recognize here. See above.
336
+ repeated UninterpretedOption uninterpreted_option = 999;
337
+
338
+ // Clients can define custom options in extensions of this message. See above.
339
+ extensions 1000 to max;
340
+ }
341
+
342
+ message FieldOptions {
343
+ // The ctype option instructs the C++ code generator to use a different
344
+ // representation of the field than it normally would. See the specific
345
+ // options below. This option is not yet implemented in the open source
346
+ // release -- sorry, we'll try to include it in a future version!
347
+ optional CType ctype = 1 [default = STRING];
348
+ enum CType {
349
+ // Default mode.
350
+ STRING = 0;
351
+
352
+ CORD = 1;
353
+
354
+ STRING_PIECE = 2;
355
+ }
356
+ // The packed option can be enabled for repeated primitive fields to enable
357
+ // a more efficient representation on the wire. Rather than repeatedly
358
+ // writing the tag and type for each element, the entire array is encoded as
359
+ // a single length-delimited blob.
360
+ optional bool packed = 2;
361
+
362
+
363
+
364
+ // Should this field be parsed lazily? Lazy applies only to message-type
365
+ // fields. It means that when the outer message is initially parsed, the
366
+ // inner message's contents will not be parsed but instead stored in encoded
367
+ // form. The inner message will actually be parsed when it is first accessed.
368
+ //
369
+ // This is only a hint. Implementations are free to choose whether to use
370
+ // eager or lazy parsing regardless of the value of this option. However,
371
+ // setting this option true suggests that the protocol author believes that
372
+ // using lazy parsing on this field is worth the additional bookkeeping
373
+ // overhead typically needed to implement it.
374
+ //
375
+ // This option does not affect the public interface of any generated code;
376
+ // all method signatures remain the same. Furthermore, thread-safety of the
377
+ // interface is not affected by this option; const methods remain safe to
378
+ // call from multiple threads concurrently, while non-const methods continue
379
+ // to require exclusive access.
380
+ //
381
+ //
382
+ // Note that implementations may choose not to check required fields within
383
+ // a lazy sub-message. That is, calling IsInitialized() on the outher message
384
+ // may return true even if the inner message has missing required fields.
385
+ // This is necessary because otherwise the inner message would have to be
386
+ // parsed in order to perform the check, defeating the purpose of lazy
387
+ // parsing. An implementation which chooses not to check required fields
388
+ // must be consistent about it. That is, for any particular sub-message, the
389
+ // implementation must either *always* check its required fields, or *never*
390
+ // check its required fields, regardless of whether or not the message has
391
+ // been parsed.
392
+ optional bool lazy = 5 [default=false];
393
+
394
+ // Is this field deprecated?
395
+ // Depending on the target platform, this can emit Deprecated annotations
396
+ // for accessors, or it will be completely ignored; in the very least, this
397
+ // is a formalization for deprecating fields.
398
+ optional bool deprecated = 3 [default=false];
399
+
400
+ // EXPERIMENTAL. DO NOT USE.
401
+ // For "map" fields, the name of the field in the enclosed type that
402
+ // is the key for this map. For example, suppose we have:
403
+ // message Item {
404
+ // required string name = 1;
405
+ // required string value = 2;
406
+ // }
407
+ // message Config {
408
+ // repeated Item items = 1 [experimental_map_key="name"];
409
+ // }
410
+ // In this situation, the map key for Item will be set to "name".
411
+ // TODO: Fully-implement this, then remove the "experimental_" prefix.
412
+ optional string experimental_map_key = 9;
413
+
414
+ // For Google-internal migration only. Do not use.
415
+ optional bool weak = 10 [default=false];
416
+
417
+ // The parser stores options it doesn't recognize here. See above.
418
+ repeated UninterpretedOption uninterpreted_option = 999;
419
+
420
+ // Clients can define custom options in extensions of this message. See above.
421
+ extensions 1000 to max;
422
+ }
423
+
424
+ message EnumOptions {
425
+
426
+ // Set this option to false to disallow mapping different tag names to a same
427
+ // value.
428
+ optional bool allow_alias = 2 [default=true];
429
+
430
+ // The parser stores options it doesn't recognize here. See above.
431
+ repeated UninterpretedOption uninterpreted_option = 999;
432
+
433
+ // Clients can define custom options in extensions of this message. See above.
434
+ extensions 1000 to max;
435
+ }
436
+
437
+ message EnumValueOptions {
438
+ // The parser stores options it doesn't recognize here. See above.
439
+ repeated UninterpretedOption uninterpreted_option = 999;
440
+
441
+ // Clients can define custom options in extensions of this message. See above.
442
+ extensions 1000 to max;
443
+ }
444
+
445
+ message ServiceOptions {
446
+
447
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
448
+ // framework. We apologize for hoarding these numbers to ourselves, but
449
+ // we were already using them long before we decided to release Protocol
450
+ // Buffers.
451
+
452
+ // The parser stores options it doesn't recognize here. See above.
453
+ repeated UninterpretedOption uninterpreted_option = 999;
454
+
455
+ // Clients can define custom options in extensions of this message. See above.
456
+ extensions 1000 to max;
457
+ }
458
+
459
+ message MethodOptions {
460
+
461
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
462
+ // framework. We apologize for hoarding these numbers to ourselves, but
463
+ // we were already using them long before we decided to release Protocol
464
+ // Buffers.
465
+
466
+ // The parser stores options it doesn't recognize here. See above.
467
+ repeated UninterpretedOption uninterpreted_option = 999;
468
+
469
+ // Clients can define custom options in extensions of this message. See above.
470
+ extensions 1000 to max;
471
+ }
472
+
473
+
474
+ // A message representing a option the parser does not recognize. This only
475
+ // appears in options protos created by the compiler::Parser class.
476
+ // DescriptorPool resolves these when building Descriptor objects. Therefore,
477
+ // options protos in descriptor objects (e.g. returned by Descriptor::options(),
478
+ // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
479
+ // in them.
480
+ message UninterpretedOption {
481
+ // The name of the uninterpreted option. Each string represents a segment in
482
+ // a dot-separated name. is_extension is true iff a segment represents an
483
+ // extension (denoted with parentheses in options specs in .proto files).
484
+ // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
485
+ // "foo.(bar.baz).qux".
486
+ message NamePart {
487
+ required string name_part = 1;
488
+ required bool is_extension = 2;
489
+ }
490
+ repeated NamePart name = 2;
491
+
492
+ // The value of the uninterpreted option, in whatever type the tokenizer
493
+ // identified it as during parsing. Exactly one of these should be set.
494
+ optional string identifier_value = 3;
495
+ optional uint64 positive_int_value = 4;
496
+ optional int64 negative_int_value = 5;
497
+ optional double double_value = 6;
498
+ optional bytes string_value = 7;
499
+ optional string aggregate_value = 8;
500
+ }
501
+
502
+ // ===================================================================
503
+ // Optional source code info
504
+
505
+ // Encapsulates information about the original source file from which a
506
+ // FileDescriptorProto was generated.
507
+ message SourceCodeInfo {
508
+ // A Location identifies a piece of source code in a .proto file which
509
+ // corresponds to a particular definition. This information is intended
510
+ // to be useful to IDEs, code indexers, documentation generators, and similar
511
+ // tools.
512
+ //
513
+ // For example, say we have a file like:
514
+ // message Foo {
515
+ // optional string foo = 1;
516
+ // }
517
+ // Let's look at just the field definition:
518
+ // optional string foo = 1;
519
+ // ^ ^^ ^^ ^ ^^^
520
+ // a bc de f ghi
521
+ // We have the following locations:
522
+ // span path represents
523
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
524
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
525
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
526
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
527
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
528
+ //
529
+ // Notes:
530
+ // - A location may refer to a repeated field itself (i.e. not to any
531
+ // particular index within it). This is used whenever a set of elements are
532
+ // logically enclosed in a single code segment. For example, an entire
533
+ // extend block (possibly containing multiple extension definitions) will
534
+ // have an outer location whose path refers to the "extensions" repeated
535
+ // field without an index.
536
+ // - Multiple locations may have the same path. This happens when a single
537
+ // logical declaration is spread out across multiple places. The most
538
+ // obvious example is the "extend" block again -- there may be multiple
539
+ // extend blocks in the same scope, each of which will have the same path.
540
+ // - A location's span is not always a subset of its parent's span. For
541
+ // example, the "extendee" of an extension declaration appears at the
542
+ // beginning of the "extend" block and is shared by all extensions within
543
+ // the block.
544
+ // - Just because a location's span is a subset of some other location's span
545
+ // does not mean that it is a descendent. For example, a "group" defines
546
+ // both a type and a field in a single declaration. Thus, the locations
547
+ // corresponding to the type and field and their components will overlap.
548
+ // - Code which tries to interpret locations should probably be designed to
549
+ // ignore those that it doesn't understand, as more types of locations could
550
+ // be recorded in the future.
551
+ repeated Location location = 1;
552
+ message Location {
553
+ // Identifies which part of the FileDescriptorProto was defined at this
554
+ // location.
555
+ //
556
+ // Each element is a field number or an index. They form a path from
557
+ // the root FileDescriptorProto to the place where the definition. For
558
+ // example, this path:
559
+ // [ 4, 3, 2, 7, 1 ]
560
+ // refers to:
561
+ // file.message_type(3) // 4, 3
562
+ // .field(7) // 2, 7
563
+ // .name() // 1
564
+ // This is because FileDescriptorProto.message_type has field number 4:
565
+ // repeated DescriptorProto message_type = 4;
566
+ // and DescriptorProto.field has field number 2:
567
+ // repeated FieldDescriptorProto field = 2;
568
+ // and FieldDescriptorProto.name has field number 1:
569
+ // optional string name = 1;
570
+ //
571
+ // Thus, the above path gives the location of a field name. If we removed
572
+ // the last element:
573
+ // [ 4, 3, 2, 7 ]
574
+ // this path refers to the whole field declaration (from the beginning
575
+ // of the label to the terminating semicolon).
576
+ repeated int32 path = 1 [packed=true];
577
+
578
+ // Always has exactly three or four elements: start line, start column,
579
+ // end line (optional, otherwise assumed same as start line), end column.
580
+ // These are packed into a single field for efficiency. Note that line
581
+ // and column numbers are zero-based -- typically you will want to add
582
+ // 1 to each before displaying to a user.
583
+ repeated int32 span = 2 [packed=true];
584
+
585
+ // If this SourceCodeInfo represents a complete declaration, these are any
586
+ // comments appearing before and after the declaration which appear to be
587
+ // attached to the declaration.
588
+ //
589
+ // A series of line comments appearing on consecutive lines, with no other
590
+ // tokens appearing on those lines, will be treated as a single comment.
591
+ //
592
+ // Only the comment content is provided; comment markers (e.g. //) are
593
+ // stripped out. For block comments, leading whitespace and an asterisk
594
+ // will be stripped from the beginning of each line other than the first.
595
+ // Newlines are included in the output.
596
+ //
597
+ // Examples:
598
+ //
599
+ // optional int32 foo = 1; // Comment attached to foo.
600
+ // // Comment attached to bar.
601
+ // optional int32 bar = 2;
602
+ //
603
+ // optional string baz = 3;
604
+ // // Comment attached to baz.
605
+ // // Another line attached to baz.
606
+ //
607
+ // // Comment attached to qux.
608
+ // //
609
+ // // Another line attached to qux.
610
+ // optional double qux = 4;
611
+ //
612
+ // optional string corge = 5;
613
+ // /* Block comment attached
614
+ // * to corge. Leading asterisks
615
+ // * will be removed. */
616
+ // /* Block comment attached to
617
+ // * grault. */
618
+ // optional int32 grault = 6;
619
+ optional string leading_comments = 3;
620
+ optional string trailing_comments = 4;
621
+ }
622
+ }