Offers an address class to be used by vi address ranges.
More...
#include <wex/ex/address.h>
|
| address ()=default |
| Default constructor.
|
|
| address (ex *ex, const std::string &address=std::string()) |
| Constructor for an address from a line string.
|
|
| address (ex *ex, int line) |
| Constructor for an address from a line number.
|
|
int | get_line (int start_pos=-1) const |
| Converts the address to a line number.
|
|
bool | marker_add (char marker) const |
| Marks this address.
|
|
bool | marker_delete () const |
| Deletes marker (if this address concerns a marker).
|
|
bool | parse (const command_parser &cp) |
| Parses this address based on command parser.
|
|
const std::string | regex_commands () const |
| Supported 1addr commands.
|
|
address_t | type () const |
| Return type of address.
|
|
|
static bool | flags_supported (const std::string &flags) |
| Returns true if flags are supported (for adjust window, and addressrange print).
|
|
Offers an address class to be used by vi address ranges.
◆ address_t
The kind of address this one is.
Enumerator |
---|
IS_BEGIN | part of range, the begin
|
IS_END | part of range, the end
|
IS_SINGLE | not part of range
|
◆ address() [1/2]
wex::address::address |
( |
ex * | ex, |
|
|
const std::string & | address = std::string() ) |
|
explicit |
Constructor for an address from a line string.
- Parameters
-
ex | the ex (or vi) component |
address | the address, being a string containing:
- a normal line number
- a defined marker, like 'x, or '<: begin of selection and '>: end of selection
- $ : last line
- . : current line
- or a combination of these, using + or -
- or empty, call set_line afterwards
|
◆ address() [2/2]
wex::address::address |
( |
ex * | ex, |
|
|
int | line ) |
|
explicit |
Constructor for an address from a line number.
- Parameters
-
ex | the ex (or vi) component |
line | the address |
◆ get_line()
int wex::address::get_line |
( |
int | start_pos = -1 | ) |
const |
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. Default it uses current position to start determine line number, you can specify another pos as well.
◆ parse()
Parses this address based on command parser.
Returns true if command is valid.