#ifndef ROOT_TFileCollection
#define ROOT_TFileCollection
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class THashList;
class TMap;
class TList;
class TCollection;
class TFileInfo;
class TFileInfoMeta;
class TObjString;
class TFileCollection : public TNamed {
private:
THashList *fList;
TList *fMetaDataList;
TString fDefaultTree;
Long64_t fTotalSize;
Long64_t fNFiles;
Long64_t fNStagedFiles;
Long64_t fNCorruptFiles;
TFileCollection(const TFileCollection&);
TFileCollection& operator=(const TFileCollection&);
void PrintDetailed(TString &showOnly) const;
void FormatSize(Long64_t bytes, TString &um, Double_t &size) const;
public:
enum EStatusBits {
kRemoteCollection = BIT(15)
};
TFileCollection(const char *name = 0, const char *title = 0,
const char *file = 0, Int_t nfiles = -1, Int_t firstfile = 1);
virtual ~TFileCollection();
Int_t Add(TFileInfo *info);
Int_t Add(TFileCollection *coll);
Int_t AddFromFile(const char *file, Int_t nfiles = -1, Int_t firstfile = 1);
Int_t Add(const char *path);
THashList *GetList() { return fList; }
void SetList(THashList* list) { fList = list; }
TObjString *ExportInfo(const char *name = 0, Int_t popt = 0);
Long64_t Merge(TCollection* list);
Int_t RemoveDuplicates();
Int_t Update(Long64_t avgsize = -1);
void Sort(Bool_t useindex = kFALSE);
void SetAnchor(const char *anchor);
void Print(Option_t *option = "") const;
void SetBitAll(UInt_t f);
void ResetBitAll(UInt_t f);
Long64_t GetTotalSize() const { return fTotalSize; }
Long64_t GetNFiles() const { return fNFiles; }
Long64_t GetNStagedFiles() const { return fNStagedFiles; }
Long64_t GetNCorruptFiles() const { return fNCorruptFiles; }
Float_t GetStagedPercentage() const
{ return (fNFiles > 0) ? 100. * fNStagedFiles / fNFiles : 0; }
Float_t GetCorruptedPercentage() const
{ return (fNFiles > 0) ? 100. * fNCorruptFiles / fNFiles : 0; }
const char *GetDefaultTreeName() const;
void SetDefaultTreeName(const char* treeName) { fDefaultTree = treeName; }
Long64_t GetTotalEntries(const char *tree) const;
TFileInfoMeta *GetMetaData(const char *meta = 0) const;
void SetDefaultMetaData(const char *meta);
Bool_t AddMetaData(TObject *meta);
void RemoveMetaData(const char *meta = 0);
TFileCollection *GetStagedSubset();
TFileCollection *GetFilesOnServer(const char *server);
TMap *GetFilesPerServer(const char *exclude = 0, Bool_t curronly = kFALSE);
ClassDef(TFileCollection, 3)
};
#endif