1 #include "KVDataRepositoryImpl.h"
65 return CopyFile(source, destination);
74 return CopyFile(source, destination);
83 std::cout <<
"Creating new repository directory: " << path << std::endl;
99 Error(
"KVDataRepository::GetDirectoryListing",
"Cannot open %s",
108 while (direntry !=
"") {
109 if (direntry ==
"." || direntry ==
"..") {
138 TSystem* KVDataRepositoryImpl::FindHelper(
const char* path,
void* dirptr)
const
145 TUrl url(path, kTRUE);
148 TIter next(&fHelpers);
149 while ((helper = (
TSystem*) next()))
150 if (HelperIsConsistentWith(helper, path, dirptr))
159 if (pname.
Index(re) != kNPOS) {
161 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path)) &&
162 h->LoadPlugin() == 0)
163 helper = (
TSystem*)
h->ExecPlugin(2, path, kFALSE);
165 #ifdef __WITHOUT_TNETSYSTEM_CTOR_BOOL_T
171 else if (!strcmp(url.GetProtocol(),
"http") &&
174 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path)) &&
175 h->LoadPlugin() == 0)
176 helper = (
TSystem*)
h->ExecPlugin(0);
181 else if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
182 if (
h->LoadPlugin() == -1)
184 helper = (
TSystem*)
h->ExecPlugin(0);
188 fHelpers.
Add(helper);
200 Bool_t KVDataRepositoryImpl::HelperIsConsistentWith(
TSystem* helper,
const TString& path,
void* dirptr)
const
209 TUrl url(path, kTRUE);
210 if (!strncmp(url.GetProtocol(), helper->
GetName(), strlen(helper->
GetName())))
219 return (checkproto || checkdir);
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
R__EXTERN TSystem * gSystem
KVBase()
Default constructor.
virtual KVUniqueNameList get_directory_listing(const TString &path) const
open directory
virtual Bool_t check_path_exists(const TString &) const
virtual int copy_file_from(const TString &source, const TString &destination) const
virtual int copy_file_to(const TString &source, const TString &destination) const
virtual Bool_t GetPathInfo(const TString &, FileStat_t &) const
virtual int Chmod(const char *file, UInt_t mode) const
virtual void make_directory(const TString &path) const
virtual int delete_file(const TString &path) const
void Add(TObject *obj) override
void SetOwner(Bool_t enable=kTRUE) override
Optimised list in which named objects can only be placed once.
void Add(TObject *obj) override
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
const char * GetName() const override
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void * GetDirPtr() const
virtual int Chmod(const char *file, UInt_t mode)
virtual void FreeDirectory(void *dirp)
virtual void * OpenDirectory(const char *name)
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
virtual int GetPathInfo(const char *path, FileStat_t &buf)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
virtual const char * GetDirEntry(void *dirp)
virtual int Unlink(const char *name)