12 #ifndef ROOT_TFileInfo
13 #define ROOT_TFileInfo
38 class TFileInfo :
public TNamed {
51 void ParseInput(
const char *in);
53 TFileInfo& operator=(
const TFileInfo&);
59 kSortWithIndex = BIT(17)
62 TFileInfo(
const char *url = 0, Long64_t size = -1,
const char *uuid = 0,
63 const char *md5 = 0, TObject *meta = 0);
64 TFileInfo(
const TFileInfo &);
68 void ResetUrl() { fCurrentUrl = (TUrl*)fUrlList->First(); }
70 TUrl *GetCurrentUrl()
const;
71 TUrl *GetFirstUrl()
const {
return (TUrl*)fUrlList->First(); }
72 TUrl *GetUrlAt(Int_t i)
const {
return (TUrl*)fUrlList->At(i); }
73 Bool_t RemoveUrlAt(Int_t i);
74 Int_t GetNUrls()
const {
return fUrlList->GetEntries(); }
76 Bool_t SetCurrentUrl(
const char *url);
77 Bool_t SetCurrentUrl(TUrl *url);
79 Long64_t GetSize()
const {
return fSize; }
80 TUUID *GetUUID()
const {
return fUUID; }
81 TMD5 *GetMD5()
const {
return fMD5; }
82 TList *GetMetaDataList()
const {
return fMetaDataList; }
83 TFileInfoMeta *GetMetaData(
const char *meta = 0)
const;
85 void SetSize(Long64_t size) { fSize = size; }
86 void SetUUID(
const char *uuid);
88 TUrl *FindByUrl(
const char *url, Bool_t withDeflt = kFALSE);
90 Bool_t AddUrl(
const char *url, Bool_t infront = kFALSE);
91 Bool_t RemoveUrl(
const char *url);
92 Bool_t AddMetaData(TObject *meta);
93 Bool_t RemoveMetaData(
const char *meta = 0);
95 Bool_t IsSortable()
const {
return kTRUE; }
96 Int_t Compare(
const TObject *obj)
const;
98 Int_t GetIndex()
const {
return fIndex; }
99 void SetIndex(Int_t idx) { fIndex = idx; }
101 void Print(Option_t *options=
"")
const;
103 ClassDef(TFileInfo,4)
107 class TFileInfoMeta :
public TNamed {
117 TFileInfoMeta& operator=(
const TFileInfoMeta&);
120 enum EStatusBits { kExternal = BIT(15) };
122 TFileInfoMeta() : fEntries(-1), fFirst(0), fLast(-1),
123 fIsTree(kFALSE), fTotBytes(-1), fZipBytes(-1)
124 { ResetBit(TFileInfoMeta::kExternal); }
125 TFileInfoMeta(
const char *objPath,
const char *objClass =
"TTree",
126 Long64_t entries = -1, Long64_t first = 0, Long64_t last = -1,
127 Long64_t totbytes = -1, Long64_t zipbytes = -1);
128 TFileInfoMeta(
const char *objPath,
const char *objDir,
129 const char *objClass, Long64_t entries = -1,
130 Long64_t first = 0, Long64_t last = -1,
131 Long64_t totbytes = -1, Long64_t zipbytes = -1);
132 TFileInfoMeta(
const TFileInfoMeta &m);
134 virtual ~TFileInfoMeta() { }
136 const char *GetObject()
const;
137 const char *GetClass()
const {
return GetTitle(); }
138 const char *GetDirectory()
const;
139 Long64_t GetEntries()
const {
return fEntries; }
140 Long64_t GetFirst()
const {
return fFirst; }
141 Long64_t GetLast()
const {
return fLast; }
142 Bool_t IsTree()
const {
return fIsTree; }
143 Long64_t GetTotBytes()
const {
return fTotBytes; }
144 Long64_t GetZipBytes()
const {
return fZipBytes; }
146 void SetEntries(Long64_t entries) { fEntries = entries; }
147 void SetFirst(Long64_t first) { fFirst = first; }
148 void SetLast(Long64_t last) { fLast = last; }
149 void SetTotBytes(Long64_t tot) { fTotBytes = tot; }
150 void SetZipBytes(Long64_t zip) { fZipBytes = zip; }
152 void Print(Option_t *options=
"")
const;
154 ClassDef(TFileInfoMeta,2)