OpendTect  6.6
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 int sync ()
 
virtual std::streambuf::int_type underflow ()
 
virtual std::streamsize xsputn (const char_type *, std::streamsize)
 

Private Member Functions

void readAll ()
 

Private Attributes

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

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::qstreambuf ( QIODevice &  ,
bool  isstderr,
bool  takeoverdevice 
)

◆ ~qstreambuf()

qstreambuf::~qstreambuf ( )

Member Function Documentation

◆ detachDevice()

void qstreambuf::detachDevice ( bool  readall)

Don't use device after this call.

Parameters
readalltrue if device should be emptied for all pending messages before.

◆ readAll()

void qstreambuf::readAll ( )
private

◆ sync()

virtual int qstreambuf::sync ( )
virtual

◆ underflow()

virtual std::streambuf::int_type qstreambuf::underflow ( )
virtual

◆ xsputn()

virtual std::streamsize qstreambuf::xsputn ( const char_type *  ,
std::streamsize   
)
virtual

Member Data Documentation

◆ buffer_

std::vector<char> qstreambuf::buffer_
private

◆ iodevice_

QIODevice* qstreambuf::iodevice_
private

◆ isstderr_

bool qstreambuf::isstderr_
private

◆ ownsdevice_

bool qstreambuf::ownsdevice_
private

◆ process_

QProcess* qstreambuf::process_
private

◆ readbuffer_

QByteArray qstreambuf::readbuffer_
private

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