wex
v21.04.0
|
Offers a command to be used by ex command. More...
#include <wex/ex-command.h>
Public Types | |
enum class | type_t { CALC , COMMAND , EXEC , FIND , FIND_MARGIN , NONE , REPLACE , 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. | |
void | erase (size_t pos, size_t len=1) |
Erases element(s) at position from command text. | |
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 | handle (const wxTextEntry *te, int keycode) |
Handles keycode from textntry component. | |
void | insert (size_t pos, char c) |
Inserts char at pos. | |
void | insert (size_t pos, const std::string &s) |
Inserts string at pos. | |
void | no_type () |
Sets to no type. | |
void | pop_back () |
Removes last char of command text. | |
ex_command & | reset (const std::string &text=std::string(), bool full=false) |
Resets command to text (but keeps type). | |
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. | |
std::string | str () const |
Returns string type 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.