Sponge
CS144's user-space TCP library
|
A reference-counted discontiguous string that can discard bytes from the front. More...
#include <buffer.hh>
Public Member Functions | |
void | append (const BufferList &other) |
Append a BufferList. More... | |
const std::deque< Buffer > & | buffers () const |
Access the underlying queue of Buffers. More... | |
std::string | concatenate () const |
Make a copy to a new std::string. More... | |
operator Buffer () const | |
Transform to a Buffer. 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 | |
BufferList ()=default | |
BufferList (Buffer buffer) | |
Construct from a Buffer. More... | |
BufferList (std::string &&str) noexcept | |
Construct by taking ownership of a std::string. More... | |
Private Attributes | |
std::deque< Buffer > | _buffers {} |
A reference-counted discontiguous string that can discard bytes from the front.
|
default |
|
inline |
|
inlinenoexcept |
Construct by taking ownership of a std::string.
void BufferList::append | ( | const BufferList & | other | ) |
Append a BufferList.
|
inline |
string BufferList::concatenate | ( | ) | const |
Make a copy to a new std::string.
BufferList::operator Buffer | ( | ) | const |
Transform to a Buffer.
void BufferList::remove_prefix | ( | size_t | n | ) |
|
private |