wex
v21.04.0
|
This class collects a single vcs. More...
#include <wex/vcs-entry.h>
Public Member Functions | |
vcs_entry (const pugi::xml_node &node=pugi::xml_node()) | |
Default constructor using xml node. | |
const auto & | admin_dir () const |
Returns the administrative directory. | |
size_t | build_menu (int base_id, menu *menu) const |
Builds a menu from all vcs commands. More... | |
bool | execute (const std::string &args=std::string(), const lexer &lexer=wex::lexer(), const std::string &wd=std::string()) |
Executes the current vcs command (from SetCommand), or the first command if SetCommand was not yet invoked. More... | |
bool | execute (const std::string &command, const std::string &wd) |
Executes the command. More... | |
auto | flags_location () const |
Returns flags location. | |
const blame & | get_blame () const |
Returns blame info. | |
const std::string | get_branch (const std::string &wd=std::string()) const |
Returns the name of current branch. | |
const std::string | get_flags () const |
Returns the flags used to run the command. | |
bool | log (const path &p, const std::string &id) |
Executes the log command using the log id to be retrieved. More... | |
void | show_output (const std::string &caption=std::string()) const override |
Shows stdout or stderr from execute on the shell component. More... | |
![]() | |
process () | |
Other methods. More... | |
virtual | ~process () |
Destructor. | |
process (const process &process) | |
Copy constructor. | |
process & | operator= (const process &p) |
Assignment operator. | |
bool | execute (const std::string &command=std::string(), exec_t type=EXEC_NO_WAIT, const std::string &wd=std::string()) |
Executes the process. More... | |
const auto & | get_exec () const |
Returns command. | |
auto * | get_frame () |
Returns the frame. | |
const auto & | get_stderr () const |
Returns the stderr. | |
const auto & | get_stdout () const |
Returns the stdout. | |
bool | is_debug () const |
Is this a debug process. | |
bool | is_running () const |
Returns true if this process is running. | |
bool | stop () |
Stops this process. More... | |
bool | write (const std::string &text) |
Writes text to stdin of process. More... | |
![]() | |
menu_commands (const std::string &name=std::string(), const std::vector< vcs_command > &commands={}) | |
Default constructor. | |
menu_commands (const pugi::xml_node &node) | |
Constructor using xml node. | |
const vcs_command | find (const std::string &name) const |
Returns the menu command equal to name specified. More... | |
const auto & | flags_key () const |
Returns the flags key. | |
const auto | get_command () const |
Returns the current command. | |
const auto & | get_commands () const |
Returns all the commands. | |
const auto & | name () const |
Returns the name for this group of commands. | |
bool | set_command (int command_no) |
Sets the current command. More... | |
Additional Inherited Members | |
![]() | |
enum | exec_t { EXEC_NO_WAIT , EXEC_WAIT } |
process execute type More... | |
![]() | |
static int | config_dialog (const data::window &data=data::window()) |
Static interface. More... | |
static auto * | get_shell () |
Returns the shell component (might be nullptr if prepare_output is not yet invoked). | |
static shell * | prepare_output (wxWindow *parent) |
Construct the shell component, and returns it. | |
This class collects a single vcs.
size_t wex::vcs_entry::build_menu | ( | int | base_id, |
menu * | menu | ||
) | const |
Builds a menu from all vcs commands.
Returns (total) number of items in menu.
base_id | menu id to be added to the vcs commands |
menu | menu to be built |
bool wex::vcs_entry::execute | ( | const std::string & | args = std::string() , |
const lexer & | lexer = wex::lexer() , |
||
const std::string & | wd = std::string() |
||
) |
Executes the current vcs command (from SetCommand), or the first command if SetCommand was not yet invoked.
Might ask for vcs binary if it is not yet known. Return code is code from process Execute, and also can be false if dialog for vcs bin was cancelled.
args | args, like filenames, or vcs flags |
lexer | lexer that is used for presenting the output |
wd | working directory |
bool wex::vcs_entry::execute | ( | const std::string & | command, |
const std::string & | wd | ||
) |
Executes the command.
Return value is false if process could not execute.
command | command to be executed |
wd | working dir |
bool wex::vcs_entry::log | ( | const path & | p, |
const std::string & | id | ||
) |
Executes the log command using the log id to be retrieved.
Return value is false if process could not execute.
p | path to be used |
id | id to be retrieved |
|
overridevirtual |
Shows stdout or stderr from execute on the shell component.
You can override this method to e.g. prepare a lexer on get_shell before calling this base method.
Reimplemented from wex::process.