/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ syntax = "proto2"; option optimize_for = LITE_RUNTIME; package foo.bar; import "src/protozero/test/example_proto/library.proto"; // This file contains comprehensive set of supported message structures and // data types. Unit tests depends on the plugin-processed version of this file. // Tests importing message definition from another proto file. message TransgalacticParcel { optional TransgalacticMessage message = 1; optional string tracking_code = 2; } enum SmallEnum { TO_BE = 1; NOT_TO_BE = 0; } enum SignedEnum { POSITIVE = 1; NEUTRAL = 0; NEGATIVE = -1; } enum BigEnum { BEGIN = 10; END = 100500; } message EveryField { optional int32 field_int32 = 1; optional int64 field_int64 = 2; optional uint32 field_uint32 = 3; optional uint64 field_uint64 = 4; optional sint32 field_sint32 = 5; optional sint64 field_sint64 = 6; optional fixed32 field_fixed32 = 7; optional fixed64 field_fixed64 = 8; optional sfixed32 field_sfixed32 = 9; optional sfixed64 field_sfixed64 = 10; optional float field_float = 11; optional double field_double = 12; optional bool field_bool = 13; optional SmallEnum small_enum = 51; optional SignedEnum signed_enum = 52; optional BigEnum big_enum = 53; optional string field_string = 500; optional bytes field_bytes = 505; enum NestedEnum { PING = 1; PONG = 2; } optional NestedEnum nested_enum = 600; repeated int32 repeated_int32 = 999; } message NestedA { message NestedB { message NestedC { optional int32 value_c = 1; } optional NestedC value_b = 1; } repeated NestedB repeated_a = 2; optional NestedB.NestedC super_nested = 3; } message CamelCaseFields { // To check that any reasonable name converts to camel case correctly. optional bool foo_bar_baz = 1; optional bool barBaz = 2; optional bool MooMoo = 3; optional bool URLEncoder = 4; optional bool XMap = 5; optional bool UrLE_nco__der = 6; optional bool __bigBang = 7; optional bool U2 = 8; optional bool bangBig__ = 9; }