diff options
author | Kayce Basques <kayce@google.com> | 2023-07-07 16:46:45 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-07-07 16:46:45 +0000 |
commit | fb0e327ca1d4f124725cabc8e5093bc15591469c (patch) | |
tree | 8ab237929912dc9a717daf1942634f5769b66495 /pw_sys_io | |
parent | ee39b08aa1c108099abb50f0560359efb43a6439 (diff) | |
download | pigweed-fb0e327ca1d4f124725cabc8e5093bc15591469c.tar.gz |
pw_sys_io: Doxygenify ReadBytes()
Change-Id: I1c5b7eb70a84e3a98ac45b2ab2884915ec0a2e84
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/154192
Reviewed-by: Kayce Basques <kayce@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Kayce Basques <kayce@google.com>
Diffstat (limited to 'pw_sys_io')
-rw-r--r-- | pw_sys_io/docs.rst | 1 | ||||
-rw-r--r-- | pw_sys_io/public/pw_sys_io/sys_io.h | 26 |
2 files changed, 15 insertions, 12 deletions
diff --git a/pw_sys_io/docs.rst b/pw_sys_io/docs.rst index f891d0e20..e4df70ea5 100644 --- a/pw_sys_io/docs.rst +++ b/pw_sys_io/docs.rst @@ -45,6 +45,7 @@ API reference .. doxygenfunction:: pw::sys_io::TryReadByte(std::byte* dest) .. doxygenfunction:: pw::sys_io::WriteByte(std::byte b) .. doxygenfunction:: pw::sys_io::WriteLine(const std::string_view& s) +.. doxygenfunction:: pw::sys_io::ReadBytes(ByteSpan dest) Dependencies ============ diff --git a/pw_sys_io/public/pw_sys_io/sys_io.h b/pw_sys_io/public/pw_sys_io/sys_io.h index 1b25331e4..40e715788 100644 --- a/pw_sys_io/public/pw_sys_io/sys_io.h +++ b/pw_sys_io/public/pw_sys_io/sys_io.h @@ -97,18 +97,20 @@ Status WriteByte(std::byte b); /// returned as part of the `StatusWithSize`. StatusWithSize WriteLine(const std::string_view& s); -// Fill a byte span from the sys io backend using ReadByte(). -// Implemented by: Facade -// -// This function is implemented by this facade and simply uses ReadByte() to -// read enough bytes to fill the destination span. If there's an error reading a -// byte, the read is aborted and the contents of the destination span are -// undefined. This function blocks until either an error occurs, or all bytes -// are successfully read from the backend's ReadByte() implementation. -// -// Return status is OkStatus() if the destination span was successfully -// filled. In all cases, the number of bytes successuflly read to the -// destination span are returned as part of the StatusWithSize. +/// Fills a byte span from the `pw_sys_io` backend using `ReadByte()`. +/// +/// @pre This function must be implemented by the `pw_sys_io` facade. +/// +/// This function is implemented by the facade and simply uses `ReadByte()` to +/// read enough bytes to fill the destination span. If there's an error reading +/// a byte, the read is aborted and the contents of the destination span are +/// undefined. This function blocks until either an error occurs or all bytes +/// are successfully read from the backend's `ReadByte()` implementation. +/// +/// @returns +/// * @pw_status{OK} if the destination span was successfully filled. In all +/// cases, the number of bytes successuflly read to the destination span are +/// returned as part of the `StatusWithSize`. StatusWithSize ReadBytes(ByteSpan dest); // Write span of bytes out the sys io backend using WriteByte(). |