Go to the documentation of this file.
39 #include "blocxx/BLOCXX_config.h"
52 : m_bufSize(bufSize), m_inputBuffer(NULL), m_outputBuffer(NULL)
54 if (direction == E_IN || direction == E_IN_OUT)
56 m_inputBuffer =
new char[m_bufSize];
59 if (direction == E_OUT || direction == E_IN_OUT)
61 m_outputBuffer =
new char[m_bufSize];
100 int cnt = pptr() - pbase();
129 if (n < epptr() - pptr())
131 memcpy(pptr(), s, n *
sizeof(
char));
137 for (std::streamsize
i = 0;
i < n;
i++)
139 if (sputc(s[
i]) == EOF)
151 if (gptr() < egptr())
153 return static_cast<unsigned char>(*gptr());
161 return static_cast<unsigned char>(*gptr());
virtual int buffer_from_device(char *c, int n)
Fill the buffer from the "device".
virtual void initGetBuffer()
virtual int overflow(int c)
std::streamsize m_bufSize
std::streamsize xsputn(const char *s, std::streamsize n)
virtual void initPutBuffer()
virtual void initBuffers()
virtual int buffer_to_device(const char *c, int n)
Writes the buffer to the "device".
BaseStreamBuffer(EDirectionFlag direction, size_t bufSize=BASE_BUF_SIZE)
Create a base stream buffer.
#define BLOCXX_ASSERT(CON)
BLOCXX_ASSERT works similar to the assert() macro, but instead of calling abort(),...