Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RSysFile.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9/// \file
10/// \ingroup rbrowser
11/// \author Sergey Linev <S.Linev@gsi.de>
12/// \date 2019-10-15
13/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
14/// is welcome!
15
16
18
23
24#include "ROOT/RLogger.hxx"
25
26#include "TROOT.h"
27#include "TList.h"
28#include "TBase64.h"
29#include "snprintf.h"
30
31#include <sstream>
32#include <fstream>
33#include <algorithm>
34
35#ifdef _MSC_VER
36#include <windows.h>
37#include <tchar.h>
38#endif
39
40using namespace std::string_literals;
41
42using namespace ROOT::Browsable;
43
44namespace ROOT {
45namespace Browsable {
46
47
48#ifdef _MSC_VER
49bool IsWindowsLink(const std::string &path)
50{
51 return (path.length() > 4) && (path.rfind(".lnk") == path.length() - 4);
52}
53#endif
54
55
56/** \class RSysDirLevelIter
57\ingroup rbrowser
58
59Iterator over files in in sub-directory
60*/
61
62
64 std::string fPath; ///<! fully qualified path without final slash
65 void *fDir{nullptr}; ///<! current directory handle
66 std::string fCurrentName; ///<! current file name
67 std::string fItemName; ///<! current item name
68 FileStat_t fCurrentStat; ///<! stat for current file name
69
70 /** Open directory for listing */
71 bool OpenDir()
72 {
73 if (fDir)
74 CloseDir();
75
76#ifdef _MSC_VER
77 // on Windows path can be redirected via .lnk therefore get real path name before OpenDirectory,
78 // otherwise such realname will not be known for us
79 if (IsWindowsLink(fPath)) {
80 char *realWinPath = gSystem->ExpandPathName(fPath.c_str());
81 if (realWinPath) fPath = realWinPath;
82 delete [] realWinPath;
83 }
84#endif
85
86 fDir = gSystem->OpenDirectory(fPath.c_str());
87
88#ifdef _MSC_VER
89 // Directory can be an soft link (not as .lnk) and should be tried as well
90 if (!fDir) {
91
92 auto hFile = CreateFile(fPath.c_str(), // file to open
93 0, // open for reading
94 0, // share for reading
95 0, // default security
96 OPEN_EXISTING, // existing file only
97 FILE_FLAG_BACKUP_SEMANTICS, // flag to work with dirs
98 NULL); // no attr. template
99
100 if( hFile != INVALID_HANDLE_VALUE) {
101 const int BUFSIZE = 2048;
102 TCHAR path[BUFSIZE];
103 auto dwRet = GetFinalPathNameByHandle( hFile, path, BUFSIZE, VOLUME_NAME_DOS );
104 // produced file name may include \\? symbols, which are indicating long file name
105 if ((dwRet > 0) && (dwRet < BUFSIZE))
106 if ((path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && (path[3] == '\\')) {
107 R__LOG_DEBUG(0, BrowsableLog()) << "Try to open directory " << (path+4) << " instead of " << fPath;
108 fDir = gSystem->OpenDirectory(path + 4);
109 if (fDir) fPath = path + 4;
110 }
111 }
112
113 CloseHandle(hFile);
114 }
115
116#endif
117
118 if (!fDir) {
119 R__LOG_ERROR(BrowsableLog()) << "Fail to open directory " << fPath;
120 return false;
121 }
122
123 return true;
124 }
125
126 /** Close directory for listing */
127 void CloseDir()
128 {
129 if (fDir)
131 fDir = nullptr;
132 fCurrentName.clear();
133 fItemName.clear();
134 }
135
136 /** Return full dir name with appropriate slash at the end */
137 std::string FullDirName() const
138 {
139 std::string path = fPath;
140#ifdef _MSC_VER
141 const char *slash = "\\";
142#else
143 const char *slash = "/";
144#endif
145 if (path.rfind(slash) != path.length() - 1)
146 path.append(slash);
147 return path;
148 }
149
150 /** Check if entry of that name exists */
151 bool TestDirEntry(const std::string &name)
152 {
153 auto testname = name;
154
155 auto path = FullDirName() + testname;
156
157 auto pathinfores = gSystem->GetPathInfo(path.c_str(), fCurrentStat);
158
159#ifdef _MSC_VER
160 if (pathinfores && !IsWindowsLink(path)) {
161 std::string lpath = path + ".lnk";
162 pathinfores = gSystem->GetPathInfo(lpath.c_str(), fCurrentStat);
163 if (!pathinfores) testname.append(".lnk");
164 }
165#endif
166
167 if (pathinfores) {
168
169 if (fCurrentStat.fIsLink) {
170 R__LOG_DEBUG(0, BrowsableLog()) << "Broken symlink of " << path;
171 } else {
172 R__LOG_DEBUG(0, BrowsableLog()) << "Can't read file attributes of \"" << path << "\" err:" << gSystem->GetError();
173 }
174 return false;
175 }
176
177 fItemName = fCurrentName = testname;
178#ifdef _MSC_VER
179 if (IsWindowsLink(fItemName))
180 fItemName.resize(fItemName.length() - 4);
181#endif
182 return true;
183 }
184
185 /** Trying to produce next entry */
187 {
188 fCurrentName.clear();
189 fItemName.clear();
190
191 if (!fDir)
192 return false;
193
194 while (fCurrentName.empty()) {
195
196 // one have to use const char* to correctly check for nullptr
197 const char *name = gSystem->GetDirEntry(fDir);
198
199 if (!name) {
200 CloseDir();
201 return false;
202 }
203
204 std::string sname = name;
205
206 if ((sname == ".") || (sname == ".."))
207 continue;
208
209 TestDirEntry(sname);
210 }
211
212
213 return true;
214 }
215
216 std::string GetFileExtension(const std::string &fname) const
217 {
218 auto pos = fname.rfind(".");
219 if ((pos != std::string::npos) && (pos < fname.length() - 1) && (pos > 0))
220 return fname.substr(pos+1);
221
222 return ""s;
223 }
224
225public:
226 explicit RSysDirLevelIter(const std::string &path = "") : fPath(path) { OpenDir(); }
227
229
230 bool Next() override { return NextDirEntry(); }
231
232 bool Find(const std::string &name, int = -1) override
233 {
234 // ignore index, it is not possible to have duplicated file names
235
236 if (!fDir && !OpenDir())
237 return false;
238
239 return TestDirEntry(name);
240 }
241
242 std::string GetItemName() const override { return fItemName; }
243
244 /** Returns true if directory or is file format supported */
245 bool CanItemHaveChilds() const override
246 {
248 return true;
249
251 return true;
252
253 return false;
254 }
255
256 std::unique_ptr<RItem> CreateItem() override
257 {
258 auto item = std::make_unique<RSysFileItem>(GetItemName(), CanItemHaveChilds() ? -1 : 0);
259
260 // this is construction of current item
261 char tmp[256];
262
263 item->type = fCurrentStat.fMode;
264 item->size = fCurrentStat.fSize;
265 item->uid = fCurrentStat.fUid;
266 item->gid = fCurrentStat.fGid;
267 item->modtime = fCurrentStat.fMtime;
268 item->islink = fCurrentStat.fIsLink;
269 item->isdir = R_ISDIR(fCurrentStat.fMode);
270
271 if (item->isdir)
272 item->SetIcon("sap-icon://folder-blank"s);
273 else
274 item->SetIcon(RSysFile::GetFileIcon(GetItemName()));
275
276 // set file size as string
277 item->SetSize(item->size);
278
279 // modification time
280 time_t loctime = (time_t) item->modtime;
281 struct tm *newtime = localtime(&loctime);
282 if (newtime) {
283 snprintf(tmp, sizeof(tmp), "%d-%02d-%02d %02d:%02d", newtime->tm_year + 1900,
284 newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour,
285 newtime->tm_min);
286 item->SetMTime(tmp);
287 } else {
288 item->SetMTime("1901-01-01 00:00");
289 }
290
291 // file type
292 snprintf(tmp, sizeof(tmp), "%c%c%c%c%c%c%c%c%c%c",
293 (item->islink ?
294 'l' :
295 R_ISREG(item->type) ?
296 '-' :
297 (R_ISDIR(item->type) ?
298 'd' :
299 (R_ISCHR(item->type) ?
300 'c' :
301 (R_ISBLK(item->type) ?
302 'b' :
303 (R_ISFIFO(item->type) ?
304 'p' :
305 (R_ISSOCK(item->type) ?
306 's' : '?' )))))),
307 ((item->type & kS_IRUSR) ? 'r' : '-'),
308 ((item->type & kS_IWUSR) ? 'w' : '-'),
309 ((item->type & kS_ISUID) ? 's' : ((item->type & kS_IXUSR) ? 'x' : '-')),
310 ((item->type & kS_IRGRP) ? 'r' : '-'),
311 ((item->type & kS_IWGRP) ? 'w' : '-'),
312 ((item->type & kS_ISGID) ? 's' : ((item->type & kS_IXGRP) ? 'x' : '-')),
313 ((item->type & kS_IROTH) ? 'r' : '-'),
314 ((item->type & kS_IWOTH) ? 'w' : '-'),
315 ((item->type & kS_ISVTX) ? 't' : ((item->type & kS_IXOTH) ? 'x' : '-')));
316 item->SetType(tmp);
317
318 struct UserGroup_t *user_group = gSystem->GetUserInfo(item->uid);
319 if (user_group) {
320 item->SetUid(user_group->fUser.Data());
321 item->SetGid(user_group->fGroup.Data());
322 delete user_group;
323 } else {
324 item->SetUid(std::to_string(item->uid));
325 item->SetGid(std::to_string(item->gid));
326 }
327
328 return item;
329 }
330
331 /** Returns full information for current element */
332 std::shared_ptr<RElement> GetElement() override
333 {
334 if (!R_ISDIR(fCurrentStat.fMode)) {
336
339 if (elem) return elem;
340 }
341 }
342
343 return std::make_shared<RSysFile>(fCurrentStat, FullDirName(), fCurrentName);
344 }
345
346};
347
348
349} // namespace Browsable
350} // namespace ROOT
351
352
353/////////////////////////////////////////////////////////////////////////////////
354/// Get icon for the type of given file name
355
356std::string RSysFile::GetFileIcon(const std::string &fname)
357{
358 std::string name = fname;
359 std::transform(name.begin(), name.end(), name.begin(), ::tolower);
360
361 auto EndsWith = [name](const std::string &suffix) {
362 return (name.length() > suffix.length()) ? (0 == name.compare (name.length() - suffix.length(), suffix.length(), suffix)) : false;
363 };
364
365 if ((EndsWith(".c")) ||
366 (EndsWith(".cpp")) ||
367 (EndsWith(".cxx")) ||
368 (EndsWith(".c++")) ||
369 (EndsWith(".cxx")) ||
370 (EndsWith(".cc")) ||
371 (EndsWith(".h")) ||
372 (EndsWith(".hh")) ||
373 (EndsWith(".hpp")) ||
374 (EndsWith(".hxx")) ||
375 (EndsWith(".h++")) ||
376 (EndsWith(".py")) ||
377 (EndsWith(".txt")) ||
378 (EndsWith(".cmake")) ||
379 (EndsWith(".dat")) ||
380 (EndsWith(".log")) ||
381 (EndsWith(".xml")) ||
382 (EndsWith(".htm")) ||
383 (EndsWith(".html")) ||
384 (EndsWith(".json")) ||
385 (EndsWith(".sh")) ||
386 (EndsWith(".md")) ||
387 (EndsWith(".css")) ||
388 (EndsWith(".js")))
389 return "sap-icon://document-text"s;
390 if ((EndsWith(".bmp")) ||
391 (EndsWith(".gif")) ||
392 (EndsWith(".jpeg")) ||
393 (EndsWith(".jpg")) ||
394 (EndsWith(".png")) ||
395 (EndsWith(".svg")))
396 return "sap-icon://picture"s;
397 if (EndsWith(".root"))
398 return "sap-icon://org-chart"s;
399
400 return "sap-icon://document"s;
401}
402
403
404/////////////////////////////////////////////////////////////////////////////////
405/// Create file element
406
407RSysFile::RSysFile(const std::string &filename) : fFileName(filename)
408{
409 if (gSystem->GetPathInfo(fFileName.c_str(), fStat)) {
410 if (fStat.fIsLink) {
411 R__LOG_DEBUG(0, BrowsableLog()) << "Broken symlink of " << fFileName;
412 } else {
413 R__LOG_DEBUG(0, BrowsableLog()) << "Can't read file attributes of \"" << fFileName
414 << "\" err:" << gSystem->GetError();
415 }
416 }
417
418 auto pos = fFileName.find_last_of("\\/");
419 if ((pos != std::string::npos) && (pos < fFileName.length() - 1)) {
420 fDirName = fFileName.substr(0, pos+1);
421 fFileName.erase(0, pos+1);
422 }
423}
424
425/////////////////////////////////////////////////////////////////////////////////
426/// Create file element with already provided stats information
427
428RSysFile::RSysFile(const FileStat_t &stat, const std::string &dirname, const std::string &filename)
429 : fStat(stat), fDirName(dirname), fFileName(filename)
430{
431}
432
433/////////////////////////////////////////////////////////////////////////////////
434/// return file name
435
436std::string RSysFile::GetName() const
437{
438 return fFileName;
439}
440
441/////////////////////////////////////////////////////////////////////////////////
442/// Check if file name the same, ignore case on Windows
443
444bool RSysFile::MatchName(const std::string &name) const
445{
446 auto ownname = GetName();
447
448#ifdef _MSC_VER
449
450 return std::equal(name.begin(), name.end(),
451 ownname.begin(), ownname.end(),
452 [](char a, char b) {
453 return tolower(a) == tolower(b);
454 });
455#else
456
457 return ownname == name;
458
459#endif
460}
461
462/////////////////////////////////////////////////////////////////////////////////
463/// Get default action for the file
464/// Either start text editor or image viewer or just do file browsing
465
467{
468 if (R_ISDIR(fStat.fMode)) return kActBrowse;
469
470 auto icon = GetFileIcon(GetName());
471 if (icon == "sap-icon://document-text"s) return kActEdit;
472 if (icon == "sap-icon://picture"s) return kActImage;
473 if (icon == "sap-icon://org-chart"s) return kActBrowse;
474 return kActNone;
475}
476
477/////////////////////////////////////////////////////////////////////////////////
478/// Returns full file name - including fully qualified path
479
480std::string RSysFile::GetFullName() const
481{
482 return fDirName + fFileName;
483}
484
485/////////////////////////////////////////////////////////////////////////////////
486/// Returns iterator for files in directory
487
488std::unique_ptr<RLevelIter> RSysFile::GetChildsIter()
489{
490 if (!R_ISDIR(fStat.fMode))
491 return nullptr;
492
493 return std::make_unique<RSysDirLevelIter>(GetFullName());
494}
495
496/////////////////////////////////////////////////////////////////////////////////
497/// Returns file content of requested kind
498
499std::string RSysFile::GetContent(const std::string &kind)
500{
501 if ((GetContentKind(kind) == kText) && (GetFileIcon(GetName()) == "sap-icon://document-text"s)) {
502 std::ifstream t(GetFullName());
503 return std::string(std::istreambuf_iterator<char>(t), std::istreambuf_iterator<char>());
504 }
505
506 if ((GetContentKind(kind) == kImage) && (GetFileIcon(GetName()) == "sap-icon://picture"s)) {
507 std::ifstream t(GetFullName(), std::ios::binary);
508 std::string content = std::string(std::istreambuf_iterator<char>(t), std::istreambuf_iterator<char>());
509
510 auto encode = TBase64::Encode(content.data(), content.length());
511
512 auto pos = GetName().rfind(".");
513
514 std::string image_kind = GetName().substr(pos+1);
515 std::transform(image_kind.begin(), image_kind.end(), image_kind.begin(), ::tolower);
516 if (image_kind == "svg") image_kind = "svg+xml";
517
518 return "data:image/"s + image_kind + ";base64,"s + encode.Data();
519 }
520
521 if (GetContentKind(kind) == kFileName) {
522 return GetFullName();
523 }
524
525 return ""s;
526}
527
528
529/////////////////////////////////////////////////////////////////////////////////
530/// Provide top entries for file system
531/// On windows it is list of existing drivers, on Linux it is "File system" and "Home"
532
533RElementPath_t RSysFile::ProvideTopEntries(std::shared_ptr<RGroup> &comp, const std::string &workdir)
534{
535 std::string seldir = workdir;
536
537 if (seldir.empty())
538 seldir = gSystem->WorkingDirectory();
539
540 seldir = gSystem->UnixPathName(seldir.c_str());
541
542 auto volumes = gSystem->GetVolumes("all");
543 if (volumes) {
544 // this is Windows
545 TIter iter(volumes);
546 TObject *obj;
547 while ((obj = iter()) != nullptr) {
548 std::string name = obj->GetName();
549 std::string dir = name + "\\"s;
550 comp->Add(std::make_shared<Browsable::RWrapper>(name, std::make_unique<RSysFile>(dir)));
551 }
552 delete volumes;
553
554 } else {
555 comp->Add(std::make_shared<Browsable::RWrapper>("File system", std::make_unique<RSysFile>("/")));
556
557 seldir = "/File system"s + seldir;
558
559 std::string homedir = gSystem->UnixPathName(gSystem->HomeDirectory());
560
561 if (!homedir.empty())
562 comp->Add(std::make_shared<Browsable::RWrapper>("Home", std::make_unique<RSysFile>(homedir)));
563 }
564
565 return RElement::ParsePath(seldir);
566}
567
568/////////////////////////////////////////////////////////////////////////////////
569/// Return working path in browser hierarchy
570
571RElementPath_t RSysFile::GetWorkingPath(const std::string &workdir)
572{
573 std::string seldir = workdir;
574
575 if (seldir.empty())
576 seldir = gSystem->WorkingDirectory();
577
578 seldir = gSystem->UnixPathName(seldir.c_str());
579
580 auto volumes = gSystem->GetVolumes("all");
581 if (volumes) {
582 delete volumes;
583 } else {
584 seldir = "/File system"s + seldir;
585 }
586
587 return RElement::ParsePath(seldir);
588}
589
#define R__LOG_ERROR(...)
Definition RLogger.hxx:362
#define R__LOG_DEBUG(DEBUGLEVEL,...)
Definition RLogger.hxx:365
#define b(i)
Definition RSha256.hxx:100
#define a(i)
Definition RSha256.hxx:99
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
char name[80]
Definition TGX11.cxx:110
#define INVALID_HANDLE_VALUE
Definition TMapFile.cxx:84
Bool_t R_ISFIFO(Int_t mode)
Definition TSystem.h:118
Bool_t R_ISSOCK(Int_t mode)
Definition TSystem.h:119
Bool_t R_ISBLK(Int_t mode)
Definition TSystem.h:115
Bool_t R_ISREG(Int_t mode)
Definition TSystem.h:116
Bool_t R_ISDIR(Int_t mode)
Definition TSystem.h:113
R__EXTERN TSystem * gSystem
Definition TSystem.h:561
Bool_t R_ISCHR(Int_t mode)
Definition TSystem.h:114
@ kS_IRGRP
Definition TSystem.h:104
@ kS_IWUSR
Definition TSystem.h:101
@ kS_ISUID
Definition TSystem.h:96
@ kS_IRUSR
Definition TSystem.h:100
@ kS_IXOTH
Definition TSystem.h:110
@ kS_ISGID
Definition TSystem.h:97
@ kS_IROTH
Definition TSystem.h:108
@ kS_IWGRP
Definition TSystem.h:105
@ kS_IXUSR
Definition TSystem.h:102
@ kS_ISVTX
Definition TSystem.h:98
@ kS_IWOTH
Definition TSystem.h:109
@ kS_IXGRP
Definition TSystem.h:106
#define BUFSIZE
const char * extension
Definition civetweb.c:8026
#define snprintf
Definition civetweb.c:1540
static EContentKind GetContentKind(const std::string &kind)
Find item with specified name Default implementation, should work for all.
Definition RElement.cxx:52
@ kFileName
"filename" - file name if applicable
Definition RElement.hxx:44
@ kText
"text" - plain text for code editor
Definition RElement.hxx:39
@ kImage
"image64" - base64 for supported image formats (png/gif/gpeg)
Definition RElement.hxx:40
EActionKind
Possible actions on double-click.
Definition RElement.hxx:50
@ kActImage
can be shown in image viewer, can provide image
Definition RElement.hxx:54
@ kActBrowse
just browse (expand) item
Definition RElement.hxx:52
@ kActEdit
can provide data for text editor
Definition RElement.hxx:53
static RElementPath_t ParsePath(const std::string &str)
Parse string path to produce RElementPath_t One should avoid to use string pathes as much as possible...
Definition RElement.cxx:116
Iterator over single level hierarchy like any array, keys list, ...
static bool IsFileFormatSupported(const std::string &extension)
static std::shared_ptr< RElement > OpenFile(const std::string &extension, const std::string &fullname)
Iterator over files in in sub-directory.
Definition RSysFile.cxx:63
void * fDir
! current directory handle
Definition RSysFile.cxx:65
FileStat_t fCurrentStat
! stat for current file name
Definition RSysFile.cxx:68
bool Find(const std::string &name, int=-1) override
Find item with specified name Default implementation, should work for all If index specified,...
Definition RSysFile.cxx:232
std::string fItemName
! current item name
Definition RSysFile.cxx:67
void CloseDir()
Close directory for listing.
Definition RSysFile.cxx:127
std::string GetFileExtension(const std::string &fname) const
Definition RSysFile.cxx:216
std::string FullDirName() const
Return full dir name with appropriate slash at the end.
Definition RSysFile.cxx:137
std::shared_ptr< RElement > GetElement() override
Returns full information for current element.
Definition RSysFile.cxx:332
bool TestDirEntry(const std::string &name)
Check if entry of that name exists.
Definition RSysFile.cxx:151
std::string fCurrentName
! current file name
Definition RSysFile.cxx:66
RSysDirLevelIter(const std::string &path="")
Definition RSysFile.cxx:226
std::string fPath
! fully qualified path without final slash
Definition RSysFile.cxx:64
std::unique_ptr< RItem > CreateItem() override
Create generic description item for RBrowser.
Definition RSysFile.cxx:256
bool OpenDir()
Open directory for listing.
Definition RSysFile.cxx:71
bool NextDirEntry()
Trying to produce next entry.
Definition RSysFile.cxx:186
bool Next() override
Shift to next entry.
Definition RSysFile.cxx:230
bool CanItemHaveChilds() const override
Returns true if directory or is file format supported.
Definition RSysFile.cxx:245
std::string GetItemName() const override
Returns current entry name
Definition RSysFile.cxx:242
std::string GetFullName() const
Returns full file name - including fully qualified path.
Definition RSysFile.cxx:480
std::unique_ptr< RLevelIter > GetChildsIter() override
Returns iterator for files in directory.
Definition RSysFile.cxx:488
std::string fDirName
! fully-qualified directory name
Definition RSysFile.hxx:32
FileStat_t fStat
! file stat object
Definition RSysFile.hxx:31
RSysFile(const std::string &filename)
Create file element.
Definition RSysFile.cxx:407
std::string GetName() const override
Name of RElement - file name in this case.
Definition RSysFile.cxx:436
static std::string GetFileIcon(const std::string &fname)
Get icon for the type of given file name.
Definition RSysFile.cxx:356
EActionKind GetDefaultAction() const override
Get default action for the file Either start text editor or image viewer or just do file browsing.
Definition RSysFile.cxx:466
std::string GetContent(const std::string &kind) override
Returns file content of requested kind.
Definition RSysFile.cxx:499
static RElementPath_t ProvideTopEntries(std::shared_ptr< RGroup > &comp, const std::string &workdir="")
Provide top entries for file system On windows it is list of existing drivers, on Linux it is "File s...
Definition RSysFile.cxx:533
bool MatchName(const std::string &name) const override
Checks if element name match to provided value.
Definition RSysFile.cxx:444
std::string fFileName
! file name in current dir
Definition RSysFile.hxx:33
static RElementPath_t GetWorkingPath(const std::string &workdir="")
Return working path in browser hierarchy.
Definition RSysFile.cxx:571
static TString Encode(const char *data)
Transform data into a null terminated base64 string.
Definition TBase64.cxx:107
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:444
const char * Data() const
Definition TString.h:376
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition TSystem.cxx:1274
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition TSystem.cxx:845
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition TSystem.cxx:836
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition TSystem.cxx:1398
virtual TList * GetVolumes(Option_t *) const
Definition TSystem.h:455
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition TSystem.cxx:853
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1063
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:871
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
Definition TSystem.cxx:887
virtual const char * GetError()
Return system error string.
Definition TSystem.cxx:254
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition TSystem.cxx:1601
std::vector< std::string > RElementPath_t
Definition RElement.hxx:20
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
ROOT::Experimental::RLogChannel & BrowsableLog()
Log channel for Browsable diagnostics.
Definition RElement.cxx:20
TCanvas * slash()
Definition slash.C:1
Int_t fMode
Definition TSystem.h:125
Long64_t fSize
Definition TSystem.h:128
Int_t fGid
Definition TSystem.h:127
Long_t fMtime
Definition TSystem.h:129
Bool_t fIsLink
Definition TSystem.h:130
Int_t fUid
Definition TSystem.h:126
TString fUser
Definition TSystem.h:139
TString fGroup
Definition TSystem.h:140