Hello team,
I am new to C++ protobuf. library.
I experience following difficulty.
I have an pObj, i serialize it using SerializeToString, then as a test i
try to deserialize the string using ParseFromString. I expect that after
deserialization the object will contain the same data as original pObj. It
doesn't happen. The new object contains nulls. The ParseFromString return
true. Here is the pseudo-code:
string body;
int n1 = pObj->_objectSetType.ByteSizeLong();
result = pObj->_objectSetType.SerializeToString(&body);
PriceTicObjectSet* pnewObj = new PriceTicObjectSet;
result = pnewObj->_objectSetType.ParseFromString(body);
string dump1 = toString(pObj);
printf("Dump1:\n%s\n", dump1.c_str());
string dump2 = toString(pnewObj);
printf("Dump2:\n%s\n", dump2.c_str());
Again, I expect that after deserialization objects pObj and pnewObj contain
same data.
This issue puzzles me and it is really important to solve it.
Please can somebody help me - probably I am doing something wrong.
Thank you
Boris Pitel
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/dfae067f-71ec-4550-b18e-aa8aabab0af2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.