wex v26.04.0
wex::unified_diff Class Reference

Offers a class that implements unified_diff report_diff for a vcs entry. More...

#include <wex/vcs/unified-diff.h>

Inheritance diagram for wex::unified_diff:
Inheritance graph

Public Member Functions

 unified_diff (const path &p, const vcs_entry *entry, factory::frame *f)
 Constructor.
const pathpath_vcs () const
 Returns path (from vcs).
Public Member Functions inherited from wex::factory::unified_diff
 unified_diff (std::string input=std::string())
 Constructor.
virtual ~unified_diff ()=default
 Destructor.
size_t differences () const
 Returns number of differences found during parsing.
const std::string & input () const
 Returns input.
bool is_first () const
 Returns true if this is the first diff of a hunk.
bool is_last () const
 Returns true if this is the last diff of a hunk.
bool parse ()
 Parses the input.
const pathpath_from () const
 Returns path from.
const pathpath_to () const
 Returns path to.
int range_from_start () const
 Returns start number for the from file.
int range_from_count () const
 Returns count number for the from file.
int range_to_start () const
 Returns start number for the to file.
int range_to_count () const
 Returns count number for the to file.
const std::vector< std::string > & text_added () const
 Returns text added.
const std::vector< std::string > & text_removed () const
 Returns text removed.
void trace (const std::string &text) const
 Logs this diff as trace logging.
diff_t type () const
 Returns the difference type.
void type_from (const unified_diff &org)
 Copies type from org.

Additional Inherited Members

Public Types inherited from wex::factory::unified_diff
enum class  diff_t { FIRST , OTHER , LAST , UNKNOWN }
 Type for this diff. More...

Detailed Description

Offers a class that implements unified_diff report_diff for a vcs entry.

Constructor & Destructor Documentation

◆ unified_diff()

wex::unified_diff::unified_diff ( const path & p,
const vcs_entry * entry,
factory::frame * f )

Constructor.

Parameters
pThe path (under vcs).
entryProvide vcs entry to use the process std out as input.
fProvide frame, that will receive the unified diff callbacks.