<commit_before>// @(#)root/base:$Name:  $:$Id: TDirectory.h,v 1.2 2000/05/24 10:31:47 brun Exp $
// Author: <NAME>   28/11/94

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TDirectory
#define ROOT_TDirectory


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TDirectory                                                           //
//                                                                      //
// Describe directory structure in memory.                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TDatime
#include "TDatime.h"
#endif

class TBrowser;
class TKey;
class TFile;


class TDirectory : public TNamed {

protected:
   Bool_t      fModified;        //true if directory has been modified
   Bool_t      fWritable;        //true if directory is writable
   TDatime     fDatimeC;         //Date and time when directory is created
   TDatime     fDatimeM;         //Date and time of last modification
   Int_t       fNbytesKeys;      //Number of bytes for the keys
   Int_t       fNbytesName;      //Number of bytes in TNamed at creation time
   Seek_t      fSeekDir;         //Location of directory on file
   Seek_t      fSeekParent;      //Location of parent directory on file
   Seek_t      fSeekKeys;        //Location of Keys record on file
   TFile       *fFile;           //pointer to current file in memory
   TObject     *fMother;         //pointer to mother of the directory
   TList       *fList;           //Pointer to objects list in memory
   TList       *fKeys;           //Pointer to keys list in memory

          Bool_t cd1(const char *path);
   static Bool_t Cd1(const char *path);

private:
   TDirectory(const TDirectory &directory);  //Directories cannot be copied
   void operator=(const TDirectory &);

public:
   // TDirectory status bits
   enum { kCloseDirectory = BIT(7) };

   TDirectory();
   TDirectory(const char *name, const char *title, Option_t *option="");
   virtual ~TDirectory();
   virtual void        Append(TObject *obj);
           Int_t       AppendKey(TKey *key);
   virtual void        Browse(TBrowser *b);
           void        Build();
   virtual void        Clear(Option_t *option="");
   virtual void        Close(Option_t *option="");
   virtual void        Copy(TObject &) { MayNotUse("Copy(TObject &)"); }
   virtual Bool_t      cd(const char *path = 0);
   virtual void        DeleteAll(Option_t *option="");
   virtual void        Delete(const char *namecycle="");
   virtual void        Draw(Option_t *option="");
   virtual void        FillBuffer(char *&buffer);
   virtual TObject    *Get(const char *namecycle);
   virtual TFile      *GetFile() {return fFile;}
   virtual TKey       *GetKey(const char *name, const Short_t cycle=9999);
   TList              *GetList() const { return fList; }
   TList              *GetListOfKeys() const { return fKeys; }
   TObject            *GetMother() const { return fMother; }
   virtual Int_t       GetNkeys() {return fKeys->GetSize();}
   virtual Seek_t      GetSeekDir() { return fSeekDir; }
   virtual Seek_t      GetSeekParent() { return fSeekParent; }
   virtual Seek_t      GetSeekKeys() { return fSeekKeys; }
   virtual const char *GetPath() const;
   Bool_t              IsFolder() const { return kTRUE; }
   Bool_t              IsModified() { return fModified; }
   Bool_t              IsWritable() { return fWritable; }<commit_msg>made several getters constant. Also added Add() (calling Append()) to be consistent with TFolders.<commit_after>// @(#)root/base:$Name:  $:$Id: TDirectory.h,v 1.3 2000/09/05 09:21:22 brun Exp $
// Author: <NAME>   28/11/94

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TDirectory
#define ROOT_TDirectory


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TDirectory                                                           //
//                                                                      //
// Describe directory structure in memory.                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TDatime
#include "TDatime.h"
#endif

class TBrowser;
class TKey;
class TFile;


class TDirectory : public TNamed {

protected:
   Bool_t      fModified;        //true if directory has been modified
   Bool_t      fWritable;        //true if directory is writable
   TDatime     fDatimeC;         //Date and time when directory is created
   TDatime     fDatimeM;         //Date and time of last modification
   Int_t       fNbytesKeys;      //Number of bytes for the keys
   Int_t       fNbytesName;      //Number of bytes in TNamed at creation time
   Seek_t      fSeekDir;         //Location of directory on file
   Seek_t      fSeekParent;      //Location of parent directory on file
   Seek_t      fSeekKeys;        //Location of Keys record on file
   TFile       *fFile;           //pointer to current file in memory
   TObject     *fMother;         //pointer to mother of the directory
   TList       *fList;           //Pointer to objects list in memory
   TList       *fKeys;           //Pointer to keys list in memory

          Bool_t cd1(const char *path);
   static Bool_t Cd1(const char *path);

private:
   TDirectory(const TDirectory &directory);  //Directories cannot be copied
   void operator=(const TDirectory &);

public:
   // TDirectory status bits
   enum { kCloseDirectory = BIT(7) };

   TDirectory();
   TDirectory(const char *name, const char *title, Option_t *option="");
   virtual ~TDirectory();
   virtual void        Append(TObject *obj);
           void        Add(TObject *obj) { Append(obj); }
           Int_t       AppendKey(TKey *key);
   virtual void        Browse(TBrowser *b);
           void        Build();
   virtual void        Clear(Option_t *option="");
   virtual void        Close(Option_t *option="");
   virtual void        Copy(TObject &) { MayNotUse("Copy(TObject &)"); }
   virtual Bool_t      cd(const char *path = 0);
   virtual void        DeleteAll(Option_t *option="");
   virtual void        Delete(const char *namecycle="");
   virtual void        Draw(Option_t *option="");
   virtual void        FillBuffer(char *&buffer);
   virtual TObject    *Get(const char *namecycle);
   virtual TFile      *GetFile() {return fFile;}
   virtual TKey       *GetKey(const char *name, const Short_t cycle=9999);
   TList              *GetList() const { return fList; }
   TList              *GetListOfKeys() const { return fKeys; }
   TObject            *GetMother() const { return fMother; }
   virtual Int_t       GetNkeys() {return fKeys->GetSize();}
   virtual Seek_t      GetSeekDir() { return fSeekDir; }
   virtual Seek_t      GetSeekParent() { return fSeekParent; }
   virtual Seek_t      GetSeekKeys() { return fSeekKeys; }
   virtual const char *GetPath() const;
   Bool_t              IsFolder() const { return kTRUE; }
   Bool_t              IsModified() const { return fModified; }
   Bool_t              IsWritable() const { return fWritable; }
{'fraction_non_alphanumeric': 0.15360836999167757, 'fraction_numerical': 0.009035786470098681, 'mean_word_length': 1.5709046454767726, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2718647', 'n_tokens_mistral': 2201, 'n_tokens_neox': 2098, 'n_words': 675}