DATRW++ library: seismic data I/O with multiple formats
tfascii.h
Go to the documentation of this file.
1 /*! \file tfascii.h
2  * \brief read Thomas Forbrigers ASCII data (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Daniel Armbruster
7  * \date 05/10/2010
8  *
9  * Purpose: read Thomas Forbrigers ASCII data (prototypes)
10  *
11  * ----
12  * This file is part of libdatrwxx.
13  *
14  * libdatrwxx is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * libdatrwxx is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with libdatrwxx. If not, see <http://www.gnu.org/licenses/>.
26  * ----
27  *
28  * Copyright (c) 2010 by Daniel Armbruster
29  *
30  * REVISIONS and CHANGES
31  * - 05/10/2010 V0.1 Daniel Armbruster
32  * - 23/11/2010 V1.1 Thomas Forbriger: introduced static member data
33  *
34  * ============================================================================
35  */
36 
37 #ifndef DATRW_TFASCII_H_VERSION
38 
39 #define DATRW_TFASCII_H_VERSION \
40  "DATRW_TFASCII_H V1.1"
41 
42 #include <datrwxx/datread.h>
43 #include <datrwxx/readtfascii.h>
44 
45 namespace datrw {
46 
47  namespace tfascii {
48 
49  extern const bool isbinary;
50  extern const char* const streamID;
51 
52  } // namespace tfascii
53 
54  /*----------------------------------------------------------------------*/
55 
56  /*! \brief input stream to read seismic data provided by T. Forbriger's
57  * any2ascii
58  *
59  * \ingroup group_tfascii
60  *
61  * The concept is based on SFF data contents and we will make use of SFF
62  * structures.
63  */
64  class itfasciistream: public idatstream {
65  public:
66  typedef idatstream Tbase;
67  //! constructor
68  /*!
69  \param is the input stream
70  \param verbose for verbose output
71  */
72  itfasciistream(std::istream& is, const bool& verbose = false);
73  //! destructor
74  virtual ~itfasciistream();
75  //! to read the data as double
76  /*!
77  \return the timeseries (double)
78  */
79  virtual Tdseries dseries();
80  //! to read the data as float
81  /*!
82  \return the timeseries (float)
83  */
84  virtual Tfseries fseries();
85  //! to read the data as integer
86  /*!
87  \return the timeseries (integer)
88  */
89  virtual Tiseries iseries();
90  //! reads only the header of the data
91  virtual void skipseries() { set_traceheader(); }
92  //! print some info about data conversion
93  /*!
94  \param os the output stream
95  */
96  static void help(std::ostream& os=std::cout);
97  static const std::ios_base::openmode openmode;
98  private:
99  //! for verbose output
100  const bool Mverbose;
101  //! set the file header data
102  void set_fileheader();
103  //! set the trace header data
104  void set_traceheader();
105  //! member function
106  /*!
107  \return if verbose output is decided
108  */
109  bool get_verbose() const;
110  }; // class itfasciistream
111 
112 } // namespace datrw
113 
114 #endif // DATRW_TFASCII_H_VERSION (includeguard)
115 
116 /* ----- END OF tfascii.h ----- */
virtual void skipseries()
reads only the header of the data
Definition: tfascii.h:91
input stream to read seismic data provided by T. Forbriger&#39;s any2ascii
Definition: tfascii.h:64
aff::Series< float > Tfseries
Definition: types.h:46
virtual Tdseries dseries()
to read the data as double
itfasciistream(std::istream &is, const bool &verbose=false)
constructor
const bool Mverbose
for verbose output
Definition: tfascii.h:100
aff::Series< double > Tdseries
Definition: types.h:45
void set_fileheader()
set the file header data
virtual Tfseries fseries()
to read the data as float
const char *const streamID
Format properties.
bool get_verbose() const
member function
Root namespace of library.
Definition: aalibdatrwxx.cc:16
idatstream Tbase
Definition: tfascii.h:66
const bool isbinary
Format properties.
static const std::ios_base::openmode openmode
Definition: tfascii.h:97
aff::Series< int > Tiseries
Definition: types.h:47
static void help(std::ostream &os=std::cout)
print some info about data conversion
virtual Tiseries iseries()
to read the data as integer
void set_traceheader()
set the trace header data
virtual ~itfasciistream()
destructor