OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | 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 ()
 
bool isOK () const
 
const char * host () const
 
const char * subDir () const
 
void setSubDir (const char *s)
 
float timeout () const
 
void setTimeOut (float, bool storeinsettings)
 
uiString errMsg () 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...
 
DataBufferobtainResultBuf ()
 the returned databuf becomes yours 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...
 
BufferString fullURL (const char *) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Protected Member Functions

void reqFinish (CallBacker *)
 
BufferString getFileName (const char *) const
 
bool getLocalFile (const char *, const char *)
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

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

Private Member Functions

 mODTextTranslationClass (ODDLSite)
 

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 ( const char *  the_host,
float  timeout_sec = 0 
)
ODDLSite::~ODDLSite ( )

Member Function Documentation

uiString ODDLSite::errMsg ( ) const
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.

BufferString ODDLSite::getFileName ( const char *  ) const
protected
bool ODDLSite::getFiles ( const BufferStringSet fnms,
const char *  outputdir,
TaskRunner  
)
od_int64 ODDLSite::getFileSize ( const char *  relfilenm)
bool ODDLSite::getLocalFile ( const char *  ,
const char *   
)
protected
bool ODDLSite::haveErrMsg ( ) const
inline

if haveErrMsg(), then failure - otherwise user stop

const char* ODDLSite::host ( ) const
inline
bool ODDLSite::isOK ( ) const
inline
ODDLSite::mODTextTranslationClass ( ODDLSite  )
private
DataBuffer* ODDLSite::obtainResultBuf ( )

the returned databuf becomes yours

void ODDLSite::reqFinish ( CallBacker )
protected
void ODDLSite::setSubDir ( const char *  s)
inline
void ODDLSite::setTimeOut ( float  ,
bool  storeinsettings 
)
const char* ODDLSite::subDir ( ) const
inline
float ODDLSite::timeout ( ) const
inline

Member Data Documentation

DataBuffer* ODDLSite::databuf_
protected
uiString ODDLSite::errmsg_
mutableprotected
BufferString ODDLSite::host_
protected
bool ODDLSite::isfailed_
protected
bool ODDLSite::islocal_
protected
bool ODDLSite::issecure_
protected
BufferString ODDLSite::subdir_
protected
float ODDLSite::timeout_
protected

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