Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TObjString.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Fons Rademakers 12/11/95
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 TObjString
13\ingroup Base
14
15Collectable string class. This is a TObject containing a TString.
16*/
17
18#include "TObjString.h"
19#include "TROOT.h"
20
21
22////////////////////////////////////////////////////////////////////////////////
23/// TObjString destructor.
24
26{
27 // Required since we overload TObject::Hash.
29}
30
31////////////////////////////////////////////////////////////////////////////////
32/// String compare the argument with this object.
33
35{
36 if (this == obj) return 0;
37 if (TObjString::Class() != obj->IsA()) return -1;
38 return fString.CompareTo(((TObjString*)obj)->fString);
39}
40
41////////////////////////////////////////////////////////////////////////////////
42/// Return kTRUE if the argument has the same content as this object.
43
45{
46 if (this == obj) return kTRUE;
47 if (TObjString::Class() != obj->IsA()) return kFALSE;
48 return fString == ((TObjString*)obj)->fString;
49}
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
Collectable string class.
Definition TObjString.h:28
Bool_t IsEqual(const TObject *obj) const override
Return kTRUE if the argument has the same content as this object.
static TClass * Class()
Int_t Compare(const TObject *obj) const override
String compare the argument with this object.
TString fString
Definition TObjString.h:31
~TObjString()
TObjString destructor.
Mother of all ROOT objects.
Definition TObject.h:41
virtual TClass * IsA() const
Definition TObject.h:246
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition TString.cxx:464
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:400