OpendTect
6.6
|
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 allowpreloaded=true) const |
see makeOStream remark More... | |
StreamData | makeOStream (bool binary=true, bool editmode=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 | createIStream (const char *, bool binary=true) |
static StreamData | createOStream (const char *, bool binary=true, bool inplaceedit=false) |
static int | getPreLoadedDataPackID (const char *) |
static void | getPreLoadedFileNames (const char *id, BufferStringSet &) |
pass null id for all files More... | |
static void | getPreLoadedIDs (BufferStringSet &) |
static bool | isPreLoaded (const char *, bool isid) |
If isid, a single hit will return true. More... | |
static bool | preLoad (const BufferStringSet &, TaskRunner &, const char *id) |
id can be anything, usually MultiID though More... | |
static bool | preLoad (const char *, TaskRunner &, const char *id) |
id can be anything, usually MultiID though More... | |
static const char * | sStdErr () |
static const char * | sStdIO () |
static void | unLoad (const char *, bool isid=false) |
If isid, unload all with this id. More... | |
static void | unLoadAll () |
Static Protected Member Functions | |
static StreamData | makePLIStream (int) |
static void | sendCBMsg (const CallBack *, const char *) |
Protected Attributes | |
BufferString | fname_ |
OS::MachineCommand * | mc_ = nullptr |
BufferString | workingdir_ |
Private Member Functions | |
StreamProvider (const StreamProvider &)=delete | |
StreamProvider & | operator= (const StreamProvider &)=delete |
Provides I/O stream for file or system command.
Examples:
C:\tmp\xx.txt /tmp/xx.txt
Files on remote servers are not supported.
<>
StreamProvider::StreamProvider | ( | const char * | filenm = nullptr | ) |
StreamProvider::StreamProvider | ( | const OS::MachineCommand & | , |
const char * | workdir | ||
) |
StreamProvider::~StreamProvider | ( | ) |
|
privatedelete |
void StreamProvider::addPathIfNecessary | ( | const char * | ) |
adds given path if stored filename is relative
|
static |
keep binary==true also for text files unless you know what you are doing. win32 thing only.
|
static |
keep binary==true also for text files unless you know what you are doing. win32 thing only.
bool StreamProvider::exists | ( | bool | forread | ) | const |
|
inline |
|
static |
|
static |
pass null id for all files
|
static |
bool StreamProvider::isBad | ( | ) | const |
|
inline |
|
inline |
|
static |
If isid, a single hit will return true.
bool StreamProvider::isReadOnly | ( | ) | const |
StreamData StreamProvider::makeIStream | ( | bool | binary = true , |
bool | allowpreloaded = true |
||
) | const |
see makeOStream remark
StreamData StreamProvider::makeOStream | ( | bool | binary = true , |
bool | editmode = false |
||
) | const |
On win32, binary mode differs from text mode. Use binary=false when explicitly reading txt files. Use editmode=true when want to edit/modify existing data in a file.
|
staticprotected |
|
privatedelete |
|
static |
id can be anything, usually MultiID though
|
static |
id can be anything, usually MultiID though
bool StreamProvider::remove | ( | bool | recursive = true | ) | const |
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
|
staticprotected |
void StreamProvider::set | ( | const char * | inp | ) |
void StreamProvider::setCommand | ( | const OS::MachineCommand & | , |
const char * | workdir | ||
) |
void StreamProvider::setFileName | ( | const char * | ) |
bool StreamProvider::setReadOnly | ( | bool | yn | ) | const |
|
static |
|
static |
|
static |
If isid, unload all with this id.
|
static |
|
protected |
|
protected |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022