1 // Copyright 2010, Google Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 syntax = "proto2"; // for compatibility with internal Google compiler
32 // dummy message to include in other messages.
34 optional int32 foo = 1;
46 // required vs. optional
47 required int64 o_a = 1;
48 optional int64 o_b = 2;
50 // all the types (non-repeated)
51 optional int32 u_int32 = 3;
52 optional int64 u_int64 = 4;
53 optional uint64 u_uint64 = 5;
54 optional fixed32 u_fixed32 = 6;
55 optional fixed64 u_fixed64 = 7;
56 optional bool u_bool = 8;
57 optional float u_float = 27;
58 optional double u_double = 28;
59 optional string u_string = 9;
60 optional string u_vardata = 10;
61 optional Test1Msg u_msg = 11;
63 // all the types (repeated)
64 repeated int32 r_int32 = 12;
65 repeated int64 r_int64 = 13;
66 repeated uint64 r_uint64 = 14;
67 repeated fixed32 r_fixed32 = 15;
68 repeated fixed64 r_fixed64 = 16;
69 repeated bool r_bool = 17;
70 repeated float r_float = 29;
71 repeated double r_double = 30;
72 repeated string r_string = 18;
73 repeated string r_vardata = 19;
74 repeated Test1Msg r_msg = 20;
77 repeated group TestGroup1 = 21 {
78 optional int32 a = 22;
82 repeated group TestGroup2 = 23 {
83 optional int32 b = 24;
87 optional int32 d_int32 = 25 [default=12];
88 optional string d_string = 26 [default="foo"];
89 optional bool d_bool = 31 [default=true];
90 optional int32 dd_int32 = 32 [ default = 12 ];
91 optional string dd_string = 33 [ default = " f oo " ];
92 optional bool dd_bool = 34 [ default = true ];