#ifndef ROOT_TArchiveFile
#define ROOT_TArchiveFile
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TDatime
#include "TDatime.h"
#endif
class TFile;
class TArchiveMember;
class TObjArray;
class TArchiveFile : public TObject {
private:
TArchiveFile(const TArchiveFile&);
TArchiveFile& operator=(const TArchiveFile&);
protected:
TString fArchiveName;
TString fMemberName;
Int_t fMemberIndex;
TFile *fFile;
TObjArray *fMembers;
TArchiveMember *fCurMember;
static Bool_t ParseUrl(const char *url, TString &archive, TString &member, TString &type);
public:
TArchiveFile() : fArchiveName(""), fMemberName(""), fMemberIndex(-1), fFile(0), fMembers(0), fCurMember(0) { }
TArchiveFile(const char *archive, const char *member, TFile *file);
virtual ~TArchiveFile();
virtual Int_t OpenArchive() = 0;
virtual Int_t SetCurrentMember() = 0;
virtual Int_t SetMember(const char *member);
virtual Int_t SetMember(Int_t idx);
Long64_t GetMemberFilePosition() const;
TArchiveMember *GetMember() const { return fCurMember; }
TObjArray *GetMembers() const { return fMembers; }
Int_t GetNumberOfMembers() const;
const char *GetArchiveName() const { return fArchiveName; }
const char *GetMemberName() const { return fMemberName; }
Int_t GetMemberIndex() const { return fMemberIndex; }
static TArchiveFile *Open(const char *url, TFile *file);
ClassDef(TArchiveFile,1)
};
class TArchiveMember : public TObject {
friend class TArchiveFile;
protected:
TString fName;
TString fComment;
TDatime fModTime;
Long64_t fPosition;
Long64_t fFilePosition;
Long64_t fCsize;
Long64_t fDsize;
Bool_t fDirectory;
public:
TArchiveMember();
TArchiveMember(const char *name);
TArchiveMember(const TArchiveMember &member);
TArchiveMember &operator=(const TArchiveMember &rhs);
virtual ~TArchiveMember() { }
const char *GetName() const { return fName; }
const char *GetComment() const { return fComment; }
TDatime GetModTime() const { return fModTime; }
Long64_t GetPosition() const { return fPosition; }
Long64_t GetFilePosition() const { return fFilePosition; }
Long64_t GetCompressedSize() const { return fCsize; }
Long64_t GetDecompressedSize() const { return fDsize; }
Bool_t IsDirectory() const { return fDirectory; }
ClassDef(TArchiveMember,1)
};
#endif