OpendTect  7.0
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
StreamProvider Class Reference

Provides I/O stream for file or system command. More...

Public Member Functions

 StreamProvider (const char *filenm=nullptr)
 
 StreamProvider (const OS::MachineCommand &, const char *workdir)
 
 ~StreamProvider ()
 
void addPathIfNecessary (const char *)
 adds given path if stored filename is relative More...
 
bool exists (bool forread) const
 
const char * fileName () const
 
bool isBad () const
 
bool isCommand () const
 
bool isFile () const
 
bool isReadOnly () const
 
StreamData makeIStream (bool binary=true, bool dummyarg=true) const
 
StreamData makeOStream (bool binary=true, bool inplaceedit=false) const
 
bool remove (bool recursive=true) const
 
bool rename (const char *, const CallBack *cb=0)
 
void set (const char *inp)
 
void setCommand (const OS::MachineCommand &, const char *workdir)
 
void setFileName (const char *)
 
bool setReadOnly (bool yn) const
 

Static Public Member Functions

static StreamData createCmdIStream (const OS::MachineCommand &, const char *workdir, bool fromstderr=false)
 
static StreamData createCmdOStream (const OS::MachineCommand &, const char *workdir)
 
static StreamData createIStream (const char *, bool binary=true)
 
static StreamData createOStream (const char *, bool binary=true, bool inplaceedit=false)
 
static const char * sStdErr ()
 
static const char * sStdIO ()
 

Static Protected Member Functions

static void sendCBMsg (const CallBack *, const char *)
 

Protected Attributes

BufferString fname_
 
OS::MachineCommandmc_ = nullptr
 
BufferString workingdir_
 

Private Member Functions

 StreamProvider (const StreamProvider &)=delete
 
StreamProvideroperator= (const StreamProvider &)=delete
 

Detailed Description

Provides I/O stream for file or system command.

Examples:

Constructor & Destructor Documentation

◆ StreamProvider() [1/3]

StreamProvider::StreamProvider ( const char *  filenm = nullptr)

◆ StreamProvider() [2/3]

StreamProvider::StreamProvider ( const OS::MachineCommand ,
const char *  workdir 
)

◆ ~StreamProvider()

StreamProvider::~StreamProvider ( )

◆ StreamProvider() [3/3]

StreamProvider::StreamProvider ( const StreamProvider )
privatedelete

Member Function Documentation

◆ addPathIfNecessary()

void StreamProvider::addPathIfNecessary ( const char *  )

adds given path if stored filename is relative

◆ createCmdIStream()

static StreamData StreamProvider::createCmdIStream ( const OS::MachineCommand ,
const char *  workdir,
bool  fromstderr = false 
)
static

◆ createCmdOStream()

static StreamData StreamProvider::createCmdOStream ( const OS::MachineCommand ,
const char *  workdir 
)
static

◆ createIStream()

static StreamData StreamProvider::createIStream ( const char *  ,
bool  binary = true 
)
static

keep binary==true also for text files unless you know what you are doing. win32 thing only.

◆ createOStream()

static StreamData StreamProvider::createOStream ( const char *  ,
bool  binary = true,
bool  inplaceedit = false 
)
static

keep binary==true also for text files unless you know what you are doing. win32 thing only.

◆ exists()

bool StreamProvider::exists ( bool  forread) const

◆ fileName()

const char* StreamProvider::fileName ( ) const
inline

◆ isBad()

bool StreamProvider::isBad ( ) const

◆ isCommand()

bool StreamProvider::isCommand ( ) const
inline

◆ isFile()

bool StreamProvider::isFile ( ) const
inline

◆ isReadOnly()

bool StreamProvider::isReadOnly ( ) const

◆ makeIStream()

StreamData StreamProvider::makeIStream ( bool  binary = true,
bool  dummyarg = true 
) const

◆ makeOStream()

StreamData StreamProvider::makeOStream ( bool  binary = true,
bool  inplaceedit = false 
) const

◆ operator=()

StreamProvider& StreamProvider::operator= ( const StreamProvider )
privatedelete

◆ remove()

bool StreamProvider::remove ( bool  recursive = true) const

◆ rename()

bool StreamProvider::rename ( const char *  ,
const CallBack cb = 0 
)

renames if file. if successful, does a set() The callback will be called with a const char* capsule

◆ sendCBMsg()

static void StreamProvider::sendCBMsg ( const CallBack ,
const char *   
)
staticprotected

◆ set()

void StreamProvider::set ( const char *  inp)

◆ setCommand()

void StreamProvider::setCommand ( const OS::MachineCommand ,
const char *  workdir 
)

◆ setFileName()

void StreamProvider::setFileName ( const char *  )

◆ setReadOnly()

bool StreamProvider::setReadOnly ( bool  yn) const

◆ sStdErr()

static const char* StreamProvider::sStdErr ( )
static

◆ sStdIO()

static const char* StreamProvider::sStdIO ( )
static

Member Data Documentation

◆ fname_

BufferString StreamProvider::fname_
protected

◆ mc_

OS::MachineCommand* StreamProvider::mc_ = nullptr
protected

◆ workingdir_

BufferString StreamProvider::workingdir_
protected

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