wex
v21.04.0
|
Offers an address class to be used by vi address ranges. More...
#include <wex/address.h>
Public Member Functions | |
address (ex *ex, int line) | |
Constructor for an address from a line. More... | |
address (ex *ex, const std::string &address=std::string()) | |
Constructor for an address. More... | |
bool | adjust_window (const std::string &text) const |
Prints this address, with context. | |
bool | append (const std::string &text) const |
Appends text to this address. | |
bool | flags_supported (const std::string &flags) const |
Returns false if flags are unsupported. | |
int | get_line () const |
If the line number was set using set_line, it returns this line number, otherwise converts the address to a line number. More... | |
bool | insert (const std::string &text) const |
Inserts text at this address. | |
bool | marker_add (char marker) const |
Marks this address. | |
bool | marker_delete () const |
Deletes marker (if this address concerns a marker). | |
bool | parse (const std::string &command, const std::string &text=std::string()) const |
Parse this address based on command, and text. More... | |
bool | put (char name='0') const |
Append text from the specified register at this address, default uses yank register. | |
bool | read (const std::string &arg) const |
Read file at this address. | |
const std::string | regex_commands () const |
Supported 1addr commands. | |
bool | write_line_number () const |
Shows this address in the ex bar. | |
Offers an address class to be used by vi address ranges.
wex::address::address | ( | ex * | ex, |
int | line | ||
) |
Constructor for an address from a line.
ex | the ex (or vi) component |
line | the address |
wex::address::address | ( | ex * | ex, |
const std::string & | address = std::string() |
||
) |
Constructor for an address.
ex | the ex (or vi) component |
address | the address, being a string containing:
|
int wex::address::get_line | ( | ) | const |
If the line number was set using set_line, it returns this line number, otherwise converts the address to a line number.
This is the vi line number, so subtract 1 for stc line number. Returns 0 on error in address.
bool wex::address::parse | ( | const std::string & | command, |
const std::string & | text = std::string() |
||
) | const |
Parse this address based on command, and text.
Returns true if command is valid.
command | mostly a one letter string like "z" for adjust_window |
text | text, as required by command |