wex v24.10.0
|
This class collects a single vcs. More...
#include <wex/vcs/vcs-entry.h>
Public Types | |
enum class | flags_location_t { } |
Flags location flags, indicate where flags from xml should be placed when building vcs commands. More... | |
Public Member Functions | |
vcs_entry (const pugi::xml_node &node=pugi::xml_node()) | |
Default constructor using xml node. | |
int | system (const process_data &data) override |
Executes the command synchronously. | |
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. | |
bool | execute (const std::string &args=std::string(), const lexer &lexer=wex::lexer(), const std::string &wd=std::string()) |
Executes the current vcs command synchronously (from set_command), or the first command if set_command was not yet invoked. | |
auto | flags_location () const |
Returns flags location. | |
const blame & | get_blame () const |
Returns blame info. | |
blame & | get_blame () |
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. | |
std::optional< std::set< wex::path > > | setup_exclude (const path &toplevel, const path &p) |
Sets up the exclude dir. | |
void | show_output (const std::string &caption=std::string()) const override |
Shows stdout or stderr from system on the shell component. | |
Public Member Functions inherited from wex::process | |
process () | |
Default constructor. | |
bool | async_system (const process_data &data) override |
Override methods. | |
bool | write (const std::string &text) override |
Writes text to stdin of process. | |
auto * | get_frame () |
Returns the frame. | |
Public Member Functions inherited from wex::factory::process | |
process () | |
Default constructor. | |
virtual | ~process () |
Destructor, stops running process. | |
void | async_sleep_for (const std::chrono::milliseconds &ms) |
Sleeps for some milliseconds time. | |
const process_data & | data () const |
Returns last or current data used by async_system or system. | |
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. | |
const auto & | std_err () const |
Returns the stderr. | |
const auto & | std_out () const |
Returns the stdout. | |
Public Member Functions inherited from wex::menu_commands< vcs_command > | |
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. | |
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. | |
Additional Inherited Members | |
Static Public Member Functions inherited from wex::process | |
static int | config_dialog (const data::window &data=data::window()) |
Shows a config dialog, allowing you to set the command and folder. | |
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.
|
strong |
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 synchronously (from set_command), or the first command if set_command 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::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 |
std::optional< std::set< wex::path > > wex::vcs_entry::setup_exclude | ( | const path & | toplevel, |
const path & | p ) |
Sets up the exclude dir.
Returns vector with paths to be excluded.
|
overridevirtual |
Shows stdout or stderr from system 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.
|
overridevirtual |
Executes the command synchronously.
You just need to specify the flags, the binary itself is prefixed by wex. Flags available from git menu commands xml are also added. Return value is the process exit code.
Reimplemented from wex::process.