Joe Onorato | 6c9547d | 2016-09-07 18:43:49 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | syntax = "proto2"; |
| 18 | |
| 19 | import "frameworks/base/tools/streaming_proto/test/imported.proto"; |
| 20 | |
| 21 | package com.android.streaming_proto_test; |
| 22 | |
| 23 | /** |
| 24 | * Enum that outside the scope of any classes. |
| 25 | */ |
| 26 | enum Outside { |
| 27 | OUTSIDE_0 = 0; |
| 28 | OUTSIDE_1 = 1; |
| 29 | }; |
| 30 | |
| 31 | message Sibling { |
| 32 | optional int32 int32_field = 1; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Message with all of the field types. |
| 37 | */ |
| 38 | message All { |
| 39 | /** |
| 40 | * Enum that is inside the scope of a class. |
| 41 | */ |
| 42 | enum Inside { |
| 43 | option allow_alias = true; |
| 44 | INSIDE_0 = 0; |
| 45 | INSIDE_1 = 1; |
| 46 | INSIDE_1A = 1; |
| 47 | }; |
| 48 | |
| 49 | /** |
| 50 | * Message that is recursive. |
| 51 | */ |
| 52 | message Nested { |
| 53 | optional int32 data = 10001; |
| 54 | optional Nested nested = 10002; |
| 55 | }; |
| 56 | |
| 57 | optional double double_field = 10; |
| 58 | repeated double double_field_repeated = 11; |
| 59 | repeated double double_field_packed = 12 [packed=true]; |
| 60 | |
| 61 | optional float float_field = 20; |
| 62 | repeated float float_field_repeated = 21; |
| 63 | repeated float float_field_packed = 22 [packed=true]; |
| 64 | |
| 65 | optional int32 int32_field = 30; |
| 66 | repeated int32 int32_field_repeated = 31; |
| 67 | repeated int32 int32_field_packed = 32 [packed=true]; |
| 68 | |
| 69 | optional int64 int64_field = 40; |
| 70 | repeated int64 int64_field_repeated = 41; |
| 71 | repeated int64 int64_field_packed = 42 [packed=true]; |
| 72 | |
| 73 | optional uint32 uint32_field = 50; |
| 74 | repeated uint32 uint32_field_repeated = 51; |
| 75 | repeated uint32 uint32_field_packed = 52 [packed=true]; |
| 76 | |
| 77 | optional uint64 uint64_field = 60; |
| 78 | repeated uint64 uint64_field_repeated = 61; |
| 79 | repeated uint64 uint64_field_packed = 62 [packed=true]; |
| 80 | |
| 81 | optional sint32 sint32_field = 70; |
| 82 | repeated sint32 sint32_field_repeated = 71; |
| 83 | repeated sint32 sint32_field_packed = 72 [packed=true]; |
| 84 | |
| 85 | optional sint64 sint64_field = 80; |
| 86 | repeated sint64 sint64_field_repeated = 81; |
| 87 | repeated sint64 sint64_field_packed = 82 [packed=true]; |
| 88 | |
| 89 | optional fixed32 fixed32_field = 90; |
| 90 | repeated fixed32 fixed32_field_repeated = 91; |
| 91 | repeated fixed32 fixed32_field_packed = 92 [packed=true]; |
| 92 | |
| 93 | optional fixed64 fixed64_field = 100; |
| 94 | repeated fixed64 fixed64_field_repeated = 101; |
| 95 | repeated fixed64 fixed64_field_packed = 102 [packed=true]; |
| 96 | |
| 97 | optional sfixed32 sfixed32_field = 110; |
| 98 | repeated sfixed32 sfixed32_field_repeated = 111; |
| 99 | repeated sfixed32 sfixed32_field_packed = 112 [packed=true]; |
| 100 | |
| 101 | optional sfixed64 sfixed64_field = 120; |
| 102 | repeated sfixed64 sfixed64_field_repeated = 121; |
| 103 | repeated sfixed64 sfixed64_field_packed = 122 [packed=true]; |
| 104 | |
| 105 | optional bool bool_field = 130; |
| 106 | repeated bool bool_field_repeated = 131; |
| 107 | repeated bool bool_field_packed = 132 [packed=true]; |
| 108 | |
| 109 | optional string string_field = 140; |
| 110 | repeated string string_field_repeated = 141; |
| 111 | |
| 112 | optional bytes bytes_field = 150; |
| 113 | repeated bytes bytes_field_repeated = 151; |
| 114 | |
| 115 | optional Outside outside_field = 160; |
| 116 | repeated Outside outside_field_repeated = 161; |
| 117 | repeated Outside outside_field_packed = 162 [packed=true]; |
| 118 | |
| 119 | optional Nested nested_field = 170; |
| 120 | repeated Nested nested_field_repeated = 171; |
| 121 | |
| 122 | optional ImportedMessage imported_field = 180; |
| 123 | repeated ImportedMessage imported_field_repeated = 181; |
| 124 | }; |