TGText


class description - source file - inheritance tree

class TGText


    protected:
Int_t DownSearchBM(const TString& s, const char* searchPattern, Bool_t cs) void LongestLine() Bool_t SetCurrentRow(Int_t row) void TGTextP() Int_t UpSearchBM(const TString& s, const char* searchPattern, Bool_t cs) public:
TGText TGText() TGText TGText(TGText* text) TGText TGText(const char* string) TGText TGText(TGText&) virtual void ~TGText() Bool_t Append(const char* fn) Bool_t BreakLine(TGPosition pos) TClass* Class() void Clear() Int_t ColCount() const Bool_t DelChar(TGPosition pos) Bool_t DelLine(Int_t row) Bool_t DelText(TGPosition start, TGPosition end) char GetChar(TGPosition pos) Bool_t GetLine(TGPosition pos, TString& str) Int_t GetLineLength(Int_t row) Int_t GetLongestLine() const Bool_t InsChar(TGPosition pos, char c) Bool_t InsLine(TGPosition pos, const TString& str) Bool_t InsText(TGPosition ins_pos, TGText* src, TGPosition start_src, TGPosition end_src) virtual TClass* IsA() const Bool_t IsSaved() const Bool_t Load(const char* fn, Int_t startpos = 0, Int_t length = -1) Bool_t Replace(TGPosition pos, const char* oldText, const char* newText, Bool_t direction, Bool_t caseSensitive) Int_t RowCount() const Bool_t Save(const char* fn) Bool_t Search(TGPosition* foundPos, TGPosition start, const char* searchString, Bool_t direction, Bool_t caseSensitive) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b)

Data Members

protected:
Bool_t fIsSaved false if text needs to be saved TList* fLines list of lines TObjString* fCurrent current line Int_t fCurrentRow current row number Int_t fRowCount number of rows Int_t fColCount number of columns in current line Int_t fLongestLine length of longest line

Class Description

                                                                      
 TGText                                                               
                                                                      
 A TGText is a multi line text buffer. It allows the text to be       
 loaded from file, saved to file and edited. It is used in the        
 TGTextEdit widget. Single line text is handled by TGTextBuffer.      
                                                                      


void TGTextP()
 Common initialization method.

TGText()
 Create default (empty) object.

TGText(TGText *text)
 Create text object and initialize with other text object.

TGText(const char *string)
 Create text object and initialize with string.

~TGText()
 Destroy text object.

void Clear()
 Clear text object.

Bool_t Load(const char *fn, Int_t startpos, Int_t length)
 Load text from file fn. Startpos is the begin from where to
 load the file and length is the number of characters to read
 from the file.

Bool_t Save(const char *fn)
 Save text buffer to file fn.

Bool_t Append(const char *fn)
 Append buffer to file fn.

Bool_t DelChar(TGPosition pos)
 Delete character at specified position pos.

Bool_t InsChar(TGPosition pos, char c)
 Insert character c at the specified position pos.

char GetChar(TGPosition pos)
 Get character a position pos.

Bool_t DelText(TGPosition start, TGPosition end)
 Delete text between start and end positions.

Bool_t InsText(TGPosition ins_pos, TGText *src, TGPosition start_src, TGPosition end_src)
 Insert src text from start_src to end_src into text at position ins_pos.

Bool_t InsLine(TGPosition pos, const TString &str)
 Insert string before specified position. Returns false if insertion failed.

Bool_t DelLine(Int_t row)
 Delete specified row. Returns false if row does not exist.

Bool_t GetLine(TGPosition pos, TString &str)
 Return string at position pos. Returns false in case pos does not exist.

Bool_t BreakLine(TGPosition pos)
 Break line at position pos. Returns false if pos does not exist.

Int_t GetLineLength(Int_t row)
 Get length of specified line. Returns -1 if row does not exist.

Bool_t SetCurrentRow(Int_t row)
 Make specified row the current row. Returns false if row does not exist.

Bool_t Search(TGPosition *foundPos, TGPosition start, const char *searchString, Bool_t direction, Bool_t caseSensitive)
 Search for string searchString starting at the specified position going
 in forward (direction = true) or backward direction. Returns true if
 found and foundPos is set accordingly.

Int_t DownSearchBM(const TString &s, const char *searchPattern, Bool_t cs)
 Search down in string s for pattern. If cs is true be case sensitive.
 Returns x position in string or kNPOS if not found.

Int_t UpSearchBM(const TString &s, const char *searchPattern, Bool_t cs)
 Search up in string s for pattern. If cs is true be case sensitive.
 Returns x position in string or kNPOS if not found.

Bool_t Replace(TGPosition pos, const char *oldText, const char *newText, Bool_t direction, Bool_t caseSensitive)
 Replace oldText by newText. Returns false if nothing replaced.

void LongestLine()
 Set fLongestLine.



Inline Functions


             Bool_t IsSaved() const
              Int_t RowCount() const
              Int_t ColCount() const
              Int_t GetLongestLine() const
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
             TGText TGText(TGText&)


Author: Fons Rademakers 26/04/98
Last update: 2.21/06 15/02/99 10.06.27 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.