OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 optional int32 message_opt1 = 7739036; | 62 optional int32 message_opt1 = 7739036; |
63 } | 63 } |
64 | 64 |
65 extend google.protobuf.FieldOptions { | 65 extend google.protobuf.FieldOptions { |
66 optional fixed64 field_opt1 = 7740936; | 66 optional fixed64 field_opt1 = 7740936; |
67 // This is useful for testing that we correctly register default values for | 67 // This is useful for testing that we correctly register default values for |
68 // extension options. | 68 // extension options. |
69 optional int32 field_opt2 = 7753913 [default=42]; | 69 optional int32 field_opt2 = 7753913 [default=42]; |
70 } | 70 } |
71 | 71 |
72 extend google.protobuf.OneofOptions { | |
73 optional int32 oneof_opt1 = 7740111; | |
74 } | |
75 | |
76 extend google.protobuf.EnumOptions { | 72 extend google.protobuf.EnumOptions { |
77 optional sfixed32 enum_opt1 = 7753576; | 73 optional sfixed32 enum_opt1 = 7753576; |
78 } | 74 } |
79 | 75 |
80 extend google.protobuf.EnumValueOptions { | 76 extend google.protobuf.EnumValueOptions { |
81 optional int32 enum_value_opt1 = 1560678; | 77 optional int32 enum_value_opt1 = 1560678; |
82 } | 78 } |
83 | 79 |
84 extend google.protobuf.ServiceOptions { | 80 extend google.protobuf.ServiceOptions { |
85 optional sint64 service_opt1 = 7887650; | 81 optional sint64 service_opt1 = 7887650; |
(...skipping 11 matching lines...) Expand all Loading... |
97 // A test message with custom options at all possible locations (and also some | 93 // A test message with custom options at all possible locations (and also some |
98 // regular options, to make sure they interact nicely). | 94 // regular options, to make sure they interact nicely). |
99 message TestMessageWithCustomOptions { | 95 message TestMessageWithCustomOptions { |
100 option message_set_wire_format = false; | 96 option message_set_wire_format = false; |
101 | 97 |
102 option (message_opt1) = -56; | 98 option (message_opt1) = -56; |
103 | 99 |
104 optional string field1 = 1 [ctype=CORD, | 100 optional string field1 = 1 [ctype=CORD, |
105 (field_opt1)=8765432109]; | 101 (field_opt1)=8765432109]; |
106 | 102 |
107 oneof AnOneof { | |
108 option (oneof_opt1) = -99; | |
109 int32 oneof_field = 2; | |
110 } | |
111 | |
112 enum AnEnum { | 103 enum AnEnum { |
113 option (enum_opt1) = -789; | 104 option (enum_opt1) = -789; |
114 | 105 |
115 ANENUM_VAL1 = 1; | 106 ANENUM_VAL1 = 1; |
116 ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; | 107 ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; |
117 } | 108 } |
118 } | 109 } |
119 | 110 |
120 | 111 |
121 // A test RPC service with custom options at all possible locations (and also | 112 // A test RPC service with custom options at all possible locations (and also |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 412 } |
422 | 413 |
423 extend google.protobuf.MessageOptions { | 414 extend google.protobuf.MessageOptions { |
424 optional OldOptionType required_enum_opt = 106161807; | 415 optional OldOptionType required_enum_opt = 106161807; |
425 } | 416 } |
426 | 417 |
427 // Test message using the "required_enum_opt" option defined above. | 418 // Test message using the "required_enum_opt" option defined above. |
428 message TestMessageWithRequiredEnumOption { | 419 message TestMessageWithRequiredEnumOption { |
429 option (required_enum_opt) = { value: OLD_VALUE }; | 420 option (required_enum_opt) = { value: OLD_VALUE }; |
430 } | 421 } |
OLD | NEW |