[protobuf] encoding: how to distinguish message and the field

2013-05-29 Thread mimocroc
Hi! I am writing my own library for working with protobuf for D language (dlang.org) and have a question: Each message is preceded by a header in the length delimited format and has tag which contains number of field. How I can distinguish message header with field number and real field

Re: [protobuf] encoding: how to distinguish message and the field

2013-05-29 Thread Ilia Mirkin
Messages aren't preceded by anything. A message inside of a message is preceeded by a varint that indicates its length (there's also a deprecated begin/end group mechanism that you probably don't have to worry about supporting). Then, for that length after the varint, decoding of the sub-message

Re: [protobuf] encoding: how to distinguish message and the field

2013-05-29 Thread mimocroc
Thanks for your answer! (My mistake because I am checked my code on the example binary, generated by add_person_cpp, who (apparently) puts each message into a separate message-formatted container.) четверг, 30 мая 2013 г., 1:13:21 UTC+8 пользователь Ilia Mirkin написал: Messages aren't