commit | 3bac75d77b9b492f23243f66f1e332f3fbd64c8c | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@google.com> | Mon Aug 15 18:20:27 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Aug 15 18:20:27 2022 +0000 |
tree | 9423218cb9d415341a3668d0feb671d43c796c51 | |
parent | 26e210529ec4d3904e6c9c4d9f112b273cb0872a [diff] |
pw_stream: Implement StdFileReader::ConservativeLimit The ConservativeLimit method returns an estimate of how much data is available to be read or written in a pw::stream. The default implementation returns a very large value ("unlimited"). This commit implements a file-specific implementation for StdFileReader. It determines the size of the file (and thus how much data is left to read) by seeking to the end and getting the current file position. This makes the ConservativeReadLimit method much more useful for users of the class. Change-Id: I55b2518d3dc17ca8c4f98847dc7c3557eb9fda74 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/106130 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Pigweed-Auto-Submit: Eli Lipsitz <elipsitz@google.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/.