Fortran SFF API to data I/O streams in C++

◆ sff_skipdata__()

int sff_skipdata__ ( integer lu,
char *  code,
logical last,
integer ierr,
ftnlen  code_len 
)

Skip a complete trace.

Description from stuff.f:

c--------------------------------------------------------------------------
subroutine sff_SkipData(lu,code,last,ierr)
c
c Skip a data block including DAST, WID2 DAT2, data, CHK2 and optionally
c appended Free and Info blocks. Close file if last data block
c is read.
c
c major changes:
c 22/11/96 T.F. added variables code and last to parameter list
c (is needed to decide whether there will
c follow another datablock or not)
c
integer lu,ierr
logical last
character code*(*)
c--------------------------------------------------------------------------

Definition at line 69 of file fapid_sff_skipdata.cc.

References fapidxx::IFileUnits::close(), fapidxx::fillfstring(), and fapidxx::istreammanager.

71 {
72  int retval=0;
73  *ierr=0;
74  try {
75  datrw::ianystream &is=istreammanager(static_cast<int>(*lu));
76  std::string ocode("");
77  if (is.hasinfo())
78  {
79  ocode="I";
80  }
81  if (!is.last()) { ocode += "D"; }
82  fillfstring(ocode, code, code_len);
83  is.skipseries();
84  *last = is.last() ? 1 : 0;
85  if (is.last()) { istreammanager.close(static_cast<int>(*lu)); }
86  }
87  catch(...) {
88  *ierr=1;
89  }
90  return retval;
91 } // int sff_skipdata__
void fillfstring(const std::string &s, char *fstring, ftnlen slen)
fill a Fortran string with a C++ string
Definition: helper.cc:60
::fapidxx::IFileUnits istreammanager
the global istream manager
Definition: fileunit.cc:48
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:91
Here is the call graph for this function: