mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibDiff: Add Diff::apply_patch
Given a set of lines from the file we are patching, and a patch itself, this function will try and locate where in the file to apply that patch, and write the result of patching that file (if successful) to the output stream.
This commit is contained in:
parent
efb26b1781
commit
828d791a4f
5 changed files with 176 additions and 0 deletions
|
@ -71,6 +71,11 @@ struct Header {
|
|||
String new_file_path;
|
||||
};
|
||||
|
||||
struct Patch {
|
||||
Header header;
|
||||
Vector<Hunk> hunks;
|
||||
};
|
||||
|
||||
class Parser : public GenericLexer {
|
||||
public:
|
||||
using GenericLexer::GenericLexer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue