File: test2b.proto

package info (click to toggle)
swi-prolog 9.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 82,408 kB
  • sloc: ansic: 387,503; perl: 359,326; cpp: 6,613; lisp: 6,247; java: 5,540; sh: 3,147; javascript: 2,668; python: 1,900; ruby: 1,594; yacc: 845; makefile: 428; xml: 317; sed: 12; sql: 6
file content (38 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// This is the same as test.proto, but with a package name, to
// isolate whether protoc is generating wrong type names in some places.

syntax = "proto2";
package  PKG;

message OneofMessage {
  oneof first {
    string name = 4;
    sint64 number = 9;
  }
  oneof second {
    string foo = 1;
    double bar = 2;
  }
  oneof singleton_oneof {
    string qqsv = 3;
  }
}

// a map<...> creates a message that contains a Key and Value.
// So, number_ints = {"one":1, "two":2} is equivalent to
// '..MapMessage'{
//     number_ints:[
//          '.MapMessage.NumberIntsEntry'{key:"two",value:2},
//          '.MapMessage.NumberIntsEntry'{key:"one",value:1}]}

message MapMessage {
  map<string, sint64> number_ints = 5;
}

message NotMapMessage {
  message KeyValue {
    optional string  Key = 1;
    optional sint64  Value = 2;
  }
  repeated KeyValue number_ints = 5;
}