wex
v21.10.0
|
Uses a stream for ex mode processing. More...
#include <wex/ex-stream.h>
Public Member Functions | |
ex_stream (wex::ex *ex) | |
Constructor. | |
~ex_stream () override | |
Destructor. | |
bool | erase (const addressrange &range) |
Deletes the range. | |
size_t | get_context_lines () const |
Returns context lines. | |
bool | insert_text (const address &address, const std::string &text, loc_t loc=INSERT_BEFORE) |
Inserts text at specified address. | |
bool | is_block_mode () const |
Returns true if we are in block mode. More... | |
bool | is_modified () const |
Returns true if stream is modified;. | |
bool | join (const addressrange &range) |
Joins all lines in the range. | |
bool | marker_add (char marker, int line) |
Sets marker. | |
bool | marker_delete (char marker) |
Deletes marker. | |
int | marker_line (char marker) const |
Returns line for marker. More... | |
void | stream (file &f) |
Sets the streams. More... | |
bool | substitute (const addressrange &range, const data::substitute &data) |
Substitutes within the range find by replace. | |
bool | write () |
Writes working stream to file. | |
bool | write (const addressrange &range, const std::string &file, bool append=false) |
Writes range to file. | |
bool | yank (const addressrange &range, char name='0') |
Yanks range to register, default to yank register. | |
bool | find (const std::string &text, int find_flags=-1, bool find_next=true) override |
Virtual methods from text_window. | |
int | get_current_line () const override |
Returns current line no. | |
int | get_line_count () const override |
Returns number of lines. | |
int | get_line_count_request () override |
Request for number of lines. | |
void | goto_line (int no) override |
Goes to specified line. | |
![]() | |
virtual | ~text_window ()=default |
Destructor. | |
Uses a stream for ex mode processing.
Line numbers are stc line numbers, so start at line 0. All modifications are done in the temp file, and copied to the work file upon changing. If you ask for a write, the work file is copied to the original file.
|
inline |
Returns true if we are in block mode.
Block mode implies that no eols were found when reading lines with max size.
int wex::ex_stream::marker_line | ( | char | marker | ) | const |
Returns line for marker.
Returns LINE_NUMBER_UNKNOWN if marker not known.
void wex::ex_stream::stream | ( | file & | f | ) |
Sets the streams.
Puts first line on stc. This must be called before the other methods.