1/* 2 * Copyright (C) 2019 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 17syntax = "proto2"; 18 19package com.android.test.protoinputstream; 20 21/** 22 * Enum that outside the scope of any classes. 23 */ 24enum Outside { 25 OUTSIDE_0 = 0; 26 OUTSIDE_1 = 1; 27}; 28 29/** 30 * Message that is recursive. 31 */ 32message Nested { 33 optional int32 data = 10001; 34 optional Nested nested = 10002; 35}; 36 37/** 38 * Message with all of the field types. 39 */ 40message All { 41 /** 42 * Enum that is inside the scope of a class. 43 */ 44 enum Inside { 45 option allow_alias = true; 46 INSIDE_0 = 0; 47 INSIDE_1 = 1; 48 INSIDE_1A = 1; 49 }; 50 51 optional double double_field = 10; 52 repeated double double_field_repeated = 11; 53 repeated double double_field_packed = 12 [packed=true]; 54 55 optional float float_field = 20; 56 repeated float float_field_repeated = 21; 57 repeated float float_field_packed = 22 [packed=true]; 58 59 optional int32 int32_field = 30; 60 repeated int32 int32_field_repeated = 31; 61 repeated int32 int32_field_packed = 32 [packed=true]; 62 63 optional int64 int64_field = 40; 64 repeated int64 int64_field_repeated = 41; 65 repeated int64 int64_field_packed = 42 [packed=true]; 66 67 optional uint32 uint32_field = 50; 68 repeated uint32 uint32_field_repeated = 51; 69 repeated uint32 uint32_field_packed = 52 [packed=true]; 70 71 optional uint64 uint64_field = 60; 72 repeated uint64 uint64_field_repeated = 61; 73 repeated uint64 uint64_field_packed = 62 [packed=true]; 74 75 optional sint32 sint32_field = 70; 76 repeated sint32 sint32_field_repeated = 71; 77 repeated sint32 sint32_field_packed = 72 [packed=true]; 78 79 optional sint64 sint64_field = 80; 80 repeated sint64 sint64_field_repeated = 81; 81 repeated sint64 sint64_field_packed = 82 [packed=true]; 82 83 optional fixed32 fixed32_field = 90; 84 repeated fixed32 fixed32_field_repeated = 91; 85 repeated fixed32 fixed32_field_packed = 92 [packed=true]; 86 87 optional fixed64 fixed64_field = 100; 88 repeated fixed64 fixed64_field_repeated = 101; 89 repeated fixed64 fixed64_field_packed = 102 [packed=true]; 90 91 optional sfixed32 sfixed32_field = 110; 92 repeated sfixed32 sfixed32_field_repeated = 111; 93 repeated sfixed32 sfixed32_field_packed = 112 [packed=true]; 94 95 optional sfixed64 sfixed64_field = 120; 96 repeated sfixed64 sfixed64_field_repeated = 121; 97 repeated sfixed64 sfixed64_field_packed = 122 [packed=true]; 98 99 optional bool bool_field = 130; 100 repeated bool bool_field_repeated = 131; 101 repeated bool bool_field_packed = 132 [packed=true]; 102 103 optional string string_field = 140; 104 repeated string string_field_repeated = 141; 105 106 optional bytes bytes_field = 150; 107 repeated bytes bytes_field_repeated = 151; 108 109 optional Outside outside_field = 160; 110 repeated Outside outside_field_repeated = 161; 111 repeated Outside outside_field_packed = 162 [packed=true]; 112 113 optional Nested nested_field = 170; 114 repeated Nested nested_field_repeated = 171; 115}; 116