17 #pragma implementation
28 #ifdef MODERN_STL_STREAMS
39 using std::streamsize;
59 #ifndef MODERN_STL_STREAMS
60 typedef char char_type;
69 virtual streamsize xsputn(char_type
const*, streamsize n)
74 #ifdef MODERN_STL_STREAMS
76 virtual int_type overflow(int_type c = traits_type::eof())
79 return c == traits_type::eof() ?
' ' : c;
83 virtual int_type overflow(int_type c = EOF)
86 return c == EOF ?
' ' : c;
98 teebuf(streambuf* b1, streambuf* b2)
99 : streambuf(), sb1(b1), sb2(b2) {}
101 #ifdef MODERN_STL_STREAMS
106 return sb1->pubsync();
109 virtual streamsize xsputn(char_type
const* p, streamsize n)
112 return sb1->sputn(p, n);
115 virtual int_type overflow(int_type c = traits_type::eof())
118 return sb1->sputc(c);
121 typedef char char_type;
122 typedef int int_type;
130 virtual streamsize xsputn(char_type
const* p, streamsize n)
133 return sb1->xsputn(p, n);
136 virtual int_type overflow(int_type c = EOF)
139 return sb1->overflow(c);
156 threebuf(streambuf* b1, streambuf* b2, streambuf* b3)
157 : streambuf(), sb1(b1), sb2(b2), sb3(b3) {}
159 #ifdef MODERN_STL_STREAMS
164 return sb1->pubsync();
167 virtual streamsize xsputn(char_type
const* p, streamsize n)
171 return sb1->sputn(p, n);
174 virtual int_type overflow(int_type c = traits_type::eof())
178 return sb1->sputc(c);
181 typedef char char_type;
182 typedef int int_type;
191 virtual streamsize xsputn(char_type
const* p, streamsize n)
195 return sb1->xsputn(p, n);
198 virtual int_type overflow(int_type c = EOF)
202 return sb1->overflow(c);
220 : streambuf(), sb(b) {}
222 #ifdef MODERN_STL_STREAMS
226 return sb->pubsync();
229 virtual streamsize xsputn(char_type
const* p, streamsize n)
231 return sb->sputn(p, n);
234 virtual int_type overflow(int_type c = traits_type::eof())
239 typedef char char_type;
240 typedef int int_type;
247 virtual streamsize xsputn(char_type
const* p, streamsize n)
249 return sb->xsputn(p, n);
252 virtual int_type overflow(int_type c = EOF)
254 return sb->overflow(c);
281 : streambuf(), sb(b) {}
283 typedef sigc::signal<void, const std::string&> StrBufOverflow_Signal;
284 inline StrBufOverflow_Signal signal_overflow()
290 #ifdef MODERN_STL_STREAMS
295 return sb->pubsync();
299 virtual streamsize xsputn(char_type
const* p, streamsize n)
302 streamsize r = sb->sputn(p, n);
303 s_overflow.emit( sb->str() );
308 virtual int_type overflow(int_type c = traits_type::eof())
310 int_type r = sb->sputc(c);
315 s_overflow.emit( sb->str() );
322 typedef char char_type;
323 typedef int int_type;
330 virtual streamsize xsputn(char_type
const* p, streamsize n)
332 return sb->xsputn(p, n);
335 virtual int_type overflow(int_type c = EOF)
337 int_type r = sb->overflow(c);
342 s_overflow.emit( sb->str() );
351 StrBufOverflow_Signal s_overflow;