Add pb_decode_delimited and pb_encode_delimited wrapper functions.
Update issue 74 Status: FixedInGit
This commit is contained in:
13
pb_decode.c
13
pb_decode.c
@@ -603,6 +603,19 @@ bool checkreturn pb_decode(pb_istream_t *stream, const pb_field_t fields[], void
|
||||
return pb_decode_noinit(stream, fields, dest_struct);
|
||||
}
|
||||
|
||||
bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct)
|
||||
{
|
||||
pb_istream_t substream;
|
||||
bool status;
|
||||
|
||||
if (!pb_make_string_substream(stream, &substream))
|
||||
return false;
|
||||
|
||||
status = pb_decode(&substream, fields, dest_struct);
|
||||
pb_close_string_substream(stream, &substream);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Field decoders */
|
||||
|
||||
bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest)
|
||||
|
||||
Reference in New Issue
Block a user