1fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleThis directory contains example code that uses Protocol Buffers to manage an
2fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleaddress book.  Two programs are provided, each with three different
3fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleimplementations, one written in each of C++, Java, and Python.  The add_person
4fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleexample adds a new person to an address book, prompting the user to input
5fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savillethe person's information.  The list_people example lists people already in the
6fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleaddress book.  The examples use the exact same format in all three languages,
7fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleso you can, for example, use add_person_java to create an address book and then
8fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savilleuse list_people_python to read it.
9fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
10fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleYou must install the protobuf package before you can build these.
11fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
12fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleTo build all the examples (on a unix-like system), simply run "make".  This
13fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savillecreates the following executable files in the current directory:
14fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville  add_person_cpp     list_people_cpp
15fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville  add_person_java    list_people_java
16fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville  add_person_python  list_people_python
17fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
18fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleIf you only want to compile examples in one language, use "make cpp"*,
19fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville"make java", or "make python".
20fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
21fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleAll of these programs simply take an address book file as their parameter.
22fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleThe add_person programs will create the file if it doesn't already exist.
23fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
24fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleThese examples are part of the Protocol Buffers tutorial, located at:
25fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville  http://code.google.com/apis/protocolbuffers/docs/tutorials.html
26fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville
27fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville* Note that on some platforms you may have to edit the Makefile and remove
28fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville"-lpthread" from the linker commands (perhaps replacing it with something else).
29fbaaef999ba563838ebd00874ed8a1c01fbf286dWink SavilleWe didn't do this automatically because we wanted to keep the example simple.
30