C buffer. More...
#include <iostream.hpp>
Public Attributes | |
| char * | data = nullptr |
| std::size_t | size = 0 |
| std::function< std::size_t(char *, std::size_t)> | read = nullptr |
| std::function< std::size_t(const char *, std::size_t)> | write = nullptr |
C buffer.
Read and write functions return the number of bytes which have been read or written:
0 means end of stream ;0 means error.They can throw exceptions: the stream sets its badbit (and rethrows according to its exceptions mask).
data is optional: when NULL , it will be allocated/deallocated by CStreambuf. When set, it has to contain at least size bytes and to outlive the stream. In input-output mode, it is used for reading and a writing area of size bytes is allocated.
| char* anch::cutils::cbuffer::data = nullptr |
Buffer data
| std::function<std::size_t(char*,std::size_t)> anch::cutils::cbuffer::read = nullptr |
Read data function
| std::size_t anch::cutils::cbuffer::size = 0 |
Buffer size (has to be greater than 0)
| std::function<std::size_t(const char*,std::size_t)> anch::cutils::cbuffer::write = nullptr |
Write data function