Read‐write cursor over an IOBuf chain.
Synopsis
Declared in <folly/io/Cursor.h>
template<CursorAccess access>
class RWCursor
: public CursorBase<RWCursor<access>, IOBuf>
, public Writable<RWCursor<access>>
Base Classes
Name |
Description |
Base class implementing the shared cursor logic over an IOBuf chain. |
|
Mixin providing write operations for cursor types. |
Types
Name |
Description |
Tag type selecting the constructor that starts at the end of a queue. |
Member Functions
Name |
Description |
|
Constructors |
Advances the cursor to the end of the entire IOBuf chain. |
|
Return true if the cursor could advance the specified number of bytes from its current position. |
|
Clone len bytes from this cursor into an IOBuf. |
|
Clone at most len bytes from this cursor into an IOBuf. |
|
Get the buffer in the IOBuf chain this Cursor currently points into. |
|
Get the data at the current cursor position. |
|
Gather at least n bytes contiguously into the current buffer, by coalescing subsequent buffers from the chain as necessary. |
|
Gather at most n bytes contiguously into the current buffer, by coalescing subsequent buffers from the chain as necessary. |
|
Get the current Cursor position relative to the head of IOBuf chain. |
|
Get the Cursor position relative to the IOBuf chain's currentBuffer(). |
|
Insert data at the cursor position. |
|
Return true if the cursor is at the end of the entire IOBuf chain. |
|
Check if this cursor has a size limit imposed on it. |
|
Return the remaining space available in the current IOBuf. |
|
Get a new cursor, advanced by offset from this cursor. |
|
Advance the cursor |
|
Subtraction operators |
|
Retreat the cursor |
|
Alternate version of peekBytes() that returns a std::span instead of a ByteRage. |
|
Return the available data in the current IOBuf. |
|
Copies len bytes from the cursor. |
|
Copies at most len bytes from the cursor. |
|
|
|
|
|
Read a value from the cursor. |
|
Read a Big‐Endian integral from the cursor. |
|
Read a fixed‐length string. |
|
Read a Little‐Endian integral from the cursor. |
|
Read a string of bytes until the given terminator character is seen. |
|
|
|
Reset cursor to point to a new buffer. |
|
Retreat the cursor by at most len bytes. |
|
Retreat the cursor by at most len bytes. |
|
Advance the cursor by len bytes. |
|
Advance the cursor by at most len bytes. |
|
Skip bytes in the current IOBuf without advancing to the next one. |
|
Skip bytes until the specified predicate returns true. |
|
Return the space available until the end of the entire IOBuf chain. |
|
Attempt to read from the cursor. |
|
Attempt to read a Big‐Endian integral from the cursor. |
|
Attempt to read a Little‐Endian integral from the cursor. |
|
Get a raw pointer to the writable section controlled by this cursor. |
|
|
|
|
|
|
|
Compare cursors for equality/inequality. |
|
Compare cursors for inequality. |
Using Declarations
Name |
Protected Member Functions
Name |
Description |
Assignment operators |
|
Advance to the next buffer if the current one is exhausted. |
|
Get the borrow‐tracking flag, or nullptr when borrow checking is disabled. |
|
Assert in debug builds that the cursor's internal pointers are consistent. |
|
Get the head buffer of the IOBuf chain. |
|
Advance to the next buffer in the chain, if any. |
|
Retreat to the previous buffer in the chain, if any. |
Protected Data Members
Name |
Description |
The absolute offset of the current buffer's start within the chain. |
|
The head buffer of the IOBuf chain. |
|
The start of the data in the current buffer. |
|
The buffer in the chain the cursor currently points into. |
|
One past the last readable byte in the current buffer. |
|
The current cursor position within the current buffer. |
|
The number of bytes remaining beyond the current buffer for bounded cursors. |
Friends
Name |
Description |
Base class implementing the shared cursor logic over an IOBuf chain. |
Created with MrDocs