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++

#include <iostream>
#include <string>
#include "proto/client.pb.h"
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;
}