Revision 49eea8418dde16dc15b5ac423f03927583720a46 authored by Rene Brun on 19 September 2006, 19:13:27 UTC, committed by Rene Brun on 19 September 2006, 19:13:27 UTC
git-svn-id: http://root.cern.ch/svn/root/trunk@16301 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent e152260
TGTextBuffer.h
// @(#)root/gui:$Name: $:$Id: TGTextBuffer.h,v 1.3 2006/05/15 11:01:14 rdm Exp $
// Author: Fons Rademakers 05/05/98
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TGTextBuffer
#define ROOT_TGTextBuffer
//////////////////////////////////////////////////////////////////////////
// //
// TGTextBuffer //
// //
// A text buffer is used in several widgets, like TGTextEntry, //
// TGFileDialog, etc. It is a little wrapper around the powerful //
// TString class and used for sinlge line texts. For multi line texts //
// use TGText. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TString
#include "TString.h"
#endif
class TGTextBuffer {
private:
TString *fBuffer;
protected:
TGTextBuffer(const TGTextBuffer& tb): fBuffer(tb.fBuffer) { }
TGTextBuffer& operator=(const TGTextBuffer& tb)
{if(this!=&tb) fBuffer=tb.fBuffer; return *this;}
public:
TGTextBuffer(): fBuffer(new TString) { }
TGTextBuffer(Int_t length): fBuffer(new TString(length)) { }
virtual ~TGTextBuffer() { delete fBuffer; }
UInt_t GetTextLength() const { return fBuffer->Length(); }
UInt_t GetBufferLength() const { return fBuffer->Capacity(); }
const char *GetString() const { return fBuffer->Data(); }
void AddText(Int_t pos, const char *text) { fBuffer->Insert(pos, text); }
void AddText(Int_t pos, const char *text, Int_t length) { fBuffer->Insert(pos, text, length); }
void RemoveText(Int_t pos, Int_t length) { fBuffer->Remove(pos, length); }
void Clear() { fBuffer->Remove(0, fBuffer->Length()); }
ClassDef(TGTextBuffer,0) // Text buffer used by widgets like TGTextEntry, etc.
};
#endif
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...