Testing the serializer
This commit is contained in:
parent
c204382126
commit
a25a51f166
1 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "proto/client.pb.h"
|
||||
|
||||
|
@ -6,5 +7,17 @@ int main(int argc, char **argv)
|
|||
{
|
||||
std::cout << "Client running" << std::endl;
|
||||
|
||||
std::string bufferString;
|
||||
|
||||
client::ClientInfo clientInfoIn;
|
||||
|
||||
clientInfoIn.set_name("Herbert");
|
||||
clientInfoIn.SerializeToString(&bufferString);
|
||||
|
||||
client::ClientInfo clientInfoOut;
|
||||
clientInfoOut.ParseFromString(bufferString);
|
||||
|
||||
std::cout << "read: " << clientInfoOut.name() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue