wex
v21.10.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 |
Virtual interface. | |
![]() | |
process () | |
Other methods. More... | |
~process () override | |
Destructor. | |
process (const process &process) | |
Copy constructor. | |
process & | operator= (const process &p) |
Assignment operator. | |
auto * | get_frame () |
Returns the frame. | |
bool | async_system (const std::string &exe=std::string(), const std::string &start_dir=std::string()) override |
Override methods. More... | |
bool | write (const std::string &text) override |
Writes text to stdin of process. More... | |
![]() | |
process () | |
Default constructor. | |
const auto & | get_exe () const |
Other methods. More... | |
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 |
Is this process running. | |
void | set_handler_dbg (wxEvtHandler *eh) |
Sets debug event handler. | |
void | set_handler_out (wxEvtHandler *eh) |
Sets out event handler. | |
int | system (const std::string &exe, const std::string &start_dir=std::string()) |
Runs the sync process, collecting output in stdout and stderr. 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 | |
![]() | |
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 |