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

◆ anyID() [1/2]

Eformat datrw::anyID ( std::string  formatstring)

convert identifier from and to string representation

Definition at line 68 of file formats.cc.

References datrw::util::clipstring(), DATRW_abort, Fascii, Fbinary, Fbonjer, Fgse, Fhpmo, Fmseed, Fpdas, Fsac, Fseife, Fsff, Fsu, Ftfascii, Fthiesdl1, Ftsoft, datrw::bonjer::streamID, datrw::tfascii::streamID, datrw::gse::streamID, datrw::hpmo::streamID, datrw::sac::streamID, datrw::pdas::streamID, datrw::tsoft::streamID, datrw::seife::streamID, datrw::thiesdl1::streamID, datrw::mseed::streamID, datrw::ascii::streamID, datrw::sff::streamID, datrw::binary::streamID, and datrw::su::streamID.

Referenced by datrw::ianystream::ianystream(), datrw::oanystream::oanystream(), online_help(), datrw::oanystream::open(), datrw::ianystream::open(), and datrw::sequentialtracereader::select().

69  {
70  std::string id=util::clipstring(formatstring);
71  Eformat retval;
72  if (id==pdas::streamID) { retval=Fpdas; }
73  else if (id==sff::streamID) { retval=Fsff; }
74  else if (id==hpmo::streamID) { retval=Fhpmo; }
75  else if (id==mseed::streamID) { retval=Fmseed; }
76  else if (id==bonjer::streamID) { retval=Fbonjer; }
77  else if (id==sac::streamID) { retval=Fsac; }
78  else if (id==gse::streamID) { retval=Fgse; }
79  else if (id==tsoft::streamID) { retval=Ftsoft; }
80  else if (id==tfascii::streamID) { retval=Ftfascii; }
81  else if (id==su::streamID) { retval=Fsu; }
82  else if (id==seife::streamID) { retval=Fseife; }
83  else if (id==ascii::streamID) { retval=Fascii; }
84  else if (id==binary::streamID) { retval=Fbinary; }
85  else if (id==thiesdl1::streamID) { retval=Fthiesdl1; }
86  else {
87  std::cerr << "selected data format ID: \"" << id << "\"" << std::endl;
88  DATRW_abort("unknown data type identifier!");
89  }
90  return(retval);
91  } // Eformat anyID(const std::string& identifier)
#define DATRW_abort(M)
Abort and give a message.
Definition: error.h:101
std::string clipstring(std::string &s, const std::string &delim)
strip substringStrips off first substring up to given delimiter. The string is passed as a reference ...
Definition: util.cc:105
const char *const streamID
Format properties.
Definition: asciiformat.cc:47
Eformat
Definition: formats.h:54
Here is the call graph for this function:
Here is the caller graph for this function: