问题描述
有一个结构名称Model
,定义如下:
struct Model {
1: string a,2: string b,3: long c
}
当我看不到上面的定义时,我只在远程计算机上从 string
序列化了 Model
,如下所示。
Model m1;
m1.set_a("a");
m1.set_b("b");
Model m2;
m2.set_c(1);
std::string data1;
std::string data2;
// use msgpack
Pack(m1,&data1);
Pack(m2,&data2);
如何将这两个字符串组合成一个可以反序列化为 Model
对象的字符串?
总之,我需要一个像这样的 function
:bool CombineMsgpack(const std::string &s1,const std::string &s2,std::string *out);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)