commit | a52946355d98485f3f135ee52cbf00297299c6b6 | [log] [tgz] |
---|---|---|
author | Scott James Remnant <keybuk@google.com> | Wed Dec 15 13:04:06 2021 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Dec 24 20:56:06 2021 +0000 |
tree | a716a06408287c951caf2951621b435e5d6a6fc2 | |
parent | 8d7280029d72cb804262cf18eed68dc840e9fd0d [diff] |
pw_protobuf: Support decoding from non-seekable Reader Allowing a StreamDecoder to operate on a non-seekable Reader means that protobuf messages can be decoded directly from a SocketStream and other similar streams. The previous requirement was to support skipping fields, and advancing to the end of nested length-delimited fields that were not fully read. Since this use is always forwards, it can be replaced in those streams by simply reading and discarding the data. For the requirement of maintaining the bounds of nested length-delimited fields, the decoder can maintain the position itself as it reads. StreamDecoder (and StreamDecoder::BytesReader) can still support seeking where the underlying stream supports it, updating the tracked position within the bounds of the field. Change-Id: Id4d1d41ae0492693bb231732546caba8db871cb3 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/74721 Pigweed-Auto-Submit: Scott James Remnant <keybuk@google.com> Reviewed-by: Yecheng Zhao <zyecheng@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/