OpendTect-6_4  6.4
iostrm.h
Go to the documentation of this file.
1 #ifndef iostrm_H
2 #define iostrm_H
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 2-8-1995
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "generalmod.h"
17 #include "streamconn.h"
18 #include "filespec.h"
19 #include "ioobj.h"
20 class StreamProvider;
21 
22 
23 /*\brief is a file entry in the omf. */
24 
25 
26 mExpClass(General) IOStream : public IOObj
27 {
28 public:
29  IOStream(const char* nm=0,const char* id=0,
30  bool =false);
31  IOStream(const IOStream&);
32  virtual bool isBad() const;
33 
34  virtual void copyFrom(const IOObj*);
35  virtual const char* fullUserExpr(bool forread=true) const;
36  virtual BufferString mainFileName() const;
37  virtual const char* connType() const;
38  virtual Conn* getConn(bool) const;
39 
40  virtual bool implExists(bool forread) const;
41  virtual bool implReadOnly() const;
42  virtual bool implRemove() const;
43  virtual bool implSetReadOnly(bool) const;
44  virtual bool implRename(const char*,const CallBack* cb=0);
45  virtual bool implManagesObjects() const { return false; }
46 
47  bool isMultiConn() const { return isMulti(); }
48  int curConnIdx() const { return curfidx_; }
49  void resetConnIdx() const { curfidx_ = 0; }
50  int connIdxFor(int nr) const;
51  bool toNextConnIdx() const
52  { curfidx_++; return curfidx_ < nrFiles(); }
53  void setConnIdx( int idx ) const
54  { curfidx_ = idx; }
55 
56  FileSpec& fileSpec() { return fs_; }
57  const FileSpec& fileSpec() const { return fs_; }
58  void setExt( const char* ext ) { extension_ = ext; }
59  void genFileName();
60 
61  int nrFiles() const { return fs_.nrFiles();}
62  bool isMulti() const { return nrFiles()>1; }
63 
64 protected:
65 
66  virtual bool getFrom(ascistream&);
67  virtual bool putTo(ascostream&) const;
68 
70  mutable int curfidx_;
73 
74  StreamProvider* getStreamProv(bool,bool f=true) const;
75  bool implDoAll(bool,bool yn=true) const;
76 
77 public:
78 
79  virtual void setDirName(const char*);
80  virtual void setAbsDirectory(const char*);
81 
82 };
83 
84 
85 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: ioobj.h:58
Provides I/O stream for file or system command.
Definition: strmprov.h:46
Definition: iostrm.h:26
bool toNextConnIdx() const
Definition: iostrm.h:51
int curfidx_
Definition: iostrm.h:70
OpendTect standard ascii format file writing.
Definition: ascstream.h:32
bool isMulti() const
Definition: iostrm.h:62
bool isBad() const
Definition: strmprov.h:52
int nrFiles() const
Definition: iostrm.h:61
void setExt(const char *ext)
Definition: iostrm.h:58
int curConnIdx() const
Definition: iostrm.h:48
BufferString extension_
Definition: iostrm.h:71
OpendTect standard ascii format file reading.
Definition: ascstream.h:83
Data connection.
Definition: conn.h:30
bool isMultiConn() const
Definition: iostrm.h:47
Specification for one or more files.
Definition: filespec.h:28
FileSpec fs_
Definition: iostrm.h:69
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
virtual bool implManagesObjects() const
Definition: iostrm.h:45
const FileSpec & fileSpec() const
Definition: iostrm.h:57
FileSpec & fileSpec()
Definition: iostrm.h:56
void resetConnIdx() const
Definition: iostrm.h:49
CallBacks object-oriented (object + method).
Definition: callback.h:57
BufferString specfname_
Definition: iostrm.h:72
void setConnIdx(int idx) const
Definition: iostrm.h:53

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