wex v24.10.0
|
Offers a blame class for some vcs. More...
#include <wex/syntax/blame.h>
Public Types | |
enum class | margin_style_t { UNKNOWN , DAY , WEEK , MONTH , YEAR , OTHER } |
Margin text style type. More... | |
Public Member Functions | |
blame (const pugi::xml_node &node=pugi::xml_node()) | |
Default constructor using xml node. | |
const auto & | caption () const |
Returns the suitable blame caption. | |
void | caption (const std::string &text) |
Sets a suitable blame caption. | |
const std::string | info () const |
Returns blame info will contain id, author, date depending on settings in the config. | |
const auto | line_no () const |
Returns line number (starting with line 0). | |
void | line_no (int no) |
Sets line number, to override the one from parsed text. | |
const auto & | line_text () const |
Returns rest of line text (without blame). | |
bool | parse (const path &p, const std::string &line) |
Parses blame text and returns false if there was an error. | |
void | skip_info (bool rhs) |
Sets the skip info member, until next parse. | |
bool | skip_info () const |
Returns current skip info value. | |
bool | use () const |
Returns true if blame is on. | |
margin_style_t | style () const |
Style for blame margin based on commit date. | |
const auto & | vcs_name () const |
Returns vcs name for which this blaming is done. | |
Static Public Member Functions | |
static std::string | margin_renamed (const factory::stc *stc) |
Returns a renamed path present in the stc margin, or empty string if no rename present. | |
Offers a blame class for some vcs.
The vcs used is configured using the xml_node constructor (see wex-menus.xml), the kind of info returned after parse is configurable using blame_get_author, blame_get_id, blame_get_date.
|
strong |
const std::string wex::blame::info | ( | ) | const |
Returns blame info will contain id, author, date depending on settings in the config.
Also adds a renamed path if a changed path is present.
bool wex::blame::parse | ( | const path & | p, |
const std::string & | line ) |
Parses blame text and returns false if there was an error.
p | original path |
line | line to parse |