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

◆ open()

datrw::ianystream & fapidxx::IFileUnits::open ( const int &  unit,
const std::string &  filename 
)

open a new file

Definition at line 77 of file fileunit.cc.

References FAPIDXX_fuassert, getstream(), isopen(), Mformat, fapidxx::IFileUnits::IstreamCompound::Mianystream, fapidxx::IFileUnits::IstreamCompound::Mistream, and Mstreammap.

Referenced by sff_ropen__(), sff_ropenfs__(), and sff_ropens__().

79  {
80  FAPIDXX_fuassert((!this->isopen(unit)), unit,
81  "IFileUnits::open: file is already open");
82  IstreamCompound &compound=Mstreammap[unit];
83  compound.Mistream=new std::ifstream(filename.c_str(),
84  datrw::ianystream::openmode(Mformat));
85  compound.Mianystream=new datrw::ianystream(*compound.Mistream, Mformat);
86  return (this->getstream(unit));
87  } // datrw::ianystream& IFileUnits::open
bool isopen(const int &unit) const
check whether a file is opened for this file unit
Definition: fileunit.cc:103
#define FAPIDXX_fuassert(C, U, M)
Check an assertion and report by throwing an exception.
Definition: error.h:205
Tstreammap Mstreammap
place to hold my ianystream objects
Definition: fileunit.h:90
std::string Mformat
file type to be used
Definition: fileunit.h:88
datrw::ianystream & getstream(const int &unit)
return a stream associated with a file unit
Definition: fileunit.cc:112
Here is the call graph for this function:
Here is the caller graph for this function: