SFF++ library: reading and writing SFF from C++

◆ read()

void sff::DAST::read ( std::istream &  is,
const bool &  debug = false 
)

Definition at line 510 of file sffxx.cc.

References ampfac, hasfree, hasinfo, last, and nchar.

Referenced by DAST(), and sff::TraceHeader::readheader().

511  {
512  if (debug)
513  {
514  std::cerr << "DEBUG (DAST::read):" << std::endl;
515  }
516  std::string theline;
517  std::getline(fis, theline);
518  if (debug) { std::cerr << theline << std::endl; }
519 
520  std::string lineID=theline.substr(0,4);
521  if (debug) { std::cerr << lineID << std::endl; }
522  if (!helper::IDmatch<DAST>(lineID)) throw
523  GSE2::Terror("ERROR (DAST::read): missing DAST ID!");
524 
525  this->nchar=atoi(theline.substr(6,10).c_str());
526  this->ampfac=atof(theline.substr(17,16).c_str());
527 
528  std::string code=theline.substr(34,10);
529  if (debug)
530  {
531  std::cerr << "DEBUG (DAST): read nchar=" << nchar
532  << " ampfac=" << ampfac << " code=" << code << std::endl;
533  }
534  this->hasinfo=(code.find('I')!=std::string::npos);
535  this->hasfree=(code.find('F')!=std::string::npos);
536  this->last=(code.find('D')==std::string::npos);
537  } // DAST::read(std::istream& fis, const bool& debug)
bool last
Definition: sffxx.h:190
double ampfac
Definition: sffxx.h:187
int nchar
Definition: sffxx.h:186
bool hasinfo
Definition: sffxx.h:189
bool hasfree
Definition: sffxx.h:188
Here is the caller graph for this function: