Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RSysFile.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, 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#ifndef ROOT7_Browsable_RSysFile
10#define ROOT7_Browsable_RSysFile
11
14
15#include "TSystem.h"
16#include <string>
17
18namespace ROOT {
19namespace Experimental {
20namespace Browsable {
21
22class RSysDirLevelIter;
23
24/** \class RSysFile
25\ingroup rbrowser
26*/
27
28class RSysFile : public RElement {
29
30 friend class RSysDirLevelIter;
31
32 FileStat_t fStat; ///<! file stat object
33 std::string fDirName; ///<! fully-qualified directory name
34 std::string fFileName; ///<! file name in current dir
35
36 std::string GetFullName() const;
37
38public:
39 RSysFile(const std::string &filename);
40
41 RSysFile(const FileStat_t& stat, const std::string &dirname, const std::string &filename);
42
43 virtual ~RSysFile() = default;
44
45 /** Name of RElement - file name in this case */
46 std::string GetName() const override;
47
48 /** Checks if element name match to provided value */
49 bool MatchName(const std::string &name) const override;
50
51 /** Title of RElement - full file name */
52 std::string GetTitle() const override { return GetFullName(); }
53
54 std::unique_ptr<RLevelIter> GetChildsIter() override;
55
56 std::string GetContent(const std::string &kind) override;
57
58 EActionKind GetDefaultAction() const override;
59
60 static std::string GetFileIcon(const std::string &fname);
61
62 static RElementPath_t ProvideTopEntries(std::shared_ptr<RGroup> &comp, const std::string &workdir = "");
63
64 static RElementPath_t GetWorkingPath(const std::string &workdir = "");
65
66};
67
68} // namespace Browsable
69} // namespace Experimental
70} // namespace ROOT
71
72
73#endif
char name[80]
Definition TGX11.cxx:110
Basic element of browsable hierarchy.
Definition RElement.hxx:33
EActionKind
Possible actions on double-click.
Definition RElement.hxx:49
Iterator over files in in sub-directory.
Definition RSysFile.cxx:64
std::string GetTitle() const override
Title of RElement - full file name
Definition RSysFile.hxx:52
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
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
std::vector< std::string > RElementPath_t
Definition RElement.hxx:21
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...