aboutsummaryrefslogtreecommitdiff
path: root/pw_sys_io
diff options
context:
space:
mode:
authorWyatt Hepler <hepler@google.com>2020-06-22 11:21:45 -0700
committerCQ Bot Account <commit-bot@chromium.org>2020-07-01 01:37:27 +0000
commite2cbadfa0cd342abb37ce5a70d4e019fb2b2e790 (patch)
tree5634bcc53aea3055154397f65b6da2917737dd44 /pw_sys_io
parentd3d1cb075535dc3bece256f8cbbf960d3f2bf72e (diff)
downloadpigweed-e2cbadfa0cd342abb37ce5a70d4e019fb2b2e790.tar.gz
pw_span: Switch from pw::span to std::span
Replace pw::span with std::span and "pw_span/span.h" with <span> throughout the codebase. Change-Id: Ib1fa873168b6093794e861611d750fcad6285d6c Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12801 Commit-Queue: Wyatt Hepler <hepler@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Reviewed-by: Keir Mierle <keir@google.com>
Diffstat (limited to 'pw_sys_io')
-rw-r--r--pw_sys_io/public/pw_sys_io/sys_io.h10
-rw-r--r--pw_sys_io/sys_io.cc4
2 files changed, 7 insertions, 7 deletions
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 3010de1ff..5f545b316 100644
--- a/pw_sys_io/public/pw_sys_io/sys_io.h
+++ b/pw_sys_io/public/pw_sys_io/sys_io.h
@@ -37,9 +37,9 @@
#include <cstddef>
#include <cstring>
+#include <span>
#include <string_view>
-#include "pw_span/span.h"
#include "pw_status/status.h"
#include "pw_status/status_with_size.h"
@@ -75,7 +75,7 @@ Status WriteByte(std::byte b);
// are returned as part of the StatusWithSize.
StatusWithSize WriteLine(const std::string_view& s);
-// Fill a byte span from the sys io backend using ReadByte().
+// Fill a byte std::span from the sys io backend using ReadByte().
// Implemented by: Facade
//
// This function is implemented by this facade and simply uses ReadByte() to
@@ -87,9 +87,9 @@ StatusWithSize WriteLine(const std::string_view& s);
// Return status is 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(span<std::byte> dest);
+StatusWithSize ReadBytes(std::span<std::byte> dest);
-// Write span of bytes out the sys io backend using WriteByte().
+// Write std::span of bytes out the sys io backend using WriteByte().
// Implemented by: Facade
//
// This function is implemented by this facade and simply writes the source
@@ -101,6 +101,6 @@ StatusWithSize ReadBytes(span<std::byte> dest);
// Return status is Status::OK 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(span<const std::byte> src);
+StatusWithSize WriteBytes(std::span<const std::byte> src);
} // namespace pw::sys_io
diff --git a/pw_sys_io/sys_io.cc b/pw_sys_io/sys_io.cc
index ed0ab5c5a..8e013c3b2 100644
--- a/pw_sys_io/sys_io.cc
+++ b/pw_sys_io/sys_io.cc
@@ -16,7 +16,7 @@
namespace pw::sys_io {
-StatusWithSize ReadBytes(span<std::byte> dest) {
+StatusWithSize ReadBytes(std::span<std::byte> dest) {
for (size_t i = 0; i < dest.size_bytes(); ++i) {
Status result = ReadByte(&dest[i]);
if (!result.ok()) {
@@ -26,7 +26,7 @@ StatusWithSize ReadBytes(span<std::byte> dest) {
return StatusWithSize(dest.size_bytes());
}
-StatusWithSize WriteBytes(span<const std::byte> src) {
+StatusWithSize WriteBytes(std::span<const std::byte> src) {
for (size_t i = 0; i < src.size_bytes(); ++i) {
Status result = WriteByte(src[i]);
if (!result.ok()) {