34 if (m_read_ptr && (len = m_read_end - m_read_ptr) > 0) {
35 MemDump get_area (m_read_ptr, len);
43 if (m_write_base && (len = m_write_ptr - m_write_base) > 0) {
44 MemDump put_area (m_write_base, len);
69 setg (
char* gbeg_,
char* gnext_,
char* gend_)
80 setb (
char* b_,
char* eb_,
int del_)
109 if (p_ == NULL || len_ == 0) {
118 setb (p_, p_ + len_, 0);
152 else if (count > 20) {
153 memcpy (data_, m_read_ptr, count);
165 DL((
STRMBUFTRACE,
"Transferred %d bytes to user-space buffer\n", count));
188 const char* s = data_;
203 memcpy (m_write_ptr, s, count);
205 m_write_ptr += count;
207 else if (count <= 0) {
214 for (i=count; --i >= 0;) {
222 if (more == 0 ||
overflow ((
unsigned char) *s++) == EOF) {
229 return (len_ - more);
239 buf =
new char [1024];
243 setb (buf, buf+1024, 1);
void setg(char *gbeg_, char *gnext_, char *gend_)
Set get area pointers.
#define DL(X)
A macro for writing debug message to the Logger.
virtual int underflow()
This function is called to supply characters for input (from some source) when the get area is empty...
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
virtual int sync()
This function synchronizes the streambuf with its actual stream of characters.
const char * getMemDump() const
Obtain a pointer to the dump image (null-terminated char string).
Streambuf class is based on Standard C++ iostream streambuf class.
Class Streambuf & friends messages.
Extended Streambuf & friends messages.
int sgetc()
This function returns the character after the get pointer, or EOF if the get pointer is at the end of...
virtual int overflow(int c=EOF)
This function is called to consume characters (flush them to output), typically when the put area is ...
virtual int xsgetn(char *b_, int len_)
Assigns up to len_ characters to successive elements of the array whose first element is designated b...
virtual Streambuf * setbuf(char *p_, int len_)
Performs an operation that is defined separately for each class derived from Streambuf.
A Hex/Ascii memory dump of similar to od(1) UNIX utility.
virtual int xsputn(const char *b_, int len_)
Writes up to len_ characters to the output sequence as if by repeated calls to sputc (c)...
virtual int doallocate()
This function is called by allocate when unbuffered() is zero and base() is zero. ...
void setp(char *pbeg_, char *pend_)
Set put area pointers.
virtual int uflow()
Reads the characters from the input sequence, if possible, and moves the stream position past it...
void setb(char *b_, char *eb_, int del_)
Establish the reserve area (buffer).
int snextc()
This function moves the get pointer forward one position, then returns the character after the get po...