TObjString.h

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TObjString.h 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 #ifndef ROOT_TObjString
00013 #define ROOT_TObjString
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TObjString                                                           //
00019 //                                                                      //
00020 // Collectable string class. This is a TObject containing a TString.    //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027 #ifndef ROOT_TString
00028 #include "TString.h"
00029 #endif
00030 
00031 
00032 class TObjString : public TObject {
00033 
00034 private:
00035    TString    fString;       // wrapped TString
00036 
00037 public:
00038    TObjString(const char *s = "") : fString(s) { }
00039    TObjString(const TObjString &s) : TObject(), fString(s.fString) { }
00040    ~TObjString() { }
00041    Int_t       Compare(const TObject *obj) const;
00042    const char *GetName() const { return fString; }
00043    ULong_t     Hash() const { return fString.Hash(); }
00044    void        FillBuffer(char *&buffer) { fString.FillBuffer(buffer); }
00045    void        Print(Option_t *) const { Printf("TObjString = %s", (const char*)fString); }
00046    Bool_t      IsSortable() const { return kTRUE; }
00047    Bool_t      IsEqual(const TObject *obj) const;
00048    void        ReadBuffer(char *&buffer) { fString.ReadBuffer(buffer); }
00049    void        SetString(const char *s) { fString = s; }
00050    TString     GetString() const { return fString; }
00051    Int_t       Sizeof() const { return fString.Sizeof(); }
00052    TString    &String() { return fString; }
00053 
00054    ClassDef(TObjString,1)  //Collectable string class
00055 };
00056 
00057 #endif
00058 

Generated on Tue Jul 5 14:10:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1