dodo
0.0.1
A C++ library to create containerized Linux services
|
67 file_ = fopen( filename.c_str(),
"r");
74 FileReadBuffer::~FileReadBuffer() {
virtual common::SystemError underflow()
If the buffer_ is fully read.
ssize_t idx_
The current index of get(char &c) in buffer_.
virtual common::SystemError underflow()
If the buffer_ underflows, the buffer_ must be reset refilledwith new data from the source.
virtual char get() const
Get the current char from VirtualReadBuffer.
Interface to read individual bytes whilst the implementation can read from an actual source (such as ...
char * buffer_
The buffer.
FileReadBuffer(std::string filename, size_t bufsize=8192)
Construct a FileReadBuffer.
virtual ~SocketReadBuffer()
Destruct the SocketReadBuffer, de-allocate the internal buffer.
size_t underflows_
The number underflow() invocations.
A C++ platform interface to lean Linux services tailored for containerized deployment.
size_t read_
The number of chars read in buffer_.
virtual char get() const
Get the current char from VirtualReadBuffer.
BaseSocket * socket_
The associated network::BaseSocket*.
virtual bool getBlocking() const
Rerurn true if the socket is operating in blocking mode.
#define throw_SystemException(what, errno)
Throws an Exception with errno, passes FILE and LINE to constructor.
virtual common::SystemError receive(void *buf, ssize_t request, ssize_t &received)=0
Receive bytes from the socket.
#define throw_Exception(what)
Throws an Exception, passes FILE and LINE to constructor.
virtual common::SystemError next()
Move to the next char from the VirtualReadBuffer.
@ ecOK
0 Not an error, success
ssize_t received_
The number of chars received in the last underflow().
size_t idx_
The index into the buffer.
Helper class to write strings in stream format, eg.
SocketReadBuffer(BaseSocket *socket, size_t bufsize=8192)
Construct a SocketReadBuffer.
Linux system error primitive to provide a consistent interface to Linux error codes.
ssize_t bufsize_
The size of buffer_.
FILE * file_
The file handle.
virtual common::SystemError next()
Move to the next char from the VirtualReadBuffer.
Interface to and common implementation of concrete sockets (Socket, TLSSocket).