00001 // @(#)root/base:$Id: TObjString.cxx 20877 2007-11-19 11:17:07Z rdm $ 00002 // Author: Fons Rademakers 12/11/95 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 ////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // TObjString // 00015 // // 00016 // Collectable string class. This is a TObject containing a TString. // 00017 // // 00018 ////////////////////////////////////////////////////////////////////////// 00019 00020 #include "TObjString.h" 00021 00022 ClassImp(TObjString) 00023 00024 //______________________________________________________________________________ 00025 Int_t TObjString::Compare(const TObject *obj) const 00026 { 00027 // string compare the argument with this object. 00028 if (this == obj) return 0; 00029 if (TObjString::Class() != obj->IsA()) return -1; 00030 return fString.CompareTo(((TObjString*)obj)->fString); 00031 } 00032 00033 //______________________________________________________________________________ 00034 Bool_t TObjString::IsEqual(const TObject *obj) const 00035 { 00036 // return kTRUE if the argument has the same content as this object. 00037 00038 if (this == obj) return kTRUE; 00039 if (TObjString::Class() != obj->IsA()) return kFALSE; 00040 return fString == ((TObjString*)obj)->fString; 00041 }