OpendTect-6_4  6.4
streamconn.h
Go to the documentation of this file.
1 #ifndef streamconn_h
2 #define streamconn_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: 21-10-1995
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "generalmod.h"
17 #include "conn.h"
18 #include "od_iosfwd.h"
19 #include "bufstring.h"
20 
21 
26 mExpClass(General) StreamConn : public Conn
27 {
28 public:
29  StreamConn();
34  StreamConn(const char* fnm,bool forread);
35  virtual ~StreamConn();
36 
37  virtual bool isBad() const;
38  virtual const char* creationMessage() const { return creationmsg_; }
39  virtual bool forRead() const;
40  virtual bool forWrite() const;
41  virtual StreamConn* getStream() { return this; }
42  virtual void close();
43 
44  void setStream(od_istream*);
45  void setStream(od_ostream*);
46  void setStream(od_istream&);
47  void setStream(od_ostream&);
48 
49  od_stream& odStream();
50  od_istream& iStream();
51  od_ostream& oStream();
52  void setFileName(const char*,bool forread);
53  const char* fileName() const;
54 
55  const char* connType() const { return sType(); }
56  static const char* sType();
57 
58 
59 private:
60 
62  bool mine_;
63 
65 
66  void fillCrMsg(od_stream*);
67 
68 };
69 
70 
71 #endif
#define mExpClass(module)
Definition: commondefs.h:160
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
od_stream * strm_
Definition: streamconn.h:61
OD base class for stream read/write.
Definition: od_stream.h:53
OD class for stream read.
Definition: od_istream.h:24
const char * connType() const
Definition: streamconn.h:55
Data connection.
Definition: conn.h:30
BufferString creationmsg_
Definition: streamconn.h:64
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
virtual const char * creationMessage() const
Definition: streamconn.h:38
bool mine_
Definition: streamconn.h:62
Connection with an underlying iostream.
Definition: streamconn.h:26
virtual StreamConn * getStream()
Definition: streamconn.h:41

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