85 fPrev(
tl.fPrev), fNext(
tl.fNext)
315 fFilename(
gt.fFilename),
316 fIsSaved(
gt.fIsSaved),
318 fCurrent(
gt.fCurrent),
319 fCurrentRow(
gt.fCurrentRow),
320 fRowCount(
gt.fRowCount),
321 fColCount(
gt.fColCount),
322 fLongestLine(
gt.fLongestLine)
374 end.fY =
text->RowCount() - 1;
375 end.fX =
text->GetLineLength(end.fY) - 1;
452 buf2 =
new char[count+1];
457 while ((
c = *
src++)) {
459 if (
c == 0x0D ||
c == 0x0A)
462 else if (
c == 0x09) {
464 while (((
dst-
buf2) & 0x7) && (cnt++ < count-1))
468 if (cnt++ >= count-1)
break;
473 buffer =
new char[bufferSize];
549 while ((
c = *
src++)) {
551 if (
c == 0x0D ||
c == 0x0A)
554 else if (
c == 0x09) {
565 buffer =
new char[bufferSize];
617 buffer =
new char[
travel->fLength+2];
619 buffer[
travel->fLength] =
'\n';
620 buffer[
travel->fLength+1] =
'\0';
621 while (buffer[i] !=
'\0') {
622 if (buffer[i] ==
'\t') {
624 while (buffer[
j] == 16)
658 buffer =
new char[
travel->fLength+2];
660 buffer[
travel->fLength] =
'\n';
661 buffer[
travel->fLength+1] =
'\0';
662 while (buffer[i] !=
'\0') {
663 if (buffer[i] ==
'\t') {
665 while (buffer[
j] == 16 && buffer[
j] !=
'\0')
736 if ((start.fY < 0) || (start.fY >=
fRowCount) ||
749 if (start.fY == end.fY) {
755 for (
Long_t i = start.fY+1; i < end.fY; i++) {
1096 while (buffer[i] !=
'\0') {
1097 if (buffer[i] ==
'\t') {
1099 while (buffer[
j] == 16 && buffer[
j] !=
'\0') {
1116 while ((
c = *
src++)) {
1126 if (cnt++ >=
kMaxLen-1)
break;
1167 for (
int i = (
int)start.fX; i >= 0; i--) {
1170 if (
x >= start.fX) {
int Int_t
Signed integer 4 bytes (int)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char text
virtual ~TGTextLine()
Delete a line of text.
TGTextLine * fPrev
previous line
char * fString
line of text
void DelChar(ULong_t pos)
Delete a character from the line.
void InsChar(ULong_t pos, char character)
Insert a character at the specified position.
char GetChar(ULong_t pos)
Get a character at the specified position from the line.
char * GetWord(ULong_t pos)
Get word at position. Returned string must be deleted.
void InsText(ULong_t pos, const char *text)
Insert text in line starting at position pos.
TGTextLine * fNext
next line
void Clear()
Clear a line of text.
TGTextLine()
Create empty line of text (default ctor).
void DelText(ULong_t pos, ULong_t length)
Delete length chars from line starting at position pos.
ULong_t fLength
length of line
char * GetText(ULong_t pos, ULong_t length)
Get length characters from line starting at pos.
TGTextLine & operator=(const TGTextLine &)
assignment operator
A TGText is a multi line text buffer.
Bool_t InsChar(TGLongPosition pos, char c)
Insert character c at the specified position pos.
void ReTab(Long_t row)
Redo all tabs in a line. Needed after a new tab is inserted.
virtual ~TGText()
Destroy text buffer.
Long_t fColCount
number of columns in current line
Bool_t AddText(TGText *text)
Add another text buffer to this buffer.
TGTextLine * fFirst
first line of text
Bool_t DelText(TGLongPosition start, TGLongPosition end)
Delete text between start and end positions.
TString fFilename
name of opened file ("" if open buffer)
TGText()
Create default (empty) text buffer.
Long_t fLongestLine
length of longest line
Long_t fRowCount
number of rows
Bool_t fIsSaved
false if text needs to be saved
void LongestLine()
Set fLongestLine.
Bool_t Search(TGLongPosition *foundPos, TGLongPosition start, const char *searchString, Bool_t direction, Bool_t caseSensitive)
Search for string searchString starting at the specified position going in forward (direction = true)...
Bool_t DelLine(ULong_t pos)
Delete specified row. Returns false if row does not exist.
Bool_t Save(const char *fn)
Save text buffer to file fn.
Bool_t Replace(TGLongPosition start, const char *oldText, const char *newText, Bool_t direction, Bool_t caseSensitive)
Replace oldText by newText. Returns false if nothing replaced.
Bool_t InsLine(ULong_t row, const char *string)
Insert string before specified position.
Bool_t SetCurrentRow(Long_t row)
Make specified row the current row.
Long_t fCurrentRow
current row number
Bool_t DelChar(TGLongPosition pos)
Delete character at specified position pos.
Bool_t BreakLine(TGLongPosition pos)
Break line at position pos. Returns false if pos is not valid.
Bool_t InsText(TGLongPosition pos, const char *buf)
Insert single line at specified position.
char * GetLine(TGLongPosition pos, ULong_t length)
Return string at position pos.
TGTextLine * fCurrent
current line
char GetChar(TGLongPosition pos)
Get character a position pos. If character not valid return -1.
Bool_t Load(const char *fn, Long_t startpos=0, Long_t length=-1)
Load text from file fn.
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
void Clear()
Clear text buffer.
Bool_t Append(const char *fn)
Append buffer to file fn.
Long_t GetLineLength(Long_t row)
Get length of specified line. Returns -1 if row does not exist.
void Init()
Common initialization method.
TString AsString()
Returns content as ROOT string.
TGText & operator=(const TGText &)
assignment operator
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const