DATRW++ library: seismic data I/O with multiple formats

◆ Dataline()

datrw::tsoft::Dataline::Dataline ( const std::string &  line)

swallow a line

read one line of samples from data file

Definition at line 122 of file tsoftdata.cc.

References DATRW_assert, DATRW_report_assert, Mline, Msamples, Mtime, and sample().

122  :
123  Mline(line)
124  {
125  int year,month,day,hour,minute ,second;
126  std::istringstream iss(Mline);
127  iss >> year >> month >> day >> hour >> minute >> second;
128  DATRW_report_assert(iss.good(),
129  "read beyond end of data line when reading date and time" << line);
130  DATRW_assert(iss.good(), "empty data line or read beyond end of file");
131  Mtime=libtime::TAbsoluteTime(year,month,day,hour,minute,second);
132  double sample;
133  while (iss.good())
134  {
135  iss >> sample;
136  //if (iss.good()) { Msamples.push_back(sample); }
137  Msamples.push_back(sample);
138  // std::cout << "sample " << sample << std::endl;
139  }
140  } // Dataline::Dataline(const std::string& line)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:92
Tvod Msamples
vector of data values
Definition: tsoftdata.h:234
std::string Mline
the data line
Definition: tsoftdata.h:230
double sample(const int &i) const
return specific sample
Definition: tsoftdata.cc:145
libtime::TAbsoluteTime Mtime
time
Definition: tsoftdata.h:232
#define DATRW_report_assert(C, M)
Check an assertion and report only.
Definition: error.h:120
Here is the call graph for this function: