This file is indexed.

/usr/include/root/TFileIter.h is in libroot-misc-table-dev 5.34.14-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
// @(#)root/table:$Id$
// Author: Valery Fine(fine@bnl.gov)   01/03/2001

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * Copyright (C) 2001 [BNL] Brookhaven National Laboratory.              *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TFileIter
#define ROOT_TFileIter

///////////////////////////////////////////////////////////////////////////
//                                                                       //
// Class to iterate (read / write ) the events written to /from TFile.   //
//                                                                       //
//  - set the current internal cursor directly by different means        //
//  - set the current cursor to the "next" position if available         //
//  - gain extra information of the TKey object at the current position  //
//  - read TObject object from the TFile defined by TKey at the current  //
//         position                                                      //
//                                                                       //
//  - Read "next" object from the file                                   //
//  - n-th object from the file                                          //
//  - object that is in n object on the file                             //
//  - read current object                                                //
//  - return the name of the key of the current object                   //
//  - return the current position                                        //
//  - set the current position by the absolute position number           //
//  - set the current position by relative position number               //
//  - get the number of keys in the file                                 //
//                                                                       //
// The event is supposed to assign an unique ID in form of               //
//                                                                       //
// TKey name ::= event Id ::= eventName "." run_number "." event_number  //
//                                                                       //
//                                                                       //
// and stored as the TKey name of the object written                     //
//                                                                       //
//  author Valeri Fine                                                   //
//                                                                       //
///////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TIterator
#include "TIterator.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TFile
#include "TFile.h"
#endif


class TFileIter : public TListIter {

private:

   TFileIter *fNestedIterator;   //! The inner TFidrectory interator;

   virtual TIterator &operator=(const TIterator &) { return *this; }
   virtual Bool_t operator!=(const TIterator &it) const { return TListIter::operator!=(it);}
   
protected:
   TDirectory   *fRootFile;       // TDirectory/TFile to be iterated over
   TString  fEventName;           // current key name
   UInt_t   fRunNumber;           // current "run number"
   UInt_t   fEventNumber;         // current "event number"
   Int_t    fCursorPosition;      // the position of the current key in the sorted TKey list
   Bool_t   fOwnTFile;            // Bit whether this classs creates TFile on its own to delete

   void     Initialize();
   TObject *ReadObj(const TKey *key) const;
   TKey    *NextEventKey(UInt_t eventNumber=UInt_t(-1), UInt_t runNumber=UInt_t(-1), const char *name="*");

public:

   TFileIter(const char *name, Option_t *option = "",
             const char *ftitle = "", Int_t compress = 1,
             Int_t netopt = 0);
   TFileIter(TFile *file=0);
   TFileIter(TDirectory *directory);
   TFileIter(const TFileIter &);
   virtual ~TFileIter();
// --- draft !!!     virtual Int_t Copy(TFile *destFile);
   Int_t   CurrentCursorPosition() const;
   virtual const TFile *GetTFile() const;
   virtual const TDirectory *GetTDirectory() const;
   static  TString MapName(const char *name, const char *localSystemKey = 0
                                            , const char *mountedFileSystemKey = 0);
   static  const char *GetResourceName();
   static  const char *GetDefaultMapFileName();
   static  const char *GetLocalFileNameKey();
   static  const char *GetForeignFileSystemKey();
   static  void  PurgeKeys(TList *listOfKeys);
   virtual Bool_t      IsOpen() const;
   virtual TObject    *NextEventGet(UInt_t eventNumber=UInt_t(-1), UInt_t runNumber=UInt_t(-1), const char *name="*");
   virtual Int_t       NextEventPut(TObject *obj, UInt_t eventNum, UInt_t runNumber, const char *name=0);
   void                SetCursorPosition(Int_t cursorPosition);
   void                SetCursorPosition(const char *keyNameToFind);
   Int_t               GetObjlen() const;
   virtual Int_t       TotalKeys() const;
   virtual TKey       *SkipObjects(Int_t  nSkip=1);
   virtual TObject    *GetObject() const;
   virtual Int_t       GetDepth() const;

   TKey               *GetCurrentKey() const;
   const char         *GetKeyName() const;

   TFileIter &operator=(Int_t cursorPosition);
   TFileIter &operator=(const char *keyNameToFind);
   TFileIter &operator+=(Int_t shift);
   TFileIter &operator-=(Int_t shift);
   TFileIter &operator++();
   TFileIter &operator--();

   TObject *operator*() const;
   operator const char *() const;
   operator const TFile *() const;
   operator const TDirectory *() const;
   operator int () const;
   int operator==(const char *name) const;
   int operator!=(const char *name) const;

public:  // abstract TIterator methods implementations:

   virtual TObject *Next();
   virtual TObject *Next(Int_t  nSkip);
   virtual void Reset();
   virtual void Rewind();
   TObject *operator()(Int_t  nSkip);
   TObject *operator()();

   ClassDef(TFileIter,0) // TFile class iterator
};

//__________________________________________________________________________
inline const char *TFileIter::GetResourceName()        {return "ForeignFileMap";}
//__________________________________________________________________________
inline const char *TFileIter::GetDefaultMapFileName()  {return "io.config";}
//__________________________________________________________________________
inline const char *TFileIter::GetLocalFileNameKey()    {return "LocalFileSystem";}
//__________________________________________________________________________
inline const char *TFileIter::GetForeignFileSystemKey(){return "MountedFileSystem";}

//__________________________________________________________________________
inline Int_t TFileIter::CurrentCursorPosition() const
{
   // return the current
   return fNestedIterator ? fNestedIterator->CurrentCursorPosition() : fCursorPosition;
}

//__________________________________________________________________________
inline const TFile *TFileIter::GetTFile() const { return GetTDirectory()->GetFile(); }
//__________________________________________________________________________
inline const TDirectory *TFileIter::GetTDirectory() const
{ return fNestedIterator ? fNestedIterator->GetTDirectory() : fRootFile; }

//__________________________________________________________________________
inline TObject *TFileIter::Next()
{
   // Make 1 step over the file objects and returns its pointer
   // or 0, if there is no object left in the container
   return Next(1);
}

//__________________________________________________________________________
inline void TFileIter::Rewind() 
{
   // Alias for "Reset" method
   Reset();
}
//__________________________________________________________________________
inline void  TFileIter::SetCursorPosition(Int_t cursorPosition)
{
   // Make <cursorPosition> steps (>0 - forward) over the file
   // objects to skip it
   if (fNestedIterator) 
      fNestedIterator->SetCursorPosition(cursorPosition);
   else 
      SkipObjects(cursorPosition - fCursorPosition);
}

//__________________________________________________________________________
inline TFileIter &TFileIter::operator=(const char *keyNameToFind)
{
   // Iterate unless the name of the object matches <keyNameToFind>
   SetCursorPosition(keyNameToFind); return *this;}

//__________________________________________________________________________
inline TFileIter &TFileIter::operator=(Int_t cursorPosition)
{
  // Iterate over <cursorPosition>
  SetCursorPosition(cursorPosition);
  return *this;
}
//__________________________________________________________________________
inline TFileIter::operator const TDirectory *() const
{ return GetTDirectory();  }

//__________________________________________________________________________
inline TFileIter::operator const TFile *() const
{ return GetTFile (); }
//__________________________________________________________________________
inline TFileIter &TFileIter::operator+=(Int_t shift)
{ SkipObjects(shift); return *this;}
//__________________________________________________________________________
inline TFileIter &TFileIter::operator-=(Int_t shift)
{ return operator+=(-shift);}
//__________________________________________________________________________
inline TFileIter &TFileIter::operator++()
{ SkipObjects( 1); return *this;}
//__________________________________________________________________________
inline TFileIter &TFileIter::operator--()
{ SkipObjects(-1); return *this;}
//__________________________________________________________________________
inline TObject *TFileIter::operator*() const
{ return GetObject();}
//__________________________________________________________________________
inline TFileIter::operator int () const
{ return CurrentCursorPosition(); }
//__________________________________________________________________________
inline TFileIter::operator const char *() const
{
   // return the current key name
   return GetKeyName();
}
//__________________________________________________________________________
inline int TFileIter::operator==(const char *name) const
{ return name ? !strcmp(name,GetKeyName()):0;}

//__________________________________________________________________________
inline int TFileIter::operator!=(const char *name) const
{ return !(operator==(name)); }

//__________________________________________________________________________
inline TObject *TFileIter::operator()(){ return Next(); }
//__________________________________________________________________________
inline TObject *TFileIter::operator()(Int_t  nSkip){ return Next(nSkip);}

#endif