aboutsummaryrefslogtreecommitdiffstats
path: root/examples/addressbook.proto
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-05-27 16:25:37 -0700
committerWink Saville <wink@google.com>2010-05-27 16:25:37 -0700
commitfbaaef999ba563838ebd00874ed8a1c01fbf286d (patch)
tree24ff5c76344e90abc5b0fe6f07120ea0d2d011ee /examples/addressbook.proto
parent79a4a60053f74ab71c7c3ec436d2f6caedc5be61 (diff)
downloadexternal_protobuf-fbaaef999ba563838ebd00874ed8a1c01fbf286d.zip
external_protobuf-fbaaef999ba563838ebd00874ed8a1c01fbf286d.tar.gz
external_protobuf-fbaaef999ba563838ebd00874ed8a1c01fbf286d.tar.bz2
Add protobuf 2.2.0a sources
This is the contents of protobuf-2.2.0a.tar.bz2 from http://code.google.com/p/protobuf/downloads/list and is the base code for the javamicro code generator. Change-Id: Ie9a0440a824d615086445b6636944484b3155afa
Diffstat (limited to 'examples/addressbook.proto')
-rw-r--r--examples/addressbook.proto30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/addressbook.proto b/examples/addressbook.proto
new file mode 100644
index 0000000..b14829e
--- /dev/null
+++ b/examples/addressbook.proto
@@ -0,0 +1,30 @@
+// See README.txt for information and build instructions.
+
+package tutorial;
+
+option java_package = "com.example.tutorial";
+option java_outer_classname = "AddressBookProtos";
+
+message Person {
+ required string name = 1;
+ required int32 id = 2; // Unique ID number for this person.
+ optional string email = 3;
+
+ enum PhoneType {
+ MOBILE = 0;
+ HOME = 1;
+ WORK = 2;
+ }
+
+ message PhoneNumber {
+ required string number = 1;
+ optional PhoneType type = 2 [default = HOME];
+ }
+
+ repeated PhoneNumber phone = 4;
+}
+
+// Our address book file is just one of these.
+message AddressBook {
+ repeated Person person = 1;
+}