3 /* http://vision.kuee.kyoto-u.ac.jp/~nob/doc/win32/win32.html#doc1_42
10 #define STDX_DSTREAM_H
15 // VC++
\82Å STLport
\82¾
\82Æ using std::char_traits;
\82Ý
\82½
\82¢
\82È
\82Ì
\82ª
\95K
\97v
\82©
\82à
16 template <typename Ch_T, typename Tr_T = std::char_traits<Ch_T> >
17 class basic_dbg_streambuf: public std::basic_stringbuf<Ch_T, Tr_T>
22 #ifndef STDX_DSTREAM_BUFFERING
27 virtual ~basic_dbg_streambuf()
35 dbg_out(str().c_str());
36 pbump(static_cast<int>(pbase() - pptr()));
40 void dbg_out(const Ch_T*);
44 inline void basic_dbg_streambuf<char>::dbg_out(const char *str)
46 ::OutputDebugStringA(str);
50 inline void basic_dbg_streambuf<wchar_t>::dbg_out(const wchar_t *str)
52 ::OutputDebugStringW(str);
55 template <typename Ch_T, typename Tr_T = std::char_traits<Ch_T> >
56 class basic_dbg_ostream: public std::basic_ostream<Ch_T, Tr_T>
59 basic_dbg_ostream() : std::basic_ostream<Ch_T, Tr_T>(new basic_dbg_streambuf<Ch_T, Tr_T>())
63 virtual ~basic_dbg_ostream()
65 // flush(); //
\95s
\97v
\82ç
\82µ
\82¢
\81Dhttp://www.tietew.jp/cppll/archive/607
70 typedef basic_dbg_streambuf<wchar_t> wdbg_streambuf;
71 typedef basic_dbg_ostream<wchar_t> wdstream;
73 //
\82±
\82ê
\82ð
\92è
\8b`
\82µ
\82Ä
\82¨
\82
\82Æ
\81C dout
\82Ì
\90é
\8c¾
\82ª
\82¢
\82ç
\82È
\82
\82È
\82é
\81D
74 static wdstream wdout;
78 #endif // STDX_DSTREAM_