wex
v20.04.0
|
Offers a command to be used by ex command. More...
#include <wex/ex-command.h>
Public Types | |
enum | type_t { type_t::CALC, type_t::COMMAND, type_t::EXEC, type_t::FIND, type_t::FIND_MARGIN, type_t::NONE, type_t::REPLACE, type_t::VI } |
The type of ex command. More... | |
Public Member Functions | |
ex_command () | |
Default constructor. | |
ex_command (stc *stc) | |
Constructor, sets stc component. | |
ex_command (const std::string &text) | |
Constructor, sets command text. | |
ex_command (const ex_command &c) | |
Copy constructor. | |
ex_command & | operator= (const ex_command &c) |
Assignment operator. | |
ex_command & | append (char c) |
Appends a char. | |
ex_command & | append (const std::string &s) |
Appends a string. | |
bool | append_exec (char c) |
Appends a char and tries to execute. | |
auto | back () const |
Returns last char of command. | |
void | clear () |
Clears command text. | |
const auto & | command () const |
Returns the command text. | |
auto | empty () const |
Returns true if command text is empty. | |
bool | exec () const |
Executes the command on the stc component if available. | |
auto | front () const |
Returns front of command text. | |
auto * | get_stc () const |
Returns stc component. | |
void | pop_back () |
Removes last char of command text. | |
void | restore (const ex_command &c) |
Restores values, if possible from original stc. | |
ex_command & | set (const std::string &text) |
Sets command text. More... | |
void | set (const ex_command &c) |
Sets new command, except original stc. More... | |
auto | size () const |
Returns size of command. | |
type_t | type () const |
Returns type of command. | |
Offers a command to be used by ex command.
|
strong |
void wex::ex_command::set | ( | const ex_command & | c | ) |
Sets new command, except original stc.
This can be used in combination with restore.
ex_command& wex::ex_command::set | ( | const std::string & | text | ) |
Sets command text.
The text should start with a command prefix, like ':' to return the command type.