TSIO++ Time series input/output
sfftsfileread.h
Go to the documentation of this file.
1 
38 // include guard
39 #ifndef TSIO_SFFTSFILEREAD_H_VERSION
40 
41 #define TSIO_SFFTSFILEREAD_H_VERSION \
42  "TSIO_SFFTSFILEREAD_H 2019/04/02"
43 
44 #include<tsioxx/sfftsfile.h>
46 
47 namespace ts {
48 
49  namespace sff {
50 
51  /*======================================================================*/
52  // member functions
53 
56  template<class C>
57  inline void File<C>::read(datrw::idatstream& is, const bool& verbose)
58  {
59  Trangelist rl;
60  this->read(is, rl, verbose);
61  } // File<C>::read
62 
63  /*----------------------------------------------------------------------*/
64 
65 
68  template<class C>
69  inline void File<C>::read(datrw::idatstream& is,
70  const Trangelist& rl,
71  const bool& verbose)
72  {
73  is >> this->fileheader;
74  int itrace=0;
75  while (is.good())
76  {
77  ++itrace;
78  if ((rl.size()==0) || rl.contains(itrace))
79  {
80  if (verbose)
81  { std::cout << " * read trace #" << itrace << std::endl; }
82  Ttimeseries timeseries;
83  is >> timeseries;
84  timeseries.settraceindex(itrace);
85  this->push_back(timeseries);
86  }
87  else
88  {
89  if (verbose)
90  { std::cout << " skip trace #" << itrace << std::endl; }
91  is.skipseries();
92  }
93  }
94  } // File<C>::read
95 
96  } // namespace sff
97 
98 } // namespace ts
99 
100 #endif // TSIO_SFFTSFILEREAD_H_VERSION (includeguard)
101 
102 /* ----- END OF sfftsfileread.h ----- */
void read(datrw::idatstream &is, const bool &verbose=false)
Read a complete file with all traces.
Definition: sfftsfileread.h:57
input operators for SFF TimeSeries traces and files for libdatrwxx streams (prototypes).
Outer namespace.
Definition: cmdlinefiles.cc:46
tfxx::RangeList< int > Trangelist
Definition: sfftsfile.h:71
void settraceindex(int ti)
set trace index member data
data file container for SFF TimeSeries (prototypes)