diff options
author | Wyatt Hepler <hepler@google.com> | 2021-01-07 13:26:57 -0800 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-01-11 20:28:12 +0000 |
commit | 1b3da3a983ecaaf84090a0b1542ac23e04e5f6b7 (patch) | |
tree | 7f805f6ee43f2e51f2e333143911c2fbdafe249d /pw_sys_io | |
parent | 5a53dfd1af13128918edf4c0491d078472c97654 (diff) | |
download | pigweed-1b3da3a983ecaaf84090a0b1542ac23e04e5f6b7.tar.gz |
pw_status: Replace Status::Ok() with OkStatus()
- Mark Status::Ok() and StatusWithSize::Ok() as deprecated.
- Replace Status::Ok() with OkStatus().
- Replace StatusWithSize::Ok() with StatusWithSize().
Change-Id: If7192282446bf6d7f90990bb0b4f1b1b89a9228a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/29003
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
Diffstat (limited to 'pw_sys_io')
-rw-r--r-- | pw_sys_io/docs.rst | 2 | ||||
-rw-r--r-- | pw_sys_io/public/pw_sys_io/sys_io.h | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/pw_sys_io/docs.rst b/pw_sys_io/docs.rst index cde6a3c4d..3a1a6c49a 100644 --- a/pw_sys_io/docs.rst +++ b/pw_sys_io/docs.rst @@ -10,7 +10,7 @@ of an application. This facade doesn't dictate any policies on input and output data encoding, format, or transmission protocol. It only requires that backends return a -``Status::OK`` if the operation succeeds. Backends may provide useful error +``OkStatus()`` if the operation succeeds. Backends may provide useful error Status types, but depending on the implementation-specific Status values is NOT recommended. Since this facade provides a very vague I/O interface, it does NOT provide tests. Backends are expected to provide their own testing to 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 477c71967..f93e64aad 100644 --- a/pw_sys_io/public/pw_sys_io/sys_io.h +++ b/pw_sys_io/public/pw_sys_io/sys_io.h @@ -20,7 +20,7 @@ // // This facade doesn't dictate any policies on input and output data encoding, // format, or transmission protocol. It only requires that backends return a -// Status::Ok() if the operation succeeds. Backends may provide useful error +// OkStatus() if the operation succeeds. Backends may provide useful error // Status types, but depending on the implementation-specific Status values is // NOT recommended. Since this facade provides a very vague I/O interface, it // does NOT provide tests. Backends are expected to provide their own testing to @@ -51,14 +51,14 @@ namespace pw::sys_io { // This function will block until it either succeeds or fails to read a byte // from the pw_sys_io backend. // -// Returns Status::Ok() - A byte was successfully read. +// Returns OkStatus() - A byte was successfully read. // Status::ResourceExhausted() - if the underlying source vanished. Status ReadByte(std::byte* dest); // Read a single byte from the sys io backend, if available. // Implemented by: Backend // -// Returns Status::Ok() - A byte was successfully read, and is in dest. +// Returns OkStatus() - A byte was successfully read, and is in dest. // Status::Unavailable() - No byte is available to read; try later. // Status::Unimplemented() - Not supported on this target. Status TryReadByte(std::byte* dest); @@ -69,7 +69,7 @@ Status TryReadByte(std::byte* dest); // This function will block until it either succeeds or fails to write a byte // out the pw_sys_io backend. // -// Returns Status::Ok() if a byte was successfully read. +// Returns OkStatus() if a byte was successfully read. Status WriteByte(std::byte b); // Write a string out the sys io backend. @@ -79,7 +79,7 @@ Status WriteByte(std::byte b); // backend, adding any platform-specific newline character(s) (these are // accounted for in the returned StatusWithSize). // -// Return status is Status::Ok() if all the bytes from the source string were +// Return status is OkStatus() if all the bytes from the source string were // successfully written. In all cases, the number of bytes successfully written // are returned as part of the StatusWithSize. StatusWithSize WriteLine(const std::string_view& s); @@ -93,7 +93,7 @@ StatusWithSize WriteLine(const std::string_view& s); // undefined. This function blocks until either an error occurs, or all bytes // are successfully read from the backend's ReadByte() implementation. // -// Return status is Status::Ok() if the destination span was successfully +// 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. StatusWithSize ReadBytes(std::span<std::byte> dest); @@ -107,7 +107,7 @@ StatusWithSize ReadBytes(std::span<std::byte> dest); // either an error occurs, or all bytes are successfully read from the backend's // WriteByte() implementation. // -// Return status is Status::Ok() if all the bytes from the source span were +// Return status is OkStatus() if all the bytes from the source span were // successfully written. In all cases, the number of bytes successfully written // are returned as part of the StatusWithSize. StatusWithSize WriteBytes(std::span<const std::byte> src); |