31 #ifndef __StStreamFile_h__
32 #define __StStreamFile_h__
49 explicit StStreamFile(
const char *fileName, ios_base::openmode mode
50 = ios_base::in) : mDebug(0), fStream() { open(fileName,mode); }
52 int Debug()
const {
return mDebug; }
53 void SetDebug(
int debug) { mDebug=debug; }
54 void Perror(
const char * header=0)
const;
57 virtual fstream &Read() = 0;
58 virtual char *Record() = 0;
59 virtual int Length()
const = 0;
60 virtual int Version()
const = 0;
61 virtual int RunNumber()
const = 0;
62 virtual int RecordUnixTime()
const = 0;
66 void open(
const char *fileName, ios_base::openmode mode = ios_base::in);
68 bool bad()
const {
return fStream.bad(); }
69 bool good()
const {
return fStream.good(); }
70 bool fail()
const {
return fStream.fail(); }
71 bool eof()
const {
return fStream.eof(); }
72 bool is_open() {
return fStream.is_open(); }
73 ios_base::iostate rdstate()
const {
return fStream.rdstate(); }
75 fstream &stream() {
return fStream ; }
76 const fstream &stream()
const {
return fStream ; }
77 const string &filename()
const {
return fFilename; }
80 istream &read(
char *s, streamsize n);
81 virtual bool closeFileSignal() {
return true; }