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