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