KaliVeda
Toolkit for HIC analysis
KVDatedFileManager.h
1 /*
2 $Id: KVDatedFileManager.h,v 1.2 2007/05/03 11:05:47 franklan Exp $
3 $Revision: 1.2 $
4 $Date: 2007/05/03 11:05:47 $
5 */
6 
9 
10 #ifndef __KVDatedFileManager_H
11 #define __KVDatedFileManager_H
12 
13 #include "TNamed.h"
14 #include "KVDatime.h"
15 #include "KVString.h"
16 #include "KVList.h"
17 
26 class KVSortableDatedFile : public TNamed {
28 
29 public:
30 
32  KVSortableDatedFile(const Char_t* filename, const Char_t* basename);
33  virtual ~KVSortableDatedFile() {};
34  virtual Int_t Compare(const TObject* obj) const;
35  virtual Bool_t IsEqual(const TObject* obj) const;
37  {
38  return fTimestamp;
39  };
40 
41  ClassDef(KVSortableDatedFile, 1)//A filename with an SQL-format date extension which can be used to sort a list according to date
42 };
43 
60 
61  void ReadFiles();
62 
63 public:
64 
66  KVDatedFileManager(const Char_t* base, const Char_t* dir);
67  virtual ~KVDatedFileManager() {};
68 
69  const Char_t* GetPreviousVersion(const Char_t* name);
70  const Char_t* GetOldestVersion();
71  void Update();
72 
73  ClassDef(KVDatedFileManager, 1) //Handles a set of different versions of files in a directory with the same base name and a timestamp
74 };
75 
76 #endif
int Int_t
bool Bool_t
char Char_t
#define ClassDef(name, id)
Handles a set of different versions of files with the same base name and a timestamp.
KVString fDirectory
the directory containg the files
const Char_t * GetPreviousVersion(const Char_t *name)
void Update()
Updates list of files.
KVString fBaseName
the base name of the file
const Char_t * GetOldestVersion()
Returns name of file with earliest timestamp.
KVList fFileList
list of files sorted by timestamp
Extension of TDatime to handle various useful date formats.
Definition: KVDatime.h:33
Extended TList class which owns its objects by default.
Definition: KVList.h:28
A filename with an SQL-format date extension which can be used to sort a list according to date.
KVDatime GetTimeStamp() const
virtual Bool_t IsEqual(const TObject *obj) const
Two files are the same if they have the same basename and timestamp.
KVDatime fTimestamp
timestamp extracted from filename
virtual Int_t Compare(const TObject *obj) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73