Fortran SFF API to data I/O streams in C++
fapid_sff_skipdata.cc
Go to the documentation of this file.
1 
35 #define TF_FAPID_SFF_SKIPDATA_CC_VERSION \
36  "TF_FAPID_SFF_SKIPDATA_CC V1.0 "
37 
38 #include <fapidxx/fapidsff.h>
39 #include <fapidxx/fileunit.h>
40 #include <fapidxx/helper.h>
41 
42 using namespace fapidxx;
43 
69 int sff_skipdata__(integer *lu, char *code, logical *last, integer *ierr,
70  ftnlen code_len)
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__
92 
93 /* ----- END OF fapid_sff_skipdata.cc ----- */
int sff_skipdata__(integer *lu, char *code, logical *last, integer *ierr, ftnlen code_len)
Skip a complete trace.
This is the interface usually expected by Fortran programs linking to libsff.a (prototypes) ...
Definition: error.cc:44
long int integer
Fortran integer type.
Definition: fapidsff.h:66
void fillfstring(const std::string &s, char *fstring, ftnlen slen)
fill a Fortran string with a C++ string
Definition: helper.cc:60
long int logical
Fortran logical type.
Definition: fapidsff.h:68
long int ftnlen
Fortran string size type.
Definition: fapidsff.h:70
a file unit interface to libdatrwxx (prototypes)
::fapidxx::IFileUnits istreammanager
the global istream manager
Definition: fileunit.cc:48
some helper functions (prototypes)
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:91