VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | 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]

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
QTextEditpLogWindow
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.

makVrv::QDebugStream::~QDebugStream ( )

Member Function Documentation

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

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
QFile makVrv::QDebugStream::logFile
private

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)