From a25a51f1664a05ece3b45c90e198a6682b4c6138 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sun, 22 Feb 2015 20:29:32 +0100 Subject: [PATCH] Testing the serializer --- Client/Client.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Client/Client.cpp b/Client/Client.cpp index a050ae5..0a58046 100644 --- a/Client/Client.cpp +++ b/Client/Client.cpp @@ -1,4 +1,5 @@ #include +#include #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; } \ No newline at end of file