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