## class fltk::TextBuffer

### Class Hierarchy

    fltk::TextBuffer
             |
             +----fltk::TextDisplay,
                  fltk::TextEditor

### Include Files

    #include <FL/TextBuffer.H>

### Description

The `fltk::TextBuffer` class is used by the `fltk::TextDisplay` and `fltk::TextEditor` to manage complex text data and is based upon the excellent NEdit text editor engine - see http://www.nedit.org/.

### Methods

#### fltk::TextBuffer

#### ~TextBuffer

#### add_modify_callback

#### append

#### appendfile

#### call_modify_callbacks

#### character

#### character_width

#### clear_rectangular

#### copy

#### count_displayed_characters

#### count_lines

#### expand_character

#### findchar_backward

#### findchar_forward

#### findchars_backward

#### findchars_forward

#### highlight

#### highlight_position

#### highlight_rectangular

#### highlight_selection

#### highlight_text

#### insert_column

#### insertfile

#### insert

#### length

#### line_end

#### line_start

#### line_text

#### loadfile

#### null_substitution_character

#### outputfile

#### overlay_rectangular

#### primary_selection

#### remove_modify_callback

#### remove_rectangular

#### remove

#### remove_secondary_selection

#### remove_selection

#### replace_rectangular

#### replace

#### replace_secondary_selection

#### replace_selection

#### rewind_lines

#### savefile

#### search_backward

#### search_forward

#### secondary_selection_position

#### secondary_selection

#### secondary_selection_text

#### secondary_select_rectangular

#### secondary_select

#### secondary_unselect

#### selected

#### selection_position

#### selection_text

#### select_rectangular

#### select

#### skip_displayed_characters

#### skip_lines

#### substitute_null_characters

#### tab_distance

#### text_in_rectangle

#### text_range

#### text

#### unhighlight

#### unselect

#### unsubstitute_null_characters

#### word_end

#### word_start

#### fltk::TextBuffer(int requestedSize = 0);

#### ~TextBuffer();

#### void add_modify_callback(fltk::TextModify_Cb bufModifiedCB, void* cbArg);

#### void append(const char* text);

#### int appendfile(const char *file, int buflen = 128*1024);

#### void call_modify_callbacks();

#### char character(int pos);

#### static int character_width(char c, int indent, int tabDist, char nullSubsChar);

#### void clear_rectangular(int start, int end, int rectStart, int rectEnd);

#### void copy(fltk::TextBuffer* fromBuf, int fromStart, int fromEnd, int toPos);

#### int count_displayed_characters(int lineStartPos, int targetPos);

#### int count_lines(int startPos, int endPos);

#### int expand_character(int pos, int indent, char *outStr);
static int expand_character(char c, int indent, char* outStr, int tabDist, char nullSubsChar);

#### int findchar_backward(int startPos, char searchChar, int* foundPos);

#### int findchar_forward(int startPos, char searchChar, int* foundPos);

#### int findchars_backward(int startPos, const char* searchChars, int* foundPos);

#### int findchars_forward(int startPos, const char* searchChars, int* foundPos);

#### void highlight(int start, int end);

#### int highlight_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd);

#### void highlight_rectangular(int start, int end, int rectStart, int rectEnd);

#### fltk::TextSelection* highlight_selection();

#### const char* highlight_text();

#### void insert_column(int column, int startPos, const char* text, int* charsInserted, int* charsDeleted);

#### int insertfile(const char *file, int pos, int buflen = 128*1024);

#### void insert(int pos, const char* text);

#### int length();

#### int line_end(int pos);

#### int line_start(int pos);

#### const char* line_text(int pos);

#### int loadfile(const char *file, int buflen = 128*1024);

#### char null_substitution_character();

#### int outputfile(const char *file, int start, int end, int buflen = 128*1024);

#### void overlay_rectangular(int startPos, int rectStart, int rectEnd, const char* text, int* charsInserted, int* charsDeleted);

#### fltk::TextSelection* primary_selection();

#### void remove_modify_callback(fltk::TextModify_Cb bufModifiedCB, void* cbArg);

#### void remove_rectangular(int start, int end, int rectStart, int rectEnd);

#### void remove(int start, int end);

#### void remove_secondary_selection();

#### void remove_selection();

#### void replace_rectangular(int start, int end, int rectStart, int rectEnd, const char* text);

#### void replace(int start, int end, const char *text);

#### void replace_secondary_selection(const char* text);

#### void replace_selection(const char* text);

#### int rewind_lines(int startPos, int nLines);

#### int savefile(const char *file, int buflen = 128*1024);

#### int search_backward(int startPos, const char* searchString, int* foundPos, int matchCase = 0);

#### int search_forward(int startPos, const char* searchString, int* foundPos, int matchCase = 0);

#### int secondary_selection_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd);

#### fltk::TextSelection* secondary_selection();

#### const char* secondary_selection_text();

#### void secondary_select_rectangular(int start, int end, int rectStart, int rectEnd);

#### void secondary_select(int start, int end);

#### void secondary_unselect();

#### int selected();

#### int selection_position(int* start, int* end);
int selection_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd);

#### const char* selection_text();

#### void select_rectangular(int start, int end, int rectStart, int rectEnd);

#### void select(int start, int end);

#### int skip_displayed_characters(int lineStartPos, int nChars);

#### int skip_lines(int startPos, int nLines);

#### int substitute_null_characters(char* string, int length);

#### int tab_distance();
void tab_distance(int tabDist);

#### const char* text_in_rectangle(int start, int end, int rectStart, int rectEnd);

#### const char* text_range(int start, int end);

#### const char* text();
void text(const char* text);

#### void unhighlight();

#### void unselect();

#### void unsubstitute_null_characters(char* string);

#### int word_end(int pos);

#### int word_start(int pos);