|
wex
v21.04.0
|
This class collects all vcs handling. More...
#include <wex/vcs.h>
Public Member Functions | |
| vcs (const std::vector< path > &files=std::vector< path >(), int command_no=-1) | |
| Other methods. More... | |
| int | config_dialog (const data::window &data=data::window()) const |
| Shows a dialog allowing you to choose which vcs to use and to set the path for each vcs entry. More... | |
| auto & | entry () |
| Returns the current vcs entry. | |
| const auto & | entry () const |
| Returns the current vcs entry. | |
| bool | execute () |
| Executes the current vcs command for the current vcs entry, and collects the output. More... | |
| bool | execute (const std::string &command) |
| Executes the specified command (git, svn subcommand). More... | |
| const std::string | get_branch () const |
| Returns branch for current vcs entry, or empty string if vcs is not used. | |
| const std::string | name () const |
| Returns name for current vcs entry, or empty string if vcs is not used. | |
| wxStandardID | request (const data::window &data=data::window()) |
| Combines show_dialog, execute and vcs entry show_output in one method. More... | |
| bool | set_entry_from_base (wxWindow *parent=nullptr) |
| Sets the vcs entry using base folder. More... | |
| int | show_dialog (const data::window &data=data::window()) |
| Shows dialog for the current vcs entry. | |
| path | toplevel () const |
| Returns toplevel dir. | |
| bool | use () const |
| Returns true if vcs usage is set in the config. | |
Static Public Member Functions | |
| static bool | dir_exists (const path &filename) |
| Static interface. More... | |
| static bool | load_document () |
| Loads all entries (first clears them) from vcs document. More... | |
| static auto | size () |
| Returns the number of vcs entries. | |
This class collects all vcs handling.
The VCS entries are loaded from menus.xml, this is done during app startup.
Other methods.
Default constructor.
| files | Specify several files for which you want vcs action. Sets the vcs entry for first of the specified files, or to the base folder if vector is empty. |
| command_no | The command no that is used to set the current vcs command (index in vcs entry commands). |
| int wex::vcs::config_dialog | ( | const data::window & | data = data::window() | ) | const |
Shows a dialog allowing you to choose which vcs to use and to set the path for each vcs entry.
Returns dialog return code.
|
static |
Static interface.
Returns true if specified filename (a path) is a vcs directory.
| bool wex::vcs::execute | ( | ) |
Executes the current vcs command for the current vcs entry, and collects the output.
Returns return code from vcs entry execute.
| bool wex::vcs::execute | ( | const std::string & | command | ) |
Executes the specified command (git, svn subcommand).
Return value is false if process could not execute.
|
static |
Loads all entries (first clears them) from vcs document.
Returns true if document is loaded.
| wxStandardID wex::vcs::request | ( | const data::window & | data = data::window() | ) |
Combines show_dialog, execute and vcs entry show_output in one method.
| bool wex::vcs::set_entry_from_base | ( | wxWindow * | parent = nullptr | ) |
Sets the vcs entry using base folder.
If not, it will show a dialog for selecting a vcs folder (if parent is not nullptr). Returns true if entry is under vcs control.
| parent | Parent window for showing dir dialog if there is not a current directory. |