This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ProtoBufTest/Client/Client.cpp

23 lines
452 B
C++
Raw Normal View History

2015-02-19 13:59:22 +00:00
#include <iostream>
2015-02-22 19:29:32 +00:00
#include <string>
2015-02-19 13:59:22 +00:00
2015-02-22 19:18:51 +00:00
#include "proto/client.pb.h"
2015-02-19 13:59:22 +00:00
int main(int argc, char **argv)
{
std::cout << "Client running" << std::endl;
2015-02-22 19:29:32 +00:00
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;
2015-02-19 13:59:22 +00:00
return 0;
}