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

◆ open()

void datrw::ianystream::open ( std::istream &  os,
std::string  format,
const bool &  debug = false 
)
private

actually open stream (to be called by constructor)

Definition at line 162 of file readany.cc.

References datrw::anyID(), datrw::util::clipstring(), DATRW_abort, DATRW_expect_no_modifier, datrw::idatstream::debug(), debug(), datrw::Fascii, datrw::Fbinary, datrw::Fbonjer, datrw::Fgse, datrw::Fhpmo, datrw::Fmseed, datrw::Fpdas, datrw::Fsac, datrw::Fseife, datrw::Fsff, datrw::Fsu, datrw::Ftfascii, datrw::Fthiesdl1, datrw::Ftsoft, Mformat, and Mis.

Referenced by ianystream().

164  {
165  std::string formatstring=util::clipstring(format);
166  std::string& modifiers=format;
167  Mformat=anyID(formatstring);
168  if (Mformat==Fbonjer)
169  {
171  Mis=new ibonjerstream(is);
172  }
173  else if (Mformat==Fpdas)
174  {
176  Mis=new ipdasstream(is);
177  }
178  else if (Mformat==Fsff)
179  {
181  Mis=new isffstream(is);
182  }
183  else if (Mformat==Fhpmo)
184  {
186  Mis=new ihpmostream(is);
187  }
188  else if (Mformat==Fmseed)
189  {
190  Mis=new imseedstream(is, modifiers);
191  }
192  else if (Mformat==Fsac)
193  {
195  Mis=new isacstream(is);
196  }
197  else if (Mformat==Fgse)
198  {
200  Mis=new igsestream(is);
201  }
202  else if (Mformat==Ftsoft)
203  {
204  Mis=new itsoftstream(is, modifiers);
205  }
206  else if (Mformat==Ftfascii)
207  {
209  Mis=new itfasciistream(is);
210  }
211  else if (Mformat==Fsu)
212  {
213  Mis=new isustream(is, modifiers);
214  }
215  else if (Mformat==Fseife)
216  {
217  Mis=new iseifestream(is, modifiers);
218  }
219  else if (Mformat==Fthiesdl1)
220  {
221  Mis=new ithiesdl1stream(is, modifiers);
222  }
223  else if (Mformat==Fascii)
224  {
225  Mis=new iasciistream(is, modifiers);
226  }
227  else if (Mformat==Fbinary)
228  {
230  Mis=new ibinarystream(is);
231  }
232  else
233  { DATRW_abort("ERROR (ianystream): unknown format!"); }
234  Mis->debug(debug);
235  }
datrw::idatstream * Mis
Definition: readany.h:127
Eformat anyID(std::string formatstring)
convert identifier from and to string representation
Definition: formats.cc:68
bool debug()
indicate debug mode
Definition: readany.h:116
bool debug()
indicate debug mode
Definition: datread.h:116
#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
datrw::Eformat Mformat
Definition: readany.h:128
#define DATRW_expect_no_modifier(F, M)
Issue warning if modifiers are passed but not evaluated.
Here is the call graph for this function:
Here is the caller graph for this function: