Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:56:51

0001 // @(#)root/base:$Id$
0002 // Author: Fons Rademakers   12/11/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TObjString
0013 #define ROOT_TObjString
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TObjString                                                           //
0019 //                                                                      //
0020 // Collectable string class. This is a TObject containing a TString.    //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TObject.h"
0025 #include "TString.h"
0026 
0027 
0028 class TObjString : public TObject {
0029 
0030 private:
0031    TString    fString;       // wrapped TString
0032 
0033 public:
0034    TObjString(const char *s = "") : fString(s) { }
0035    ~TObjString();
0036    Int_t       Compare(const TObject *obj) const override;
0037    TString     CopyString() const { return fString; }
0038    const char *GetName() const override { return fString; }
0039    ULong_t     Hash() const override { return fString.Hash(); }
0040    void        FillBuffer(char *&buffer) { fString.FillBuffer(buffer); }
0041    void        Print(Option_t *) const override { Printf("TObjString = %s", (const char*)fString); }
0042    Bool_t      IsSortable() const override { return kTRUE; }
0043    Bool_t      IsEqual(const TObject *obj) const override;
0044    void        ReadBuffer(char *&buffer) { fString.ReadBuffer(buffer); }
0045    void        SetString(const char *s) { fString = s; }
0046    const TString &GetString() const { return fString; }
0047    Int_t       Sizeof() const { return fString.Sizeof(); }
0048    TString    &String() { return fString; }
0049 
0050    ClassDefOverride(TObjString,1)  //Collectable string class
0051 };
0052 
0053 #endif
0054