using namespace std;
#include <string>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "hrfiofile.h"
#include "hrfiofiletsm.h"
ClassImp(HRFIOFile)
HRFIOFile::HRFIOFile(const Char_t *name, Int_t mode)
{
fname = new TString(name);
fmode = mode;
status = ios::badbit;
pos = 0;
if(fname->BeginsWith("lxgstore"))
{
file = new HRFIOFileTSM(name,mode);
file->open(name,mode);
}
}
HRFIOFile::~HRFIOFile(void)
{
if(close())
cout << "Error closing file" << endl;
if(fname)
delete fname;
}
Int_t HRFIOFile::open(const Char_t *name, Int_t mode)
{
if(file)
return file->open(name,mode);
else
return -1;
}
Int_t HRFIOFile::close(void)
{
if(file)
return file->close();
else
return -1;
}
Int_t HRFIOFile::access(const Char_t *name, Int_t mode)
{
TString *tmp;
tmp = new TString(name);
if(tmp->BeginsWith("lxgstore"))
{
delete tmp;
return HRFIOFileTSM::access(name,mode);
}
else
delete tmp;
return -1;
}
Int_t HRFIOFile::read(Char_t *buffer, Int_t len)
{
if(file)
return file->read(buffer,len);
else
return -1;
}
Int_t HRFIOFile::write(const Char_t *buffer, Int_t len)
{
if(file)
return file->write(buffer,len);
else
return -1;
}
HRFIOFileTSM& HRFIOFile::seekp(streampos n)
{
return seekg(n,(ios::seekdir)ios::cur);
}
HRFIOFileTSM& HRFIOFile::seekg(streampos offs, Int_t p)
{
return file->seekg(offs,p);
}
streampos HRFIOFile::tellg(void)
{
if(file)
return file->tellg();
else
return -1;
}
void HRFIOFile::ignore(Int_t max, Int_t term)
{
seekp(max);
}
Bool_t HRFIOFile::good(void)
{
if(file)
return file->good();
else return kFALSE;
}
Bool_t HRFIOFile::eof(void)
{
if(file)
return file->eof();
else
return -1;
}
Bool_t HRFIOFile::fail(void)
{
return (status & ios::failbit) ? kTRUE:kFALSE;
}
Bool_t HRFIOFile::bad(void)
{
if(file)
return file->bad();
else
return -1;
}
Int_t HRFIOFile::rdstat(void)
{
if(file)
return file->rdstat();
else
return -1;
}
HRFIOFile& HRFIOFile::operator>>(HRFIOFile& u)
{
return *this;
}
HRFIOFile& HRFIOFile::operator<<( const HRFIOFile& u)
{
return *this;
}
Last change: Sat May 22 13:07:53 2010
Last generated: 2010-05-22 13:07
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.