Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TDirectoryElement Class Reference

Element representing TDirectory.

Definition at line 196 of file TDirectoryElement.cxx.

Public Types

enum  EActionKind {
  kActNone , kActBrowse , kActEdit , kActImage ,
  kActDraw6 , kActDraw7 , kActCanvas , kActTree ,
  kActGeom
}
 Possible actions on double-click. More...
enum  EContentKind {
  kNone , kText , kImage , kPng ,
  kJpeg , kJson , kFileName
}

Public Member Functions

 TDirectoryElement (const std::string &fname, TDirectory *dir=nullptr, bool isfile=false)
 ~TDirectoryElement () override=default
bool cd () override
 Select directory as active.
bool CheckValid () override
 Returns true if object is still valid.
std::unique_ptr< RItemCreateItem () const override
 Create item.
std::unique_ptr< RLevelIterGetChildsIter () override
 Provide iterator over TDirectory.
const TClassGetClass () const
 Returns class for contained object.
std::string GetContent (const std::string &kind) override
 Returns element content, depends from kind.
EActionKind GetDefaultAction () const override
 Get default action - browsing for the TFile/TDirectory.
std::string GetMTime () const override
std::string GetName () const override
 Name of TDirectoryElement.
virtual int GetNumChilds ()
 Returns number of childs By default creates iterator and iterates over all items.
std::unique_ptr< RHolderGetObject () override
 Return copy of TObject holder - if possible.
Long64_t GetSize () const override
 Size of TDirectory.
std::string GetTitle () const override
 Title of TDirectoryElement.
bool IsCapable (EActionKind) const override
 Check object capability.
virtual bool IsExpandByDefault () const
 Should item representing element be expand by default.
bool IsFolder () const override
 Check if element can have childs.
bool IsHideChilds () const
 Is flag to hide all potential object childs set.
bool IsObject (void *) override
 Returns true if holding specified object.
virtual bool MatchName (const std::string &name) const
 Checks if element name match to provided value.
void SetHideChilds (bool on)
 Set flag to hide all potential object childs.
void SetName (const std::string &name)

Static Public Member Functions

static int ComparePaths (const RElementPath_t &path1, const RElementPath_t &path2)
 Compare two paths, Returns number of elements matches in both paths.
static int ExtractItemIndex (std::string &name)
 Extract index from name Index coded by client with ###<indx>$$$ suffix Such coding used by browser to identify element by index.
static std::unique_ptr< RLevelIterGetCollectionIter (const TCollection *)
 Creates iterator for TCollection object.
static EContentKind GetContentKind (const std::string &kind)
 Find item with specified name Default implementation, should work for all.
static std::string GetPathAsString (const RElementPath_t &path)
 Converts element path back to string.
static std::shared_ptr< RElementGetSubElement (std::shared_ptr< RElement > &elem, const RElementPath_t &path)
 Returns sub element.
static bool IsLastKeyCycle ()
 Is only last cycle from the list of keys is shown.
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.
static void SetLastKeyCycle (bool on=true)
 Set flag to show only last cycle from the list of keys.

Protected Member Functions

const TObjectCheckObject () const override
 Check if object still exists.
void ForgetObject () const
 Forget object, use when it was deleted behind the scene.
TDirectoryGetDir () const
TFileGetFile () const
bool IsSame (TObject *obj) const
void SetObject (TObject *obj)
 Constructor with std::unique_ptr<RHolder> as argument.

Protected Attributes

bool fHideChilds {false}
std::string fName
TObjectfObj {nullptr}
std::unique_ptr< RHolderfObject

Private Attributes

std::string fFileName
 ! file name
bool fIsFile {false}
 ! is TFile instance registered in global list of files
Inheritance diagram for TDirectoryElement:
ROOT::Browsable::TObjectElement ROOT::Browsable::RElement TKeyElement

Member Enumeration Documentation

◆ EActionKind

Possible actions on double-click.

Enumerator
kActNone 

do nothing

kActBrowse 

just browse (expand) item

kActEdit 

can provide data for text editor

kActImage 

can be shown in image viewer, can provide image

kActDraw6 

can be drawn inside ROOT6 canvas

kActDraw7 

can be drawn inside ROOT7 canvas

kActCanvas 

indicate that it is canvas and should be drawn directly

kActTree 

can be shown in tree viewer

kActGeom 

can be shown in geometry viewer

Definition at line 50 of file RElement.hxx.

◆ EContentKind

Enumerator
kNone 

not recognized

kText 

"text" - plain text for code editor

kImage 

"image64" - base64 for supported image formats (png/gif/gpeg)

kPng 

"png" - plain png binary code, returned inside std::string

kJpeg 

"jpg" or "jpeg" - plain jpg binary code, returned inside std::string

kJson 

"json" representation of object, can be used in code editor

kFileName 

"filename" - file name if applicable

Definition at line 37 of file RElement.hxx.

Constructor & Destructor Documentation

◆ TDirectoryElement()

TDirectoryElement::TDirectoryElement ( const std::string & fname,
TDirectory * dir = nullptr,
bool isfile = false )
inline

Definition at line 241 of file TDirectoryElement.cxx.

◆ ~TDirectoryElement()

TDirectoryElement::~TDirectoryElement ( )
overridedefault

Member Function Documentation

◆ cd()

bool TDirectoryElement::cd ( )
inlineoverridevirtual

Select directory as active.

Reimplemented from ROOT::Browsable::RElement.

Definition at line 290 of file TDirectoryElement.cxx.

◆ CheckObject()

const TObject * TDirectoryElement::CheckObject ( ) const
inlineoverrideprotectedvirtual

Check if object still exists.

Reimplemented from ROOT::Browsable::TObjectElement.

Definition at line 202 of file TDirectoryElement.cxx.

◆ CheckValid()

bool TObjectElement::CheckValid ( )
overridevirtualinherited

Returns true if object is still valid.

Reimplemented from ROOT::Browsable::RElement.

Definition at line 424 of file TObjectElement.cxx.

◆ ComparePaths()

int RElement::ComparePaths ( const RElementPath_t & path1,
const RElementPath_t & path2 )
staticinherited

Compare two paths, Returns number of elements matches in both paths.

Definition at line 147 of file RElement.cxx.

◆ CreateItem()

std::unique_ptr< RItem > TObjectElement::CreateItem ( ) const
overridevirtualinherited

Create item.

Reimplemented from ROOT::Browsable::RElement.

Definition at line 457 of file TObjectElement.cxx.

◆ ExtractItemIndex()

int RElement::ExtractItemIndex ( std::string & name)
staticinherited

Extract index from name Index coded by client with ###<indx>$$$ suffix Such coding used by browser to identify element by index.

Definition at line 180 of file RElement.cxx.

◆ ForgetObject()

void TObjectElement::ForgetObject ( ) const
protectedinherited

Forget object, use when it was deleted behind the scene.

Definition at line 315 of file TObjectElement.cxx.

◆ GetChildsIter()

std::unique_ptr< RLevelIter > TDirectoryElement::GetChildsIter ( )
inlineoverridevirtual

Provide iterator over TDirectory.

Reimplemented from ROOT::Browsable::RElement.

Reimplemented in TKeyElement.

Definition at line 279 of file TDirectoryElement.cxx.

◆ GetClass()

const TClass * TObjectElement::GetClass ( ) const
inherited

Returns class for contained object.

Definition at line 432 of file TObjectElement.cxx.

◆ GetCollectionIter()

std::unique_ptr< RLevelIter > TObjectElement::GetCollectionIter ( const TCollection * coll)
staticinherited

Creates iterator for TCollection object.

Definition at line 517 of file TObjectElement.cxx.

◆ GetContent()

std::string TDirectoryElement::GetContent ( const std::string & kind)
inlineoverridevirtual

Returns element content, depends from kind.

Returns string content like text file content or json representation.

Can be "text" or "image64" or "json"

Reimplemented from ROOT::Browsable::RElement.

Definition at line 315 of file TDirectoryElement.cxx.

◆ GetContentKind()

RElement::EContentKind RElement::GetContentKind ( const std::string & kind)
staticinherited

Find item with specified name Default implementation, should work for all.

Definition at line 54 of file RElement.cxx.

◆ GetDefaultAction()

EActionKind TDirectoryElement::GetDefaultAction ( ) const
inlineoverridevirtual

Get default action - browsing for the TFile/TDirectory.

Reimplemented from ROOT::Browsable::RElement.

Reimplemented in TKeyElement.

Definition at line 287 of file TDirectoryElement.cxx.

◆ GetDir()

TDirectory * TDirectoryElement::GetDir ( ) const
inlineprotected

Definition at line 222 of file TDirectoryElement.cxx.

◆ GetFile()

TFile * TDirectoryElement::GetFile ( ) const
inlineprotected

Definition at line 230 of file TDirectoryElement.cxx.

◆ GetMTime()

std::string TDirectoryElement::GetMTime ( ) const
inlineoverridevirtual

Reimplemented from ROOT::Browsable::TObjectElement.

Reimplemented in TKeyElement.

Definition at line 308 of file TDirectoryElement.cxx.

◆ GetName()

std::string TDirectoryElement::GetName ( ) const
inlineoverridevirtual

Name of TDirectoryElement.

Implements ROOT::Browsable::RElement.

Reimplemented in TKeyElement.

Definition at line 254 of file TDirectoryElement.cxx.

◆ GetNumChilds()

int RElement::GetNumChilds ( )
virtualinherited

Returns number of childs By default creates iterator and iterates over all items.

Reimplemented in TBrBrowsableElement, TCollectionElement, and TFolderElement.

Definition at line 41 of file RElement.cxx.

◆ GetObject()

std::unique_ptr< RHolder > TObjectElement::GetObject ( )
overridevirtualinherited

Return copy of TObject holder - if possible.

Returns copy of TObject holder - if possible.

Reimplemented from ROOT::Browsable::RElement.

Definition at line 403 of file TObjectElement.cxx.

◆ GetPathAsString()

std::string RElement::GetPathAsString ( const RElementPath_t & path)
staticinherited

Converts element path back to string.

Definition at line 162 of file RElement.cxx.

◆ GetSize()

Long64_t TDirectoryElement::GetSize ( ) const
inlineoverridevirtual

Size of TDirectory.

Reimplemented from ROOT::Browsable::TObjectElement.

Reimplemented in TKeyElement.

Definition at line 301 of file TDirectoryElement.cxx.

◆ GetSubElement()

std::shared_ptr< RElement > RElement::GetSubElement ( std::shared_ptr< RElement > & elem,
const RElementPath_t & path )
staticinherited

Returns sub element.

Definition at line 71 of file RElement.cxx.

◆ GetTitle()

std::string TDirectoryElement::GetTitle ( ) const
inlineoverridevirtual

Title of TDirectoryElement.

Reimplemented from ROOT::Browsable::RElement.

Reimplemented in TKeyElement.

Definition at line 268 of file TDirectoryElement.cxx.

◆ IsCapable()

bool TObjectElement::IsCapable ( RElement::EActionKind action) const
overridevirtualinherited

Check object capability.

Reimplemented from ROOT::Browsable::RElement.

Reimplemented in TTreeBrowsingElement, and TTreeElement.

Definition at line 491 of file TObjectElement.cxx.

◆ IsExpandByDefault()

virtual bool ROOT::Browsable::RElement::IsExpandByDefault ( ) const
inlinevirtualinherited

Should item representing element be expand by default.

Reimplemented in ROOT::Browsable::RWrapper.

Definition at line 100 of file RElement.hxx.

◆ IsFolder()

bool TDirectoryElement::IsFolder ( ) const
inlineoverridevirtual

Check if element can have childs.

Reimplemented from ROOT::Browsable::RElement.

Reimplemented in TKeyElement.

Definition at line 276 of file TDirectoryElement.cxx.

◆ IsHideChilds()

bool ROOT::Browsable::TObjectElement::IsHideChilds ( ) const
inlineinherited

Is flag to hide all potential object childs set.

Definition at line 62 of file TObjectElement.hxx.

◆ IsLastKeyCycle()

bool RElement::IsLastKeyCycle ( )
staticinherited

Is only last cycle from the list of keys is shown.

Definition at line 195 of file RElement.cxx.

◆ IsObject()

bool TObjectElement::IsObject ( void * obj)
overridevirtualinherited

Returns true if holding specified object.

Reimplemented from ROOT::Browsable::RElement.

Definition at line 414 of file TObjectElement.cxx.

◆ IsSame()

bool ROOT::Browsable::TObjectElement::IsSame ( TObject * obj) const
inlineprotectedinherited

Definition at line 37 of file TObjectElement.hxx.

◆ MatchName()

virtual bool ROOT::Browsable::RElement::MatchName ( const std::string & name) const
inlinevirtualinherited

Checks if element name match to provided value.

Reimplemented in ROOT::Browsable::RSysFile.

Definition at line 68 of file RElement.hxx.

◆ ParsePath()

RElementPath_t RElement::ParsePath ( const std::string & str)
staticinherited

Parse string path to produce RElementPath_t One should avoid to use string pathes as much as possible.

Definition at line 118 of file RElement.cxx.

◆ SetHideChilds()

void ROOT::Browsable::TObjectElement::SetHideChilds ( bool on)
inlineinherited

Set flag to hide all potential object childs.

Definition at line 65 of file TObjectElement.hxx.

◆ SetLastKeyCycle()

void RElement::SetLastKeyCycle ( bool on = true)
staticinherited

Set flag to show only last cycle from the list of keys.

Definition at line 203 of file RElement.cxx.

◆ SetName()

void ROOT::Browsable::TObjectElement::SetName ( const std::string & name)
inlineinherited

Definition at line 59 of file TObjectElement.hxx.

◆ SetObject()

void TObjectElement::SetObject ( TObject * obj)
protectedinherited

Constructor with std::unique_ptr<RHolder> as argument.

Definition at line 306 of file TObjectElement.cxx.

Member Data Documentation

◆ fFileName

std::string TDirectoryElement::fFileName
private

! file name

Definition at line 197 of file TDirectoryElement.cxx.

◆ fHideChilds

bool ROOT::Browsable::TObjectElement::fHideChilds {false}
protectedinherited

Definition at line 35 of file TObjectElement.hxx.

◆ fIsFile

bool TDirectoryElement::fIsFile {false}
private

! is TFile instance registered in global list of files

Definition at line 198 of file TDirectoryElement.cxx.

◆ fName

std::string ROOT::Browsable::TObjectElement::fName
protectedinherited

Definition at line 34 of file TObjectElement.hxx.

◆ fObj

TObject* ROOT::Browsable::TObjectElement::fObj {nullptr}
protectedinherited

Definition at line 33 of file TObjectElement.hxx.

◆ fObject

std::unique_ptr<RHolder> ROOT::Browsable::TObjectElement::fObject
protectedinherited

Definition at line 32 of file TObjectElement.hxx.


The documentation for this class was generated from the following file: