1#ifndef WIBBLE_STREAM_POSIX_H
2#define WIBBLE_STREAM_POSIX_H
30 PosixBuf() : m_buf(0), m_buf_size(0), m_fd(-1) {}
56 m_buf =
new char[1024];
61 setp(m_buf, m_buf + m_buf_size);
86 int fd()
const {
return m_fd; }
106 int res = ::write(m_fd, m_buf,
amount);
109 setp(m_buf, m_buf + m_buf_size);
Exception thrown when some consistency check fails.
Definition exception.h:255
Base class for system exceptions.
Definition exception.h:397
int detach()
Sync the PosixBuf and detach it from the file descriptor.
Definition posix.h:71
int sync()
Definition posix.h:101
PosixBuf()
Definition posix.h:30
PosixBuf(int fd, size_t bufsize=4096)
Definition posix.h:31
~PosixBuf()
Definition posix.h:35
int overflow(int c)
Definition posix.h:91
int fd() const
Access the underlying file descriptor.
Definition posix.h:86
void attach(int fd, size_t bufsize=4096)
Attach the stream to a file descriptor, using the given stream size.
Definition posix.h:54