We have rest api call in cpp where we get the proto response from URI.
response is in the binary format in QByteArray. We have been passing same
response in QByteArray as it is to parse using parse function in cpp. but
it is not parsed successfully.
Response is:
4
_2014-08-20T05:01:01.463Z__2014-08-25T23:01:01.463Z_L
J
_s0_D
_2014-08-22T04:28:50.000Z__2014-08-22T04:28:55.100Z_
testpointa23 B_&
_2014-08-22T04:28:50.000Z_
_
_s0__24_'
_2014-08-22T04:28:50.001Z_
_s0__999_&
_2014-08-22T04:28:55.100Z_
_
_s0__23
we have below source tried.
1.
if (innerGrid.ParseFromArray( data ,data.size()))
{
LOG_DEBUGL2("[DEBUG]\tDeserializing from String : Success\n");
}
else
{
LOG_ERROR("[ERROR]\tDeserializing from String : Failed\n");
}
innerGrid is our ProtobufReadingListResponseInfo object.
2.
google::protobuf::io::ArrayInputStream arrayIn(data, data.size());
google::protobuf::io::CodedInputStream codedIn(&arrayIn);
google::protobuf::uint64 size;
codedIn.ReadVarint64(&size);
google::protobuf::io::CodedInputStream::Limit msgLimit =
codedIn.PushLimit(size);
innerGrid.ParseFromCodedStream(&codedIn);
codedIn.PopLimit(msgLimit);
We are not able to understand why it is not parsed? Is there anything wrong
in this? Could you please help us? Many thanks in Advance.
--
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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.