|
wex v26.04.0
|
Offers a class that parses a unified diff string and report diffs for a derived class. More...
#include <wex/factory/unified-diff.h>

Public Types | |
| enum class | diff_t { FIRST , OTHER , LAST , UNKNOWN } |
| Type for this diff. More... | |
Public Member Functions | |
| unified_diff (std::string input=std::string()) | |
| Constructor. | |
| virtual | ~unified_diff ()=default |
| Destructor. | |
| virtual bool | report_diff () |
| Virtual interface. | |
| virtual void | report_diff_finish () |
| The last diff has been generated, we are finished. | |
| 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 path & | path_from () const |
| Returns path from. | |
| const path & | path_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. | |
Offers a class that parses a unified diff string and report diffs for a derived class.
Context is not expected, you have to create a diff using -U0 (no context).
|
strong |
| wex::factory::unified_diff::unified_diff | ( | std::string | input = std::string() | ) |
Constructor.
| input | Provide input, that is conform unified diff format output. |
| bool wex::factory::unified_diff::parse | ( | ) |
Parses the input.
This routine invokes report_diff methods. Returns false on error during parsing.
|
inlinevirtual |
Virtual interface.
Do something with a diff.