Logo ROOT  
Reference Guide
TFileInfo.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Andreas-Joachim Peters 20/9/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TFileInfo
13 \ingroup Base
14 
15 Class describing a generic file including meta information.
16 */
17 
18 #include "TFileInfo.h"
19 #include "TRegexp.h"
20 #include "TSystem.h"
21 #include "TClass.h"
22 #include "TUrl.h"
23 #include "TUUID.h"
24 #include "TMD5.h"
25 
28 
29 ////////////////////////////////////////////////////////////////////////////////
30 /// Constructor.
31 
32 TFileInfo::TFileInfo(const char *in, Long64_t size, const char *uuid,
33  const char *md5, TObject *meta)
34  : fCurrentUrl(0), fUrlList(0), fSize(-1), fUUID(0), fMD5(0),
35  fMetaDataList(0), fIndex(-1)
36 {
37  // Get initializations form the input string: this will set at least the
38  // current URL; but it may set more: see TFileInfo::ParseInput(). Please note
39  // that MD5 sum should be provided as a string in md5ascii form.
40  ParseInput(in);
41 
42  // Now also honour the input arguments: the size
43  if (size > -1) fSize = size;
44  // The UUID
45  if (uuid) {
47  fUUID = new TUUID(uuid);
48  } else if (!fUUID) {
49  fUUID = new TUUID;
50  }
51  // The MD5
52  if (md5) {
54  fMD5 = new TMD5();
55  fMD5->SetDigest(md5); // sets digest from md5ascii representation
56  }
57  // The meta information
58  if (meta) {
59  RemoveMetaData(meta->GetName());
60  AddMetaData(meta);
61  }
62 
63  // Now set the name from the UUID
65  SetTitle("TFileInfo");
66 
67  // By default we ignore the index
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Copy constructor.
73 
74 TFileInfo::TFileInfo(const TFileInfo &fi) : TNamed(fi.GetName(), fi.GetTitle()),
75  fCurrentUrl(0), fUrlList(0),
76  fSize(fi.fSize), fUUID(0), fMD5(0),
77  fMetaDataList(0), fIndex(fi.fIndex)
78 {
79  if (fi.fUrlList) {
80  fUrlList = new TList;
81  fUrlList->SetOwner();
82  TIter nxu(fi.fUrlList);
83  TUrl *u = 0;
84  while ((u = (TUrl *)nxu())) {
85  fUrlList->Add(new TUrl(u->GetUrl(), kTRUE));
86  }
87  ResetUrl();
88  }
89  fSize = fi.fSize;
90 
91  if (fi.fUUID)
92  fUUID = new TUUID(fi.fUUID->AsString());
93 
94  if (fi.fMD5)
95  fMD5 = new TMD5(*(fi.fMD5));
96 
97  // Staged and corrupted bits
102 
103  if (fi.fMetaDataList) {
104  fMetaDataList = new TList;
106  TIter nxm(fi.fMetaDataList);
107  TFileInfoMeta *fim = 0;
108  while ((fim = (TFileInfoMeta *)nxm())) {
109  fMetaDataList->Add(new TFileInfoMeta(*fim));
110  }
111  }
112 
113  // By default we ignore the index
115 }
116 
117 ////////////////////////////////////////////////////////////////////////////////
118 /// Destructor.
119 
121 {
123  SafeDelete(fUUID);
124  SafeDelete(fMD5);
126 }
127 
128 ////////////////////////////////////////////////////////////////////////////////
129 /// Parse the input line to extract init information from 'in'; the input
130 /// string is tokenized on ' '; the tokens can be prefixed by the following
131 /// keys:
132 ///
133 /// - `url:<url1>,<url2>,...` URLs for the file; stored in the order given
134 /// - `sz:<size>` size of the file in bytes
135 /// - `md5:<md5_ascii>` MD5 sum of the file in ASCII form
136 /// - `uuid:<uuid>` UUID of the file
137 ///
138 /// - `tree:<name>,<entries>,<first>,<last>`
139 /// meta-information about a tree in the file; the
140 /// should be in the form "<subdir>/tree-name";'entries' is
141 /// the number of entries in the tree; 'first' and 'last'
142 /// define the entry range.
143 ///
144 /// - `obj:<name>,<class>,<entries>`
145 /// meta-information about a generic object in the file;
146 /// the should be in the form "<subdir>/obj-name"; 'class'
147 /// is the object class; 'entries' is the number of occurrences
148 /// for this object.
149 ///
150 /// - `idx:<index>` Index of this file if sorting with index
151 ///
152 /// Multiple occurrences of 'tree:' or 'obj:' can be specified.
153 /// The initializations done via the input string are super-seeded by the ones by other
154 /// parameters in the constructor, if any.
155 /// If no key is given, the token is interpreted as URL(s).
156 
157 void TFileInfo::ParseInput(const char *in)
158 {
159  // Nothing to do if the string is empty
160  if (!in || strlen(in) <= 0) return;
161 
162  TString sin(in), t;
163  Int_t f1 = 0;
164  while (sin.Tokenize(t, f1, " ")) {
165  if (t.BeginsWith("sz:")) {
166  // The size
167  t.Replace(0, 3, "");
168  if (t.IsDigit()) sscanf(t.Data(), "%lld", &fSize);
169  } else if (t.BeginsWith("md5:")) {
170  // The MD5
171  t.Replace(0, 4, "");
172  if (t.Length() >= 32) {
173  fMD5 = new TMD5;
174  if (fMD5->SetDigest(t) != 0)
175  SafeDelete(fMD5);
176  }
177  } else if (t.BeginsWith("uuid:")) {
178  // The UUID
179  t.Replace(0, 5, "");
180  if (t.Length() > 0) fUUID = new TUUID(t);
181  } else if (t.BeginsWith("tree:")) {
182  // A tree
183  t.Replace(0, 5, "");
184  TString nm, se, sf, sl;
185  Long64_t ent = -1, fst= -1, lst = -1;
186  Int_t f2 = 0;
187  if (t.Tokenize(nm, f2, ","))
188  if (t.Tokenize(se, f2, ","))
189  if (t.Tokenize(sf, f2, ","))
190  t.Tokenize(sl, f2, ",");
191  if (!(nm.IsNull())) {
192  if (se.IsDigit()) sscanf(se.Data(), "%lld", &ent);
193  if (sf.IsDigit()) sscanf(sf.Data(), "%lld", &fst);
194  if (sl.IsDigit()) sscanf(sl.Data(), "%lld", &lst);
195  TFileInfoMeta *meta = new TFileInfoMeta(nm, "TTree", ent, fst, lst);
196  RemoveMetaData(meta->GetName());
197  AddMetaData(meta);
198  }
199  } else if (t.BeginsWith("obj:")) {
200  // A generic object
201  t.Replace(0, 4, "");
202  TString nm, cl, se;
203  Long64_t ent = -1;
204  Int_t f2 = 0;
205  if (t.Tokenize(nm, f2, ","))
206  if (t.Tokenize(cl, f2, ","))
207  t.Tokenize(se, f2, ",");
208  if (cl.IsNull()) cl = "TObject";
209  if (!(nm.IsNull())) {
210  if (se.IsDigit()) sscanf(se.Data(), "%lld", &ent);
211  TFileInfoMeta *meta = new TFileInfoMeta(nm, cl, ent);
212  AddMetaData(meta);
213  }
214  } else if (t.BeginsWith("idx:")) {
215  // The size
216  t.Replace(0, 4, "");
217  if (t.IsDigit()) sscanf(t.Data(), "%d", &fIndex);
218  } else {
219  // A (set of) URL(s)
220  if (t.BeginsWith("url:")) t.Replace(0, 4, "");
221  TString u;
222  Int_t f2 = 0;
223  while (t.Tokenize(u, f2, ",")) {
224  if (!(u.IsNull())) AddUrl(u);
225  }
226  }
227  }
228 }
229 
230 ////////////////////////////////////////////////////////////////////////////////
231 /// Set the UUID to the value associated to the string 'uuid'. This is
232 /// useful to set the UUID to the one of the ROOT file during verification.
233 ///
234 /// NB: we do not change the name in here, because this would screw up lists
235 /// of these objects hashed on the name. Those lists need to be rebuild.
236 /// TFileCollection does that in RemoveDuplicates.
237 
238 void TFileInfo::SetUUID(const char *uuid)
239 {
240  if (uuid) {
241  if (fUUID) delete fUUID;
242  fUUID = new TUUID(uuid);
243  }
244 }
245 
246 ////////////////////////////////////////////////////////////////////////////////
247 /// Return the current url.
248 
250 {
251  if (!fCurrentUrl)
252  const_cast<TFileInfo*>(this)->ResetUrl();
253  return fCurrentUrl;
254 }
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// Iterator function, start iteration by calling ResetUrl().
258 /// The first call to NextUrl() will return the 1st element,
259 /// the seconde the 2nd element etc. Returns 0 in case no more urls.
260 
262 {
263  if (!fUrlList)
264  return 0;
265 
266  TUrl *returl = fCurrentUrl;
267 
268  if (fCurrentUrl)
270 
271  return returl;
272 }
273 
274 ////////////////////////////////////////////////////////////////////////////////
275 /// Find an element from a URL. Returns 0 if not found.
276 
277 TUrl *TFileInfo::FindByUrl(const char *url, Bool_t withDeflt)
278 {
279  TIter nextUrl(fUrlList);
280  TUrl *urlelement;
281 
282  TRegexp rg(url);
283  while ((urlelement = (TUrl*) nextUrl())) {
284  if (TString(urlelement->GetUrl(withDeflt)).Index(rg) != kNPOS) {
285  return urlelement;
286  }
287  }
288  return 0;
289 }
290 
291 ////////////////////////////////////////////////////////////////////////////////
292 /// Add a new URL. If 'infront' is TRUE the new url is pushed at the beginning
293 /// of the list; otherwise is pushed back.
294 /// Returns kTRUE if successful, kFALSE otherwise.
295 
296 Bool_t TFileInfo::AddUrl(const char *url, Bool_t infront)
297 {
298  if (FindByUrl(url))
299  return kFALSE;
300 
301  if (!fUrlList) {
302  fUrlList = new TList;
303  fUrlList->SetOwner();
304  }
305 
306  TUrl *newurl = new TUrl(url, kTRUE);
307  // We set the current Url to the first url added
308  if (fUrlList->GetSize() == 0)
309  fCurrentUrl = newurl;
310 
311  if (infront)
312  fUrlList->AddFirst(newurl);
313  else
314  fUrlList->Add(newurl);
315  return kTRUE;
316 }
317 
318 ////////////////////////////////////////////////////////////////////////////////
319 /// Remove an URL. Returns kTRUE if successful, kFALSE otherwise.
320 
321 Bool_t TFileInfo::RemoveUrl(const char *url)
322 {
323  TUrl *lurl;
324  if ((lurl = FindByUrl(url))) {
325  fUrlList->Remove(lurl);
326  if (lurl == fCurrentUrl)
327  ResetUrl();
328  delete lurl;
329  return kTRUE;
330  }
331  return kFALSE;
332 }
333 
334 ////////////////////////////////////////////////////////////////////////////////
335 /// Remove URL at given position. Returns kTRUE on success, kFALSE on error.
336 
338 {
339  TUrl *tUrl;
340  if ((tUrl = dynamic_cast<TUrl *>(fUrlList->At(i))) != NULL) {
341  fUrlList->Remove(tUrl);
342  if (tUrl == fCurrentUrl)
343  ResetUrl();
344  delete tUrl;
345  return kTRUE;
346  }
347 
348  return kFALSE;
349 }
350 
351 ////////////////////////////////////////////////////////////////////////////////
352 /// Set 'url' as current URL, if in the list
353 /// Return kFALSE if not in the list
354 
356 {
357  TUrl *lurl;
358  if ((lurl = FindByUrl(url))) {
359  fCurrentUrl = lurl;
360  return kTRUE;
361  }
362  return kFALSE;
363 }
364 
365 ////////////////////////////////////////////////////////////////////////////////
366 /// Set 'url' as current URL, if in the list
367 /// Return kFALSE if not in the list
368 
370 {
371  if (url && fUrlList && fUrlList->FindObject(url)) {
372  fCurrentUrl = url;
373  return kTRUE;
374  }
375  return kFALSE;
376 }
377 
378 ////////////////////////////////////////////////////////////////////////////////
379 /// Add's a meta data object to the file info object. The object will be
380 /// adopted by the TFileInfo and should not be deleted by the user.
381 /// Typically objects of class TFileInfoMeta or derivatives should be added,
382 /// but any class is accepted.
383 /// Returns kTRUE if successful, kFALSE otherwise.
384 
386 {
387  if (meta) {
388  if (!fMetaDataList) {
389  fMetaDataList = new TList;
391  }
392  fMetaDataList->Add(meta);
393  return kTRUE;
394  }
395  return kFALSE;
396 }
397 
398 ////////////////////////////////////////////////////////////////////////////////
399 /// Remove the metadata object. If meta is 0 remove all meta data objects.
400 /// Returns kTRUE if successful, kFALSE otherwise.
401 
403 {
404  if (fMetaDataList) {
405  if (!meta || strlen(meta) <= 0) {
407  return kTRUE;
408  } else {
409  TObject *o = fMetaDataList->FindObject(meta);
410  if (o) {
411  fMetaDataList->Remove(o);
412  delete o;
413  return kTRUE;
414  }
415  }
416  }
417  return kFALSE;
418 }
419 
420 ////////////////////////////////////////////////////////////////////////////////
421 /// Get meta data object with specified name. If meta is 0
422 /// get first meta data object. Returns 0 in case no
423 /// suitable meta data object is found.
424 
425 TFileInfoMeta *TFileInfo::GetMetaData(const char *meta) const
426 {
427  if (fMetaDataList) {
428  TFileInfoMeta *m;
429  if (!meta || strlen(meta) <= 0)
431  else
433  if (m) {
434  TClass *c = m->IsA();
435  return (c && c->InheritsFrom(TFileInfoMeta::Class())) ? m : 0;
436  }
437  }
438  return 0;
439 }
440 
441 ////////////////////////////////////////////////////////////////////////////////
442 /// Compare TFileInfo object by their first urls.
443 
445 {
446  Int_t rc = 0;
448  const TFileInfo *fi = dynamic_cast<const TFileInfo *>(obj);
449  if (!fi) {
450  rc = -1;
451  } else {
452  if (fIndex < fi->fIndex) {
453  rc = -1;
454  } else if (fIndex > fi->fIndex) {
455  rc = 1;
456  }
457  }
458  } else {
459  if (this == obj) {
460  rc = 0;
461  } else if (TFileInfo::Class() != obj->IsA()) {
462  rc = -1;
463  } else {
464  rc = (GetFirstUrl()->Compare(((TFileInfo*)obj)->GetFirstUrl()));
465  }
466  }
467  // Done
468  return rc;
469 }
470 
471 ////////////////////////////////////////////////////////////////////////////////
472 /// Print information about this object. If option contains 'L' a long listing
473 /// will be printed (on multiple lines). Otherwise one line is printed with the
474 /// following information: current url, default tree name|class|entries, md5;
475 /// the default tree name is passed via the option ("T:<default_tree>") by the
476 /// owning TFileCollection.
477 
478 void TFileInfo::Print(Option_t *option) const
479 {
480  if (GetMD5()) GetMD5()->Final();
481  TString opt(option);
482  if (opt.Contains("L", TString::kIgnoreCase)) {
483 
484  Printf("UUID: %s\nMD5: %s\nSize: %lld\nIndex: %d",
485  GetUUID() ? GetUUID()->AsString() : "undef",
486  GetMD5() ? GetMD5()->AsString() : "undef",
487  GetSize(), GetIndex());
488 
489  TIter next(fUrlList);
490  TUrl *u;
491  Printf(" === URLs ===");
492  while ((u = (TUrl*)next()))
493  Printf(" URL: %s", u->GetUrl());
494 
495  TIter nextm(fMetaDataList);
496  TObject *m = 0; // can be any TObject not only TFileInfoMeta
497  while ((m = (TObject*) nextm())) {
498  Printf(" === Meta Data Object ===");
499  m->Print();
500  }
501  } else {
502  TString out("current-url-undef -|-|- md5-undef");
503  if (GetCurrentUrl()) out.ReplaceAll("current-url-undef", GetCurrentUrl()->GetUrl());
504  // Extract the default tree name, if any
505  TString deft;
506  if (opt.Contains("T:")) deft = opt(opt.Index("T:")+2, opt.Length());
507  TFileInfoMeta *meta = 0;
508  if (fMetaDataList && !deft.IsNull()) meta = (TFileInfoMeta *) fMetaDataList->FindObject(deft);
509  if (fMetaDataList && !meta) meta = (TFileInfoMeta *) fMetaDataList->First();
510  if (meta) out.ReplaceAll("-|-|-", TString::Format("%s|%s|%lld", meta->GetName(),
511  meta->GetTitle(), meta->GetEntries()));
512  if (GetMD5())
513  out.ReplaceAll("md5-undef", TString::Format("%s", GetMD5()->AsString()));
514  Printf("%s", out.Data());
515  }
516 }
517 
518 
519 ////////////////////////////////////////////////////////////////////////////////
520 /// Create file meta data object.
521 
522 TFileInfoMeta::TFileInfoMeta(const char *objPath, const char *objClass,
523  Long64_t entries, Long64_t first, Long64_t last,
524  Long64_t totbytes, Long64_t zipbytes)
525  : TNamed(objPath, objClass), fEntries(entries), fFirst(first),
526  fLast(last), fTotBytes(totbytes), fZipBytes(zipbytes)
527 {
528  TString p = objPath;
529  if (!p.BeginsWith("/")) {
530  p.Prepend("/");
531  SetName(p);
532  }
533 
534  TClass *c = TClass::GetClass(objClass);
535  fIsTree = (c && c->InheritsFrom("TTree")) ? kTRUE : kFALSE;
537 }
538 
539 ////////////////////////////////////////////////////////////////////////////////
540 /// Create file meta data object.
541 
542 TFileInfoMeta::TFileInfoMeta(const char *objPath, const char *objDir,
543  const char *objClass, Long64_t entries,
544  Long64_t first, Long64_t last,
545  Long64_t totbytes, Long64_t zipbytes)
546  : TNamed(objPath, objClass), fEntries(entries), fFirst(first),
547  fLast(last), fTotBytes(totbytes), fZipBytes(zipbytes)
548 {
549  TString sdir = objDir;
550  if (!sdir.BeginsWith("/"))
551  sdir.Prepend("/");
552  if (!sdir.EndsWith("/"))
553  sdir += "/";
554  sdir += objPath;
555  SetName(sdir);
556 
557  TClass *c = TClass::GetClass(objClass);
558  fIsTree = (c && c->InheritsFrom("TTree")) ? kTRUE : kFALSE;
560 }
561 
562 ////////////////////////////////////////////////////////////////////////////////
563 /// Copy constructor
564 
566  : TNamed(m.GetName(), m.GetTitle())
567 {
568  fEntries = m.fEntries;
569  fFirst = m.fFirst;
570  fLast = m.fLast;
571  fIsTree = m.fIsTree;
572  fTotBytes = m.fTotBytes;
573  fZipBytes = m.fZipBytes;
576 }
577 
578 ////////////////////////////////////////////////////////////////////////////////
579 /// Get the object's directory in the ROOT file.
580 
581 const char *TFileInfoMeta::GetDirectory() const
582 {
583  return gSystem->DirName(GetName());
584 }
585 
586 ////////////////////////////////////////////////////////////////////////////////
587 /// Get the object name, with path stripped off. For full path
588 /// use GetName().
589 
590 const char *TFileInfoMeta::GetObject() const
591 {
592  return gSystem->BaseName(GetName());
593 }
594 
595 ////////////////////////////////////////////////////////////////////////////////
596 /// Print information about this object.
597 
598 void TFileInfoMeta::Print(Option_t * /* option */) const
599 {
600  Printf(" Name: %s\n Class: %s\n Entries: %lld\n"
601  " First: %lld\n Last: %lld",
603 }
c
#define c(i)
Definition: RSha256.hxx:101
TFileInfoMeta::fIsTree
Bool_t fIsTree
Definition: TFileInfo.h:114
m
auto * m
Definition: textangle.C:8
TFileInfo::fIndex
Int_t fIndex
Definition: TFileInfo.h:50
TFileInfoMeta::fTotBytes
Long64_t fTotBytes
Definition: TFileInfo.h:115
first
Definition: first.py:1
TFileInfo
Class describing a generic file including meta information.
Definition: TFileInfo.h:39
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TFileInfo::RemoveUrl
Bool_t RemoveUrl(const char *url)
Remove an URL. Returns kTRUE if successful, kFALSE otherwise.
Definition: TFileInfo.cxx:321
TList::AddFirst
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TList.cxx:99
TFileInfo::GetCurrentUrl
TUrl * GetCurrentUrl() const
Return the current url.
Definition: TFileInfo.cxx:249
TFileInfo::AddMetaData
Bool_t AddMetaData(TObject *meta)
Add's a meta data object to the file info object.
Definition: TFileInfo.cxx:385
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
Option_t
const char Option_t
Definition: RtypesCore.h:66
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TString::Prepend
TString & Prepend(const char *cs)
Definition: TString.h:661
TSystem::BaseName
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:933
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
TFileInfo::SetUUID
void SetUUID(const char *uuid)
Set the UUID to the value associated to the string 'uuid'.
Definition: TFileInfo.cxx:238
TFileInfo::fUrlList
TList * fUrlList
current URL to access the file, points to URL
Definition: TFileInfo.h:44
TString::Data
const char * Data() const
Definition: TString.h:369
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
TString::Replace
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Definition: TString.h:682
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
TFileInfo::Compare
Int_t Compare(const TObject *obj) const
Compare TFileInfo object by their first urls.
Definition: TFileInfo.cxx:444
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TMD5::Final
void Final()
MD5 finalization, ends an MD5 message-digest operation, writing the the message digest and zeroizing ...
Definition: TMD5.cxx:167
TUrl::Compare
Int_t Compare(const TObject *obj) const
Compare two urls as strings.
Definition: TUrl.cxx:547
TFileInfo::fMD5
TMD5 * fMD5
Definition: TFileInfo.h:47
TNamed::fName
TString fName
Definition: TNamed.h:32
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:543
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
sin
double sin(double)
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TFileInfo::ResetUrl
void ResetUrl()
Definition: TFileInfo.h:69
TClass.h
TFileInfo::NextUrl
TUrl * NextUrl()
Iterator function, start iteration by calling ResetUrl().
Definition: TFileInfo.cxx:261
TFileInfo::GetFirstUrl
TUrl * GetFirstUrl() const
Definition: TFileInfo.h:72
TSystem::DirName
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1005
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TMD5::AsString
const char * AsString() const
Return message digest as string.
Definition: TMD5.cxx:220
TString
Basic string class.
Definition: TString.h:136
TFileInfoMeta::fZipBytes
Long64_t fZipBytes
Definition: TFileInfo.h:116
TFileInfo::SetCurrentUrl
Bool_t SetCurrentUrl(const char *url)
Set 'url' as current URL, if in the list Return kFALSE if not in the list.
Definition: TFileInfo.cxx:355
TFileInfo::GetMetaData
TFileInfoMeta * GetMetaData(const char *meta=0) const
Get meta data object with specified name.
Definition: TFileInfo.cxx:425
TFileInfo::FindByUrl
TUrl * FindByUrl(const char *url, Bool_t withDeflt=kFALSE)
Find an element from a URL. Returns 0 if not found.
Definition: TFileInfo.cxx:277
TFileInfo::fCurrentUrl
TUrl * fCurrentUrl
Definition: TFileInfo.h:42
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TNamed::fTitle
TString fTitle
Definition: TNamed.h:33
TUUID.h
TFileInfo::AddUrl
Bool_t AddUrl(const char *url, Bool_t infront=kFALSE)
Add a new URL.
Definition: TFileInfo.cxx:296
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TFileInfo::fUUID
TUUID * fUUID
Definition: TFileInfo.h:46
TRegexp.h
TList::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:356
TList::After
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Definition: TList.cxx:329
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TSystem.h
TFileInfo::kCorrupted
@ kCorrupted
Definition: TFileInfo.h:59
TFileInfo.h
TFileInfoMeta::kExternal
@ kExternal
Definition: TFileInfo.h:121
TFileInfoMeta::GetDirectory
const char * GetDirectory() const
Get the object's directory in the ROOT file.
Definition: TFileInfo.cxx:581
TFileInfoMeta::fEntries
Long64_t fEntries
Definition: TFileInfo.h:111
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TFileInfo::RemoveMetaData
Bool_t RemoveMetaData(const char *meta=0)
Remove the metadata object.
Definition: TFileInfo.cxx:402
TFileInfoMeta::GetEntries
Long64_t GetEntries() const
Definition: TFileInfo.h:140
TFileInfo::ParseInput
void ParseInput(const char *in)
Parse the input line to extract init information from 'in'; the input string is tokenized on ' '; the...
Definition: TFileInfo.cxx:157
TFileInfo::GetIndex
Int_t GetIndex() const
Definition: TFileInfo.h:99
TFileInfoMeta
Definition: TFileInfo.h:108
TFileInfo::GetSize
Long64_t GetSize() const
Definition: TFileInfo.h:80
TFileInfoMeta::fFirst
Long64_t fFirst
Definition: TFileInfo.h:112
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
TClass::GetClass
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2925
TUUID
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Definition: TUUID.h:42
TMD5
This code implements the MD5 message-digest algorithm.
Definition: TMD5.h:44
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TUrl::GetUrl
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
TUrl
This class represents a WWW compatible URL.
Definition: TUrl.h:33
TString::IsDigit
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Definition: TString.cxx:1763
TFileInfo::RemoveUrlAt
Bool_t RemoveUrlAt(Int_t i)
Remove URL at given position. Returns kTRUE on success, kFALSE on error.
Definition: TFileInfo.cxx:337
TRegexp
Regular expression class.
Definition: TRegexp.h:31
TFileInfo::GetMD5
TMD5 * GetMD5() const
Definition: TFileInfo.h:82
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
Printf
void Printf(const char *fmt,...)
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TFileInfo::kStaged
@ kStaged
Definition: TFileInfo.h:58
f1
TF1 * f1
Definition: legend1.C:11
TFileInfo::fMetaDataList
TList * fMetaDataList
Definition: TFileInfo.h:48
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TFileInfo::fSize
Long64_t fSize
Definition: TFileInfo.h:45
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TFileInfo::TFileInfo
TFileInfo(const char *url=0, Long64_t size=-1, const char *uuid=0, const char *md5=0, TObject *meta=0)
Constructor.
Definition: TFileInfo.cxx:32
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TUUID::AsString
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Definition: TUUID.cxx:570
TFileInfoMeta::Print
void Print(Option_t *options="") const
Print information about this object.
Definition: TFileInfo.cxx:598
TMD5.h
TIter
Definition: TCollection.h:233
TMD5::SetDigest
Int_t SetDigest(const char *md5ascii)
Set the digest from the ASCII representation 'md5ascii'.
Definition: TMD5.cxx:395
fSize
size_t fSize
Definition: DeclareConverters.h:342
fFirst
T1 fFirst
Definition: X11Events.mm:86
TFileInfoMeta::GetObject
const char * GetObject() const
Get the object name, with path stripped off.
Definition: TFileInfo.cxx:590
TFileInfo::Print
void Print(Option_t *options="") const
Print information about this object.
Definition: TFileInfo.cxx:478
TFileInfoMeta::fLast
Long64_t fLast
Definition: TFileInfo.h:113
TFileInfo::kSortWithIndex
@ kSortWithIndex
Definition: TFileInfo.h:60
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TGeant4Unit::nm
static constexpr double nm
Definition: TGeant4SystemOfUnits.h:105
Class
void Class()
Definition: Class.C:29
TFileInfoMeta::TFileInfoMeta
TFileInfoMeta()
Definition: TFileInfo.h:123
TUrl.h
TList
A doubly linked list.
Definition: TList.h:44
TFileInfo::GetUUID
TUUID * GetUUID() const
Definition: TFileInfo.h:81
int
TFileInfo::~TFileInfo
virtual ~TFileInfo()
Destructor.
Definition: TFileInfo.cxx:120