Warning, file /include/root/TArchiveFile.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TArchiveFile
0013 #define ROOT_TArchiveFile
0014
0015 #include "TObject.h"
0016 #include "TString.h"
0017 #include "TDatime.h"
0018
0019 class TFile;
0020 class TArchiveMember;
0021 class TObjArray;
0022
0023
0024 class TArchiveFile : public TObject {
0025
0026 private:
0027 TArchiveFile(const TArchiveFile&) = delete;
0028 TArchiveFile& operator=(const TArchiveFile&) = delete;
0029
0030 protected:
0031 TString fArchiveName;
0032 TString fMemberName;
0033 Int_t fMemberIndex;
0034 TFile *fFile;
0035 TObjArray *fMembers;
0036 TArchiveMember *fCurMember;
0037
0038 static Bool_t ParseUrl(const char *url, TString &archive, TString &member, TString &type);
0039
0040 public:
0041 TArchiveFile() : fArchiveName(""), fMemberName(""), fMemberIndex(-1), fFile(nullptr), fMembers(nullptr), fCurMember(nullptr) { }
0042 TArchiveFile(const char *archive, const char *member, TFile *file);
0043 ~TArchiveFile() override;
0044
0045 virtual Int_t OpenArchive() = 0;
0046 virtual Int_t SetCurrentMember() = 0;
0047 virtual Int_t SetMember(const char *member);
0048 virtual Int_t SetMember(Int_t idx);
0049
0050 Long64_t GetMemberFilePosition() const;
0051 TArchiveMember *GetMember() const { return fCurMember; }
0052 TObjArray *GetMembers() const { return fMembers; }
0053 Int_t GetNumberOfMembers() const;
0054
0055 const char *GetArchiveName() const { return fArchiveName; }
0056 const char *GetMemberName() const { return fMemberName; }
0057 Int_t GetMemberIndex() const { return fMemberIndex; }
0058
0059 static TArchiveFile *Open(const char *url, TFile *file);
0060
0061 ClassDefOverride(TArchiveFile,1)
0062 };
0063
0064
0065 class TArchiveMember : public TObject {
0066
0067 friend class TArchiveFile;
0068
0069 protected:
0070 TString fName;
0071 TString fComment;
0072 TDatime fModTime;
0073 Long64_t fPosition;
0074 Long64_t fFilePosition;
0075 Long64_t fCsize;
0076 Long64_t fDsize;
0077 Bool_t fDirectory;
0078
0079 public:
0080 TArchiveMember();
0081 TArchiveMember(const char *name);
0082 TArchiveMember(const TArchiveMember &member);
0083 TArchiveMember &operator=(const TArchiveMember &rhs);
0084 ~TArchiveMember() override { }
0085
0086 const char *GetName() const override { return fName; }
0087 const char *GetComment() const { return fComment; }
0088 TDatime GetModTime() const { return fModTime; }
0089 Long64_t GetPosition() const { return fPosition; }
0090 Long64_t GetFilePosition() const { return fFilePosition; }
0091 Long64_t GetCompressedSize() const { return fCsize; }
0092 Long64_t GetDecompressedSize() const { return fDsize; }
0093 Bool_t IsDirectory() const { return fDirectory; }
0094
0095 ClassDefOverride(TArchiveMember,1)
0096 };
0097
0098 #endif