Collects buffers of output from execution of remote SSH command. More...
#include <SshOutputCollector.h>
Classes | |
class | Buffer |
Fixed-size buffer to hold a portion of output. More... | |
class | iterator |
Iterator for traversing output line-by-line. More... | |
Public Member Functions | |
SshOutputCollector (size_t buffer_size) | |
Constructor. More... | |
size_t | buffer_size () |
Returns buffer size. More... | |
Buffer | allocate_buffer () |
Allocate a buffer. More... | |
void | add (Buffer buf) |
Adds filled buffer to collector. More... | |
bool | empty () const |
Returns true if no output has been collected Returns true if there are no collected buffers or if none of the collected buffers contain data. More... | |
bool | last_line_is_partial () |
Returns true if last line collected is partial. More... | |
iterator | begin () |
Returns iterator at beginning of output collector. More... | |
iterator | end () |
Returns iterator at end of output collector. More... | |
Private Attributes | |
size_t | m_buffer_size {} |
Buffer size More... | |
CharArena | m_arena |
Character arena from which buffers are allocated. More... | |
std::vector< Buffer > | m_buffers |
Vector of buffers. More... | |
Collects buffers of output from execution of remote SSH command.
Definition at line 47 of file SshOutputCollector.h.
|
inline |
Constructor.
buffer_size | Size of buffer pages to allocate |
Definition at line 132 of file SshOutputCollector.h.
|
inline |
Adds filled buffer to collector.
buf | Buffer to add |
Definition at line 148 of file SshOutputCollector.h.
|
inline |
Allocate a buffer.
This function allocates a buffer of size m_buffer_size from m_arena
Definition at line 142 of file SshOutputCollector.h.
|
inline |
Returns iterator at beginning of output collector.
Definition at line 181 of file SshOutputCollector.h.
|
inline |
Returns buffer size.
This function returns the size of buffers returned by allocate_buffer().
Definition at line 137 of file SshOutputCollector.h.
|
inline |
Returns true if no output has been collected Returns true if there are no collected buffers or if none of the collected buffers contain data.
Definition at line 158 of file SshOutputCollector.h.
|
inline |
Returns iterator at end of output collector.
Definition at line 185 of file SshOutputCollector.h.
|
inline |
Returns true if last line collected is partial.
If the last character collected is not a newline character, this function returns true, indicating that the collection has stopped in the middle of a line and there are more line characters to be read.
Definition at line 174 of file SshOutputCollector.h.
|
private |
Character arena from which buffers are allocated.
Definition at line 191 of file SshOutputCollector.h.
|
private |
Buffer size
Definition at line 189 of file SshOutputCollector.h.
|
private |
Vector of buffers.
Definition at line 193 of file SshOutputCollector.h.