OpendTect-6_4  6.4
tableascio.h
Go to the documentation of this file.
1 #ifndef tableascio_h
2 #define tableascio_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: Nov 2006
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "bufstringset.h"
17 #include "repos.h"
18 #include "od_iosfwd.h"
19 #include "uistring.h"
20 class UnitOfMeasure;
21 
22 namespace Table
23 {
24 
25 class FormatDesc;
26 class ImportHandler;
27 class ExportHandler;
28 class Converter;
29 class FileFormatRepository;
30 
31 mGlobal(General) FileFormatRepository& FFR();
32 
33 
42 mExpClass(General) AscIO
44 public:
45 
46  AscIO( const FormatDesc& fd )
47  : fd_(fd)
48  , imphndlr_(0)
49  , exphndlr_(0)
50  , cnvrtr_(0)
51  , needfullline_(false)
52  , hdrread_(false) { units_.allowNull(true);}
53  virtual ~AscIO();
54 
55  const FormatDesc& desc() const { return fd_; }
56  uiString errMsg() const { return errmsg_; }
57  uiString warnMsg() const { return warnmsg_; }
58 
59 protected:
60 
61  const FormatDesc& fd_;
62  mutable uiString errmsg_;
63  mutable uiString warnmsg_;
69  mutable bool hdrread_;
72 
73  friend class AscIOImp_ExportHandler;
74  friend class AscIOExp_ImportHandler;
75 
76  void emptyVals() const;
77  void addVal(const char*,const UnitOfMeasure*) const;
78  bool getHdrVals(od_istream&) const;
79  int getNextBodyVals(od_istream&) const;
81  bool putHdrVals(od_ostream&) const;
82  bool putNextBodyVals(od_ostream&) const;
83 
84  const char* text(int) const; // Never returns null
85  int getIntValue(int,int udf=mUdf(int)) const;
86  float getFValue(int,float udf=mUdf(float)) const;
87  double getDValue(int,double udf=mUdf(double)) const;
88  // For more, use Conv:: stuff
89 
90  Coord getPos(int xfld,int yfld,
91  double udf=mUdf(double)) const;
92  //Return CRS converted Coord
93  Coord3 getPos3D(int xfld,int yfld, int zfld,
94  double udf=mUdf(double)) const;
95  BinID getBinID(int xfld,int yfld,
96  double udf=mUdf(double)) const;
97 
98  int formOf(bool hdr,int iinf) const;
99  int columnOf(bool hdr,int iinf,int ielem) const;
100 
101 public:
102  mDeprecated float getfValue(int idx,float udf=mUdf(float)) const
103  { return getFValue( idx, udf ); }
104  mDeprecated double getdValue(int idx,double udf=mUdf(double)) const
105  { return getDValue( idx, udf ); }
106 };
107 
108 
113 {
114 public:
115 
116  void getGroups(BufferStringSet&) const;
117  void getFormats(const char* grp,BufferStringSet&) const;
118 
119  const IOPar* get(const char* grp,const char* nm) const;
120  void set(const char* grp,const char* nm,
123 
124  bool write(Repos::Source) const;
125 
126 protected:
127 
128  FileFormatRepository();
129  void addFromFile(const char*,Repos::Source);
130  const char* grpNm(int) const;
131  int gtIdx(const char*,const char*) const;
132 
133  struct Entry
134  {
135  Entry( Repos::Source src, IOPar* iop )
136  : iopar_(iop), src_(src) {}
137  ~Entry();
138 
139  IOPar* iopar_;
141  };
142 
144 
145  mGlobal(General) friend FileFormatRepository& FFR();
146 
147 };
148 
149 
150 }; // namespace Table
151 
152 
153 #endif
mDeprecated double getdValue(int idx, double udf=mUdf(double)) const
Definition: tableascio.h:104
#define mExpClass(module)
Definition: commondefs.h:160
uiString errMsg() const
Definition: tableascio.h:56
ObjectSet< const UnitOfMeasure > units_
Definition: tableascio.h:65
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
AscIO(const FormatDesc &fd)
Definition: tableascio.h:46
Repos::Source src_
Definition: tableascio.h:140
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define mGlobal(module)
Definition: commondefs.h:163
ObjectSet< Entry > entries_
Definition: tableascio.h:143
bool hdrread_
Definition: tableascio.h:69
description of input our output data content
Definition: tabledef.h:220
Definition: uistring.h:89
Converter * cnvrtr_
Definition: tableascio.h:68
A cartesian coordinate in 2D space.
Definition: coord.h:25
Set of BufferString objects.
Definition: bufstringset.h:28
const FormatDesc & fd_
Definition: tableascio.h:61
Definition: tableascio.h:133
uiString warnmsg_
Definition: tableascio.h:63
OD class for stream read.
Definition: od_istream.h:24
FileFormatRepository & FFR()
Definition: tableconv.h:84
Entry(Repos::Source src, IOPar *iop)
Definition: tableascio.h:135
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: geom2dascio.h:21
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Source
Definition: repos.h:25
bool needfullline_
Definition: tableascio.h:70
uiString errmsg_
Definition: tableascio.h:62
A cartesian coordinate in 3D space.
Definition: coord.h:72
#define mDeprecated
Definition: plfdefs.h:233
BufferStringSet fullline_
Definition: tableascio.h:71
Ascii I/O using Format Description.
Definition: tableascio.h:42
IOPar * iopar_
Definition: tableascio.h:139
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
BufferString errmsg_
Definition: horizontracker.h:119
Holds system- and user-defined formats for different data types (&#39;groups&#39;)
Definition: tableascio.h:112
Definition: tableconv.h:55
uiString warnMsg() const
Definition: tableascio.h:57
mDeprecated float getfValue(int idx, float udf=mUdf(float)) const
Definition: tableascio.h:102
Definition: tableconv.h:24
const FormatDesc & desc() const
Definition: tableascio.h:55
Unit of Measure.
Definition: unitofmeasure.h:35
ImportHandler * imphndlr_
Definition: tableascio.h:66
ExportHandler * exphndlr_
Definition: tableascio.h:67
BufferStringSet vals_
Definition: tableascio.h:64

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