OpendTect  7.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ODDLSite Class Reference

Access to an http site to get the contents of files. More...

Inheritance diagram for ODDLSite:
[legend]

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
 
DataBufferobtainResultBuf ()
 the returned databuf becomes yours More...
 
void setSubDir (const char *s)
 
void setTimeOut (float, bool storeinsettings)
 
const char * subDir () const
 
float timeout () const
 
- Public Member Functions inherited from CallBacker
 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 CallBackertrueCaller ()
 

Protected Member Functions

BufferString getFileName (const char *) const
 
bool getLocalFile (const char *, const char *)
 
void reqFinish (CallBacker *)
 

Protected Attributes

DataBufferdatabuf_
 
uiString errmsg_
 
BufferString host_
 
bool isfailed_
 
bool islocal_
 
bool issecure_
 
BufferString subdir_
 
float timeout_
 

Additional Inherited Members

- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Detailed Description

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 .

<>

Constructor & Destructor Documentation

◆ ODDLSite()

ODDLSite::ODDLSite ( const char *  the_host,
float  timeout_sec = 0 
)

◆ ~ODDLSite()

ODDLSite::~ODDLSite ( )

Member Function Documentation

◆ errMsg()

uiString ODDLSite::errMsg ( ) const
inline

◆ fullURL()

BufferString ODDLSite::fullURL ( const char *  ) const

◆ getFile()

bool ODDLSite::getFile ( const char *  fnm,
const char *  outfnm = 0,
TaskRunner tr = 0,
const char *  nicename = 0 
)

Without a file name, get the DataBuffer.

◆ getFileName()

BufferString ODDLSite::getFileName ( const char *  ) const
protected

◆ getFiles()

bool ODDLSite::getFiles ( const BufferStringSet fnms,
const char *  outputdir,
TaskRunner  
)

◆ getFileSize()

od_int64 ODDLSite::getFileSize ( const char *  relfilenm)

◆ getLocalFile()

bool ODDLSite::getLocalFile ( const char *  ,
const char *   
)
protected

◆ haveErrMsg()

bool ODDLSite::haveErrMsg ( ) const
inline

if haveErrMsg(), then failure - otherwise user stop

◆ host()

const char* ODDLSite::host ( ) const
inline

◆ isOK()

bool ODDLSite::isOK ( ) const
inline

◆ obtainResultBuf()

DataBuffer* ODDLSite::obtainResultBuf ( )

the returned databuf becomes yours

◆ reqFinish()

void ODDLSite::reqFinish ( CallBacker )
protected

◆ setSubDir()

void ODDLSite::setSubDir ( const char *  s)
inline

◆ setTimeOut()

void ODDLSite::setTimeOut ( float  ,
bool  storeinsettings 
)

◆ subDir()

const char* ODDLSite::subDir ( ) const
inline

◆ timeout()

float ODDLSite::timeout ( ) const
inline

Member Data Documentation

◆ databuf_

DataBuffer* ODDLSite::databuf_
protected

◆ errmsg_

uiString ODDLSite::errmsg_
mutableprotected

◆ host_

BufferString ODDLSite::host_
protected

◆ isfailed_

bool ODDLSite::isfailed_
protected

◆ islocal_

bool ODDLSite::islocal_
protected

◆ issecure_

bool ODDLSite::issecure_
protected

◆ subdir_

BufferString ODDLSite::subdir_
protected

◆ timeout_

float ODDLSite::timeout_
protected

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