25 class MyStreamBuf:
public std::basic_streambuf<char, std::char_traits<char> >
29 mEnabledRedirect(true), mOrig(NULL), mMessageLevel(level)
36 virtual int_type
overflow(int_type meta = traits_type::eof())
38 char single = traits_type::to_char_type(meta);
41 QMutexLocker sentry(&mOrigMutex);
49 QMutexLocker sentry(&mMutex);
54 Message msg(buffer, mMessageLevel);
61 QMutexLocker sentry(&mMutex);
65 return traits_type::not_eof(meta);
69 mEnabledRedirect = on;
75 QMutexLocker sentry(&mOrigMutex);
76 mOrig->sputn(sequence.toLatin1(), sequence.size());
80 bool mEnabledRedirect;
82 std::streambuf* mOrig;
83 MESSAGE_LEVEL mMessageLevel;
94 OrigBuf = mStream.rdbuf(StreamBuf.get());
95 StreamBuf->setOriginal(OrigBuf);
100 mStream.rdbuf(OrigBuf);
105 StreamBuf->sendUnredirected(sequence);