![]() |
OpendTect
7.0
|
Access to an http site to get the contents of files. More...
Public Member Functions | |
ODDLSite (const char *the_host, float timeout_sec=0) | |
~ODDLSite () | |
uiString | errMsg () const |
BufferString | fullURL (const char *) const |
bool | getFile (const char *fnm, const char *outfnm=0, TaskRunner *tr=0, const char *nicename=0) |
Without a file name, get the DataBuffer. More... | |
bool | getFiles (const BufferStringSet &fnms, const char *outputdir, TaskRunner &) |
od_int64 | getFileSize (const char *relfilenm) |
bool | haveErrMsg () const |
if haveErrMsg(), then failure - otherwise user stop More... | |
const char * | host () const |
bool | isOK () const |
DataBuffer * | obtainResultBuf () |
the returned databuf becomes yours More... | |
void | setSubDir (const char *s) |
void | setTimeOut (float, bool storeinsettings) |
const char * | subDir () const |
float | timeout () const |
![]() | |
CallBacker () | |
CallBacker (const CallBacker &) | |
virtual | ~CallBacker () |
bool | attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const |
bool | attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const |
void | detachAllNotifiers () const |
Call from the destructor of your inherited object. More... | |
void | detachCB (const NotifierAccess &, const CallBack &) const |
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const |
virtual bool | isCapsule () const |
bool | isNotifierAttached (const NotifierAccess *) const |
Only for debugging purposes, don't use. More... | |
void | stopReceivingNotifications () const |
virtual CallBacker * | trueCaller () |
Protected Member Functions | |
BufferString | getFileName (const char *) const |
bool | getLocalFile (const char *, const char *) |
void | reqFinish (CallBacker *) |
Protected Attributes | |
DataBuffer * | databuf_ |
uiString | errmsg_ |
BufferString | host_ |
bool | isfailed_ |
bool | islocal_ |
bool | issecure_ |
BufferString | subdir_ |
float | timeout_ |
Additional Inherited Members | |
![]() | |
static void | createReceiverForCurrentThread () |
static void | removeReceiverForCurrentThread () |
Access to an http site to get the contents of files.
The URL defaults to opendtect.org. The subdir is going to be the current work directory on the site. You can change it at any time (unlike the host).
There are two main services: get one file, or get a bunch of files. To get one file, you request it. Set some kind of status bar, because it won't return until either an error occurs (e.g. a timeout is exceeded), or the file is there. This is meant for small files and minimum hassle.
If you need bigger files and/or you want users to be able to interrupt, then you need the version with the TaskRunner.
You can ask for a plain file on a local disk; pass 'DIR=the_file_name'. Then, no HTTP connection is made. If the site needs secure access, pass the full URL (i.e. https://xx.yy). At the time I'm making this comment, it is not implemented. For normal HTTP access, you can pass the host name or http://hostname .
<>
ODDLSite::ODDLSite | ( | const char * | the_host, |
float | timeout_sec = 0 |
||
) |
ODDLSite::~ODDLSite | ( | ) |
|
inline |
BufferString ODDLSite::fullURL | ( | const char * | ) | const |
bool ODDLSite::getFile | ( | const char * | fnm, |
const char * | outfnm = 0 , |
||
TaskRunner * | tr = 0 , |
||
const char * | nicename = 0 |
||
) |
Without a file name, get the DataBuffer.
|
protected |
bool ODDLSite::getFiles | ( | const BufferStringSet & | fnms, |
const char * | outputdir, | ||
TaskRunner & | |||
) |
od_int64 ODDLSite::getFileSize | ( | const char * | relfilenm | ) |
|
protected |
|
inline |
if haveErrMsg(), then failure - otherwise user stop
|
inline |
|
inline |
DataBuffer* ODDLSite::obtainResultBuf | ( | ) |
the returned databuf becomes yours
|
protected |
|
inline |
void ODDLSite::setTimeOut | ( | float | , |
bool | storeinsettings | ||
) |
|
inline |
|
inline |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generated at 02/08/2024 10:19:36 for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024