24 #include "StStreamFile.h"
28 StStreamFile::~StStreamFile() { close(); }
30 void StStreamFile::open(
const char *fileName, ios_base::openmode mode)
32 if (fFilename==fileName && is_open() ) {
34 fStream.seekg (0, ios::beg);
39 fStream.open(fFilename.c_str(),mode);
41 if (Debug()) Perror(
"StStreamFile::open");
45 void StStreamFile::close()
55 istream &StStreamFile::read(
char *s, streamsize n)
59 if (Debug()) Perror(
"StStreamFile::read");
63 void StStreamFile::Perror(
const char *header)
const
66 if (header && header[0]) std::cerr << header <<
": ";
67 std::cerr <<
" StStreamFile I/O error: "
71 <<
" for <" << fFilename <<
"> "
75 if (header && header[0]) std::cerr << header <<
": ";
76 std::cerr <<
"There was no I/O Error"
77 <<
" for <" << fFilename <<
"> "