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

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