aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/descriptor.proto
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/descriptor.proto')
-rw-r--r--src/google/protobuf/descriptor.proto81
1 files changed, 69 insertions, 12 deletions
diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto
index e17c0cc8..9d3dd8fb 100644
--- a/src/google/protobuf/descriptor.proto
+++ b/src/google/protobuf/descriptor.proto
@@ -40,8 +40,12 @@
syntax = "proto2";
package google.protobuf;
+option go_package = "descriptor";
option java_package = "com.google.protobuf";
+option javanano_use_deprecated_package = true;
option java_outer_classname = "DescriptorProtos";
+option csharp_namespace = "Google.Protobuf.Reflection";
+option objc_class_prefix = "GPB";
// descriptor.proto must be optimized for speed because reflection-based
// algorithms don't work during bootstrapping.
@@ -104,6 +108,18 @@ message DescriptorProto {
repeated OneofDescriptorProto oneof_decl = 8;
optional MessageOptions options = 7;
+
+ // Range of reserved tag numbers. Reserved tag numbers may not be used by
+ // fields or extension ranges in the same message. Reserved ranges may
+ // not overlap.
+ message ReservedRange {
+ optional int32 start = 1; // Inclusive.
+ optional int32 end = 2; // Exclusive.
+ }
+ repeated ReservedRange reserved_range = 9;
+ // Reserved field names, which may not be used by fields in the same message.
+ // A given name may only be reserved once.
+ repeated string reserved_name = 10;
}
// Describes a field within a message.
@@ -172,9 +188,7 @@ message FieldDescriptorProto {
optional string default_value = 7;
// If set, gives the index of a oneof in the containing type's oneof_decl
- // list. This field is a member of that oneof. Extensions of a oneof should
- // not set this since the oneof to which they belong will be inferred based
- // on the extension range containing the extension's field number.
+ // list. This field is a member of that oneof.
optional int32 oneof_index = 9;
optional FieldOptions options = 8;
@@ -251,11 +265,11 @@ message MethodDescriptorProto {
// * For options which will be published and used publicly by multiple
// independent entities, e-mail protobuf-global-extension-registry@google.com
// to reserve extension numbers. Simply provide your project name (e.g.
-// Object-C plugin) and your porject website (if available) -- there's no need
-// to explain how you intend to use them. Usually you only need one extension
-// number. You can declare multiple options with only one extension number by
-// putting them in a sub-message. See the Custom Options section of the docs
-// for examples:
+// Objective-C plugin) and your project website (if available) -- there's no
+// need to explain how you intend to use them. Usually you only need one
+// extension number. You can declare multiple options with only one extension
+// number by putting them in a sub-message. See the Custom Options section of
+// the docs for examples:
// https://developers.google.com/protocol-buffers/docs/proto#options
// If this turns out to be popular, a web service will be set up
// to automatically assign option numbers.
@@ -344,12 +358,22 @@ message FileOptions {
// least, this is a formalization for deprecating files.
optional bool deprecated = 23 [default=false];
-
// Enables the use of arenas for the proto messages in this file. This applies
// only to generated classes for C++.
optional bool cc_enable_arenas = 31 [default=false];
+ // Sets the objective c class prefix which is prepended to all objective c
+ // generated classes from this .proto. There is no default.
+ optional string objc_class_prefix = 36;
+
+ // Namespace for generated classes; defaults to the package.
+ optional string csharp_namespace = 37;
+
+ // Whether the nano proto compiler should generate in the deprecated non-nano
+ // suffixed package.
+ optional bool javanano_use_deprecated_package = 38;
+
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
@@ -436,10 +460,31 @@ message FieldOptions {
// The packed option can be enabled for repeated primitive fields to enable
// a more efficient representation on the wire. Rather than repeatedly
// writing the tag and type for each element, the entire array is encoded as
- // a single length-delimited blob.
+ // a single length-delimited blob. In proto3, only explicit setting it to
+ // false will avoid using packed encoding.
optional bool packed = 2;
+ // The jstype option determines the JavaScript type used for values of the
+ // field. The option is permitted only for 64 bit integral and fixed types
+ // (int64, uint64, sint64, fixed64, sfixed64). By default these types are
+ // represented as JavaScript strings. This avoids loss of precision that can
+ // happen when a large value is converted to a floating point JavaScript
+ // numbers. Specifying JS_NUMBER for the jstype causes the generated
+ // JavaScript code to use the JavaScript "number" type instead of strings.
+ // This option is an enum to permit additional types to be added,
+ // e.g. goog.math.Integer.
+ optional JSType jstype = 6 [default = JS_NORMAL];
+ enum JSType {
+ // Use the default type.
+ JS_NORMAL = 0;
+
+ // Use JavaScript strings.
+ JS_STRING = 1;
+
+ // Use JavaScript numbers.
+ JS_NUMBER = 2;
+ }
// Should this field be parsed lazily? Lazy applies only to message-type
// fields. It means that when the outer message is initially parsed, the
@@ -480,8 +525,6 @@ message FieldOptions {
// For Google-internal migration only. Do not use.
optional bool weak = 10 [default=false];
-
-
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
@@ -681,6 +724,11 @@ message SourceCodeInfo {
// A series of line comments appearing on consecutive lines, with no other
// tokens appearing on those lines, will be treated as a single comment.
//
+ // leading_detached_comments will keep paragraphs of comments that appear
+ // before (but not connected to) the current element. Each paragraph,
+ // separated by empty lines, will be one comment element in the repeated
+ // field.
+ //
// Only the comment content is provided; comment markers (e.g. //) are
// stripped out. For block comments, leading whitespace and an asterisk
// will be stripped from the beginning of each line other than the first.
@@ -701,6 +749,12 @@ message SourceCodeInfo {
// // Another line attached to qux.
// optional double qux = 4;
//
+ // // Detached comment for corge. This is not leading or trailing comments
+ // // to qux or corge because there are blank lines separating it from
+ // // both.
+ //
+ // // Detached comment for corge paragraph 2.
+ //
// optional string corge = 5;
// /* Block comment attached
// * to corge. Leading asterisks
@@ -708,7 +762,10 @@ message SourceCodeInfo {
// /* Block comment attached to
// * grault. */
// optional int32 grault = 6;
+ //
+ // // ignored detached comments.
optional string leading_comments = 3;
optional string trailing_comments = 4;
+ repeated string leading_detached_comments = 6;
}
}