OpendTect-6_4  6.4
oddlsite.h
Go to the documentation of this file.
1 #ifndef oddlsite_h
2 #define oddlsite_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Nov 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "networkmod.h"
16 #include "callback.h"
17 #include "bufstring.h"
18 #include "uistring.h"
19 class BufferStringSet;
20 class TaskRunner;
21 class DataBuffer;
22 
23 
47 public:
48 
49  ODDLSite(const char* the_host,float timeout_sec=0);
50  ~ODDLSite();
51  bool isOK() const { return !isfailed_; }
52 
53  const char* host() const { return host_; }
54  const char* subDir() const { return subdir_; }
55  void setSubDir( const char* s ) { subdir_ = s; }
56  float timeout() const { return timeout_; }
57  void setTimeOut(float,bool storeinsettings);
58 
59  uiString errMsg() const { return errmsg_; }
60 
61  bool getFile(const char* fnm,const char* outfnm=0,
62  TaskRunner* tr=0, const char* nicename=0);
64  DataBuffer* obtainResultBuf();
66 
67  bool getFiles(const BufferStringSet& fnms,
68  const char* outputdir,TaskRunner&);
69  od_int64 getFileSize(const char* relfilenm);
70  bool haveErrMsg() const
71  { return !errmsg_.isEmpty(); }
73 
74  BufferString fullURL(const char*) const;
75 
76 protected:
77 
80  float timeout_;
81  bool islocal_;
82  bool issecure_;
83 
84  mutable uiString errmsg_;
85  bool isfailed_;
87 
88  void reqFinish(CallBacker*);
89  BufferString getFileName(const char*) const;
90  bool getLocalFile(const char*,const char*);
91 };
92 
93 
94 
95 #endif
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
bool islocal_
Definition: oddlsite.h:81
Definition: jobcommunic.h:24
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
BufferString subdir_
Definition: oddlsite.h:79
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
bool isOK() const
Definition: oddlsite.h:51
Class that can execute a task.
Definition: task.h:169
uiString errmsg_
Definition: oddlsite.h:84
bool isfailed_
Definition: oddlsite.h:85
int64_t getFileSize(const char *fnm, bool followlink=true)
bytes
float timeout() const
Definition: oddlsite.h:56
Raw data array with memory management.
Definition: databuf.h:22
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool isEmpty() const
Definition: odstring.h:51
uiString errMsg() const
Definition: oddlsite.h:59
BufferString errmsg_
Definition: horizontracker.h:119
float timeout_
Definition: oddlsite.h:80
DataBuffer * databuf_
Definition: oddlsite.h:86
bool issecure_
Definition: oddlsite.h:82
Access to an http site to get the contents of files.
Definition: oddlsite.h:45
bool haveErrMsg() const
if haveErrMsg(), then failure - otherwise user stop
Definition: oddlsite.h:70
const char * subDir() const
Definition: oddlsite.h:54
const char * host() const
Definition: oddlsite.h:53
BufferString host_
Definition: oddlsite.h:78
void setSubDir(const char *s)
Definition: oddlsite.h:55

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