VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Private Attributes
makVrv::QDebugStream Class Reference

This class redirects cout/cerr to the text edit that's passed in: More...

Inheritance diagram for makVrv::QDebugStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 QDebugStream (std::ostream &stream, QTextEdit *pTE)
 Send text streams to text edit only.
 QDebugStream (std::ostream &stream, QString &fileName)
 Send text streams to file only.
 QDebugStream (std::ostream &stream, QTextEdit *pTE, QString &fileName)
 Send text streams to text edit and file.
 ~QDebugStream ()

Protected Member Functions

virtual std::ios::int_type overflow (std::ios::int_type v)
virtual std::streamsize xsputn (const char *p, std::streamsize n)

Private Attributes

std::ostream & m_stream
std::streambuf * m_old_buf
std::string m_string
QTextEdit * pLogWindow
QFile logFile

Detailed Description

This class redirects cout/cerr to the text edit that's passed in:

QDebugStream cout(std::cout, pTextEdit); QDebugStream cerr(std::cerr, pTextEdit); Unfortunately it seems that this only works in LogText Mode. It also will write that out to a log file if desired. QDebugStream cout(std::cout, fileName); QDebugStream cerr(std::cerr, fileName); Or you can do both: QDebugStream cout(std::cout, pTextEdit, fileName); QDebugStream cerr(std::cerr, pTextEdit, fileName);


Constructor & Destructor Documentation

makVrv::QDebugStream::QDebugStream ( std::ostream &  stream,
QTextEdit *  pTE 
)

Send text streams to text edit only.

makVrv::QDebugStream::QDebugStream ( std::ostream &  stream,
QString &  fileName 
)

Send text streams to file only.

makVrv::QDebugStream::QDebugStream ( std::ostream &  stream,
QTextEdit *  pTE,
QString &  fileName 
)

Send text streams to text edit and file.


Member Function Documentation

virtual std::ios::int_type makVrv::QDebugStream::overflow ( std::ios::int_type  v) [protected, virtual]
virtual std::streamsize makVrv::QDebugStream::xsputn ( const char *  p,
std::streamsize  n 
) [protected, virtual]

Member Data Documentation

std::ostream& makVrv::QDebugStream::m_stream [private]
std::streambuf* makVrv::QDebugStream::m_old_buf [private]
std::string makVrv::QDebugStream::m_string [private]
QTextEdit* makVrv::QDebugStream::pLogWindow [private]

The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)