7 #ifndef LHAPDF_FileIO_H
8 #define LHAPDF_FileIO_H
20 template <
class FILETYPE>
25 File(
const std::string& name)
26 : _name(name), _fileptr(
nullptr), _streamptr(
nullptr) {
47 std::string
getContent()
const {
return _streamptr !=
nullptr ? _streamptr->str() :
""; }
56 std::stringstream* _streamptr;
64 #define IFile File<std::ifstream>
65 #define OFile File<std::ofstream>
std::string getContent() const
Get the file content.
Definition: FileIO.h:47
FILETYPE * operator->() const
Forward methods via pointer emulation.
Definition: FileIO.h:41
void flushFileCache()
Global function to flush the MPI-safe file cache.
~File()
Destructor.
Definition: FileIO.h:31
MPI-safe file I/O interface.
Definition: FileIO.h:21
FILETYPE & operator*() const
Forward methods via pointer-dereference emulation.
Definition: FileIO.h:44