OpendTect-6_4  6.4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
qstreambuf Class Reference

Adapter to use a qprocess as a stream. More...

Inheritance diagram for qstreambuf:
[legend]

Public Member Functions

 qstreambuf (QIODevice &, bool isstderr, bool takeoverdevice)
 
 ~qstreambuf ()
 
void detachDevice (bool readall)
 
virtual std::streambuf::int_type underflow ()
 
virtual std::streamsize xsputn (const char_type *, std::streamsize)
 
virtual int sync ()
 

Private Member Functions

void readAll ()
 

Private Attributes

std::vector< char > buffer_
 
bool ownsdevice_
 
QByteArray readbuffer_
 
QProcess * process_
 
QIODevice * iodevice_
 
bool isstderr_
 

Detailed Description

Adapter to use a qprocess as a stream.

Usage like:

qstreambuf fsb( QIODevice& ); std::istream strm( &fsb );

Tested for istream with char* only.

Constructor & Destructor Documentation

qstreambuf::qstreambuf ( QIODevice &  ,
bool  isstderr,
bool  takeoverdevice 
)
qstreambuf::~qstreambuf ( )

Member Function Documentation

void qstreambuf::detachDevice ( bool  readall)

Don't use device after this call.

Parameters
readalltrue if device should be emptied for all pending messages before.
void qstreambuf::readAll ( )
private
virtual int qstreambuf::sync ( )
virtual
virtual std::streambuf::int_type qstreambuf::underflow ( )
virtual
virtual std::streamsize qstreambuf::xsputn ( const char_type *  ,
std::streamsize   
)
virtual

Member Data Documentation

std::vector<char> qstreambuf::buffer_
private
QIODevice* qstreambuf::iodevice_
private
bool qstreambuf::isstderr_
private
bool qstreambuf::ownsdevice_
private
QProcess* qstreambuf::process_
private
QByteArray qstreambuf::readbuffer_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019