commit | f78574956d329c3fa85b5497ad377b5af3ffab4d | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@pigweed.infra.roller.google.com> | Mon Aug 15 18:41:17 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Aug 15 18:41:17 2022 +0000 |
tree | cf345f0b7b2b3778dc6fbcb22cbe2a1bf557fa07 | |
parent | 5c2f97b4342c3a6a25fb174765cc5f1454adf2e1 [diff] |
[roll pigweed] 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. Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/106130 https://pigweed.googlesource.com/pigweed/pigweed pigweed Rolled-Commits: 26e210529ec4d39..3bac75d77b9b492 Roller-URL: https://ci.chromium.org/b/8805741363000674001 CQ-Do-Not-Cancel-Tryjobs: true Change-Id: Ie186da8bec42db805875892404cfdb513bcf55ad Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/zephyr-integration/+/106556 Bot-Commit: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com> Commit-Queue: Pigweed Integration Roller <pigweed-integration-roller@pigweed.google.com.iam.gserviceaccount.com>