说明
这是一个利用protobuf读取配置文件的 demo。
利用protobuf读写二进制流的例子在网上有很多,但是读写配置文件我觉得也是一个很大的应用空间。
proto文件
ken@ubuntu:~/test/protobuf/test_pf$ cat addressbook.proto
syntax = "proto2";
package tutorial;
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1