KaliVeda
Toolkit for HIC analysis
KVDMS.h
1 
4 #ifndef __KVDMS_H
5 #define __KVDMS_H
6 
7 #include "KVBase.h"
8 #include "KVDatime.h"
9 
10 class KVUniqueNameList;
11 
20 class DMSFile_t : public KVBase {
23 
24 public:
26  {
27  fIsCont = kFALSE;
28  };
29  virtual ~DMSFile_t() {};
30 
32  {
33  return fModTime;
34  };
36  {
37  fModTime = d;
38  };
39  UInt_t GetSize() const
40  {
41  return GetNumber();
42  };
43  void SetSize(UInt_t s)
44  {
45  SetNumber(s);
46  };
47  void SetIsContainer(Bool_t yes = kTRUE)
48  {
49  fIsCont = yes;
50  };
52  {
53  return fIsCont;
54  };
55  void ls(Option_t* opt = "") const;
56 
57  ClassDef(DMSFile_t, 1) //Attributes of Data Management Service file/container
58 };
59 
60 class KVDMS : public KVBase {
64 
65 protected:
66  Bool_t buildCommand(const Char_t* scmd, const Char_t* args = "", Option_t* opts = "");
69 
70  /* take line from directory listing and extract infos on file size, modification date, etc. */
71  virtual void ExtractFileInfos(TString&, DMSFile_t*) const = 0;
72 
73 public:
74  virtual Int_t init() = 0;
75  virtual Int_t exit() = 0;
76 
77  /* produce simple listing of directory, with just the name of each file/container on a separate line */
78  virtual TString list(const Char_t* directory = "") = 0;
79 
80  /* produce full listing of directory, with for each file/container the name, size, owner, date, etc. on a separate line */
81  virtual TString longlist(const Char_t* directory = "") = 0;
82 
83  virtual Int_t cd(const Char_t* directory = "") = 0;
84  virtual Int_t chmod(const Char_t* path, UInt_t mode) = 0;
85  virtual Int_t put(const Char_t* source, const Char_t* target = ".") = 0;
86  virtual Int_t get(const Char_t* source, const Char_t* target = ".") = 0;
87  virtual TString info(const Char_t* file, Option_t* opt = "") = 0;
88  virtual Int_t forcedelete(const Char_t* path) = 0;
89  virtual Int_t mkdir(const Char_t* path, Option_t* opt = "") = 0;
90 
91  virtual Bool_t IsContainer(TString&) const;
92 
93  KVDMS(const Char_t* name = "DMS", const Char_t* title = "Data Management System");
94  virtual ~KVDMS();
95 
96  virtual KVUniqueNameList* GetFullListing(const Char_t* directory = "");
97  virtual TList* GetListing(const Char_t* directory = "");
98  virtual Bool_t DirectoryContains(const Char_t* name, const Char_t* directory = "");
99  virtual Bool_t GetPathInfo(const Char_t* path, DMSFile_t& fs);
100 
101  ClassDef(KVDMS, 1) //Interface to Data Management Service (SRB, IRODS, etc.)
102 };
103 
104 #endif
int Int_t
unsigned int UInt_t
#define d(i)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
const char Option_t
#define ClassDef(name, id)
Bool_t fIsCont
kTRUE if is container
Definition: KVDMS.h:22
Bool_t IsContainer() const
Definition: KVDMS.h:51
UInt_t GetSize() const
Definition: KVDMS.h:39
void SetModTime(KVDatime &d)
Definition: KVDMS.h:35
virtual ~DMSFile_t()
Definition: KVDMS.h:29
void SetSize(UInt_t s)
Definition: KVDMS.h:43
void ls(Option_t *opt="") const
List file/container attributes.
Definition: KVDMS.cpp:259
KVDatime fModTime
last modification
Definition: KVDMS.h:21
KVDatime GetModTime() const
Definition: KVDMS.h:31
DMSFile_t()
Definition: KVDMS.h:25
void SetIsContainer(Bool_t yes=kTRUE)
Definition: KVDMS.h:47
Base class for KaliVeda framework.
Definition: KVBase.h:142
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:216
UInt_t GetNumber() const
Definition: KVBase.h:220
Abstract base class for interfaces to Data Management Systems (SRB, IRODS, etc.)
Definition: KVDMS.h:60
virtual Int_t forcedelete(const Char_t *path)=0
virtual ~KVDMS()
Definition: KVDMS.cpp:32
virtual TString longlist(const Char_t *directory="")=0
virtual Bool_t GetPathInfo(const Char_t *path, DMSFile_t &fs)
Definition: KVDMS.cpp:166
TString fcmd
string holding full path to command line with arguments
Definition: KVDMS.h:62
virtual Int_t chmod(const Char_t *path, UInt_t mode)=0
TString fexec
string holding full path to executable
Definition: KVDMS.h:61
virtual void ExtractFileInfos(TString &, DMSFile_t *) const =0
virtual Int_t get(const Char_t *source, const Char_t *target=".")=0
virtual Int_t cd(const Char_t *directory="")=0
TString pipeCommand()
Definition: KVDMS.cpp:95
virtual Bool_t DirectoryContains(const Char_t *name, const Char_t *directory="")
Definition: KVDMS.cpp:233
TString fout
string holding results of command
Definition: KVDMS.h:63
virtual TList * GetListing(const Char_t *directory="")
Definition: KVDMS.cpp:195
virtual Int_t mkdir(const Char_t *path, Option_t *opt="")=0
Int_t execCommand()
Definition: KVDMS.cpp:79
KVDMS(const Char_t *name="DMS", const Char_t *title="Data Management System")
Default ctor with name and title.
Definition: KVDMS.cpp:22
Bool_t buildCommand(const Char_t *scmd, const Char_t *args="", Option_t *opts="")
Definition: KVDMS.cpp:48
virtual Int_t exit()=0
virtual Int_t put(const Char_t *source, const Char_t *target=".")=0
virtual Bool_t IsContainer(TString &) const
Definition: KVDMS.cpp:111
virtual TString info(const Char_t *file, Option_t *opt="")=0
virtual KVUniqueNameList * GetFullListing(const Char_t *directory="")
Definition: KVDMS.cpp:127
virtual Int_t init()=0
virtual TString list(const Char_t *directory="")=0
Extension of TDatime to handle various useful date formats.
Definition: KVDatime.h:33
Optimised list in which named objects can only be placed once.