Sponge
CS144's user-space TCP library
|
A non-owning temporary view (similar to std::string_view) of a discontiguous string. More...
#include <buffer.hh>
Public Member Functions | |
std::vector< iovec > | as_iovecs () const |
Convert to a vector of iovec structures. More... | |
void | remove_prefix (size_t n) |
Discard the first n bytes of the string (does not require a copy or move) More... | |
size_t | size () const |
Size of the string. More... | |
Constructors | |
BufferViewList (const std::string &str) | |
Construct from a std::string. More... | |
BufferViewList (const char *s) | |
Construct from a C string (must be NULL-terminated) More... | |
BufferViewList (const BufferList &buffers) | |
Construct from a BufferList. More... | |
BufferViewList (std::string_view str) | |
Construct from a std::string_view. More... | |
Private Attributes | |
std::deque< std::string_view > | _views {} |
A non-owning temporary view (similar to std::string_view) of a discontiguous string.
|
inline |
Construct from a std::string.
|
inline |
BufferViewList::BufferViewList | ( | const BufferList & | buffers | ) |
Construct from a BufferList.
|
inline |
vector< iovec > BufferViewList::as_iovecs | ( | ) | const |
Convert to a vector of iovec
structures.
void BufferViewList::remove_prefix | ( | size_t | n | ) |
|
private |