|
Last change
on this file since 3840 was 447, checked in by harald, 25 years ago |
|
Bringing the sources for the octobertest under CVS controll.
(november, 3rd, 2000)
|
-
Property svn:executable
set to
*
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | #include "MFile.h"
|
|---|
| 2 |
|
|---|
| 3 | #include "MFileDescr.h"
|
|---|
| 4 |
|
|---|
| 5 | ClassImp(MFile)
|
|---|
| 6 | ClassImp(MRootFile)
|
|---|
| 7 | ClassImp(MMagicFile)
|
|---|
| 8 |
|
|---|
| 9 | /* -- general Base class for all file types used in the magic environment -- */
|
|---|
| 10 | MFile::~MFile()
|
|---|
| 11 | {
|
|---|
| 12 | if (fIn)
|
|---|
| 13 | delete fIn;
|
|---|
| 14 |
|
|---|
| 15 | if (fOut)
|
|---|
| 16 | delete fOut;
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | /* -- general base class for all MParConmtainer which want to read and
|
|---|
| 20 | write magic files */
|
|---|
| 21 | void MMagicFileImp::GetNBytes(fstream& fin, Byte_t *buffer, Char_t cnt)
|
|---|
| 22 | {
|
|---|
| 23 | for (int i=cnt-1; i>=0; i--)
|
|---|
| 24 | fin >> *(buffer+i);
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | void MMagicFileImp::PutNBytes(fstream& fout, Byte_t *buffer, Char_t cnt)
|
|---|
| 28 | {
|
|---|
| 29 | for (int i=cnt-1; i>=0; i--)
|
|---|
| 30 | fout << *(buffer+i);
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | /* -- file descriptor class for a magic root file -- */
|
|---|
| 34 | MFileDescrIn *MRootFile::OpenInput(const char *fName, const char *cname)
|
|---|
| 35 | {
|
|---|
| 36 | fIn = new MRootFileIn(this, fName, cname);
|
|---|
| 37 | return fIn;
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | MFileDescrOut *MRootFile::OpenOutput(const char *fName, const char *cname, MParContainer **obj)
|
|---|
| 41 | {
|
|---|
| 42 | fOut = new MRootFileOut(fName, cname, obj);
|
|---|
| 43 | return fOut;
|
|---|
| 44 | }
|
|---|
| 45 |
|
|---|
| 46 | /* -- file descriptor class for a magic magic file -- */
|
|---|
| 47 |
|
|---|
| 48 | MFileDescrIn *MMagicFile::OpenInput(const char *fName, const char *cname)
|
|---|
| 49 | {
|
|---|
| 50 | fIn = new MMagicFileIn(fName);
|
|---|
| 51 | return fIn;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | MFileDescrOut *MMagicFile::OpenOutput(const char *fName, const char *cname, MParContainer **obj)
|
|---|
| 55 | {
|
|---|
| 56 | fOut = new MMagicFileOut(fName, obj);
|
|---|
| 57 | return fOut;
|
|---|
| 58 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.