Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Stream that just redirects all the input to an internal memory buffer. More...
#include <DobbyStream.h>
Public Member Functions | |
DobbyBufferStream (ssize_t limit=-1) | |
Constructs the buffer using an memfd. More... | |
int | dupWriteFD (int newFd, bool closeExec) const override |
Returns a dup'd file descriptor for the write side of the stream. More... | |
std::vector< char > | getBuffer () const |
Reads all the data in the buffer. More... | |
int | getMemFd () const |
Private Attributes | |
int | mMemFd |
Stream that just redirects all the input to an internal memory buffer.
This is useful for capturing the stderr output, or other small bits of text output from a command line tool.
|
explicit |
Constructs the buffer using an memfd.
[in] | limit | The maximum number of bytes that can be written into the buffer. |
|
overridevirtual |
Returns a dup'd file descriptor for the write side of the stream.
If the file descriptor newfd was previously open, it is silently closed before being reused. If newFd is -1 then the lowest-numbered unused file descriptor number is used.
[in] | newFd | The number to give the new dup'd file descriptor. |
[in] | closeExec | If true the O_CLOEXEC flag is set on the new fd |
Implements IDobbyStream.
std::vector< char > DobbyBufferStream::getBuffer | ( | ) | const |
Reads all the data in the buffer.
This doesn't do a flush or anything, this just returns everything written into the buffer.