byte_cursor class
#include <nxtio/buffers.hpp>
Synchronous cursor over an already-buffered byte span.
Constructors, destructors, conversion operators
-
byte_cursor(std::
span<const std:: byte> bytes) explicit - Create a cursor over bytes.
-
byte_cursor(std::
string_view text) explicit - Create a cursor over text bytes.
Public functions
-
auto remaining() const → std::
span<const std:: byte> noexcept - Remaining unread bytes.
-
auto take(std::
size_t n) → std:: span<const std:: byte> - Consume and return exactly
nbytes. -
auto take_until(std::
span<const std:: byte> delimiter) → std:: span<const std:: byte> - Consume through
delimiterand return bytes before it. -
auto take_until(std::
string_view delimiter) → std:: span<const std:: byte> - Consume through a string delimiter and return bytes before it.
-
void toss(std::
size_t n) - Discard
nbytes.