37 #define TF_FILEUNIT_CC_VERSION \ 59 : Mformat(datrw::anyID(datrw::Fsff))
71 this->
close(first->first);
78 const std::string& filename)
81 "IFileUnits::open: file is already open");
83 compound.
Mistream=
new std::ifstream(filename.c_str(),
84 datrw::ianystream::openmode(
Mformat));
94 "IFileUnits::close: file is not open");
115 "IFileUnits::getstream: file is not open");
129 : Mformat(datrw::anyID(datrw::Fsff))
140 Tstreammap::iterator first=
Mstreammap.begin();
141 this->
close(first->first);
148 const std::string& filename)
151 "OFileUnits::open: file is already open");
153 datrw::abort_if_exists(filename);
154 compound.
Mostream=
new std::ofstream(filename.c_str(),
155 datrw::oanystream::openmode(
Mformat));
165 "OFileUnits::close: file is not open");
186 "OFileUnits::getstream: file is not open");
datrw::oanystream * Moanystream
bool isopen(const int &unit) const
check whether a file is opened for this file unit
datrw::ianystream * Mianystream
void setformat(const std::string &format)
set file format to be used upon file open
datrw::oanystream & open(const int &unit, const std::string &filename)
open a new file
exceptions and error handling macros (prototypes)
#define FAPIDXX_fuassert(C, U, M)
Check an assertion and report by throwing an exception.
Tstreammap Mstreammap
place to hold my oanystream objects
~OFileUnits()
destructor has to close all open files
void setformat(const std::string &format)
set file format to be used upon file open
::fapidxx::OFileUnits ostreammanager
the global ostream manager
datrw::ianystream & open(const int &unit, const std::string &filename)
open a new file
Tstreammap Mstreammap
place to hold my ianystream objects
OFileUnits()
default contructor to initialize member data
bool isopen(const int &unit) const
check whether a file is opened for this file unit
IFileUnits()
default contructor to initialize member data
std::string Mformat
file type to be used
a file unit interface to libdatrwxx (prototypes)
A C++ stream has to be handled together with an ianystream.
datrw::ianystream & getstream(const int &unit)
return a stream associated with a file unit
~IFileUnits()
destructor has to close all open files
datrw::Eformat selectedformat
file format to be used
datrw::oanystream & getstream(const int &unit)
return a stream associated with a file unit
void close(const int &unit)
close the file associated with this file unit
std::string Mformat
file type to be used
::fapidxx::IFileUnits istreammanager
the global istream manager
A C++ stream has to be handled together with an oanystream.
some helper functions (prototypes)
void close(const int &unit)
close the file associated with this file unit