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

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()

int qstreambuf::sync ( )
override

◆ underflow()

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

◆ xsputn()

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

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-2024