Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:31

0001 /*************************************************************************
0002  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 #ifndef ROOT7_Browsable_RSysFile
0010 #define ROOT7_Browsable_RSysFile
0011 
0012 #include <ROOT/Browsable/RElement.hxx>
0013 #include <ROOT/Browsable/RGroup.hxx>
0014 
0015 #include "TSystem.h"
0016 #include <string>
0017 
0018 namespace ROOT {
0019 namespace Browsable {
0020 
0021 class RSysDirLevelIter;
0022 
0023 /** \class RSysFile
0024 \ingroup rbrowser
0025 */
0026 
0027 class RSysFile : public RElement {
0028 
0029    friend class RSysDirLevelIter;
0030 
0031    FileStat_t fStat;       ///<! file stat object
0032    std::string fDirName;   ///<! fully-qualified directory name
0033    std::string fFileName;  ///<! file name in current dir
0034 
0035    std::string GetFullName() const;
0036 
0037 public:
0038    RSysFile(const std::string &filename);
0039 
0040    RSysFile(const FileStat_t& stat, const std::string &dirname, const std::string &filename);
0041 
0042    virtual ~RSysFile() = default;
0043 
0044    /** Name of RElement - file name in this case */
0045    std::string GetName() const override;
0046 
0047    /** Checks if element name match to provided value */
0048    bool MatchName(const std::string &name) const override;
0049 
0050    /** Title of RElement - full file name  */
0051    std::string GetTitle() const override { return GetFullName(); }
0052 
0053    std::unique_ptr<RLevelIter> GetChildsIter() override;
0054 
0055    std::string GetContent(const std::string &kind) override;
0056 
0057    EActionKind GetDefaultAction() const override;
0058 
0059    static std::string GetFileIcon(const std::string &fname);
0060 
0061    static RElementPath_t ProvideTopEntries(std::shared_ptr<RGroup> &comp, const std::string &workdir = "");
0062 
0063    static RElementPath_t GetWorkingPath(const std::string &workdir = "");
0064 
0065 };
0066 
0067 } // namespace Browsable
0068 } // namespace ROOT
0069 
0070 
0071 #endif