summaryrefslogtreecommitdiff
path: root/src/proto/read.cc
blob: f97a39adf3e3ecf61ad2a7f7a67ed3dafe2c7e94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <fstream>
#include <iostream>

#include "example.pb.h"

int main(int argc, char **argv) {
  sample::Example example;

  {
    std::fstream input(argv[1], std::ios::in | std::ios::binary);
    example.ParseFromIstream(&input);
  }

  std::cout << "foo=" << example.foo() << "\n";
  std::cout << "bar=" << example.bar() << std::endl;

  return 0;
}