|
Gin
|
Binary diff/patch utilities using the bsdiff algorithm. More...
Classes | |
| struct | Patch |
| A compact text patch storing only the differences between two texts. More... | |
Functions | |
| std::vector< uint8_t > | bsDiff (const juce::String &s1, const juce::String &s2) |
| Creates a binary patch that transforms s1 into s2. | |
| juce::String | bsApplyPatch (const juce::String &s, const std::vector< uint8_t > &patch) |
| Applies a binary patch to a string. | |
| Patch | createPatch (const juce::String &oldText, const juce::String &newText) |
| Creates a compact patch that can transform newText back into oldText. | |
| juce::String | applyPatch (const juce::String &newText, const Patch &patch) |
| Applies a patch to transform text back to its original form. | |
Binary diff/patch utilities using the bsdiff algorithm.
These functions provide efficient binary differencing and patching for strings. The bsdiff algorithm creates compact patches by finding matching sequences between the old and new data.
Creates a binary patch that transforms s1 into s2.
Uses the bsdiff algorithm to generate a compact binary patch representing the differences between two strings. The resulting patch can be applied to s1 using bsApplyPatch() to recreate s2.
| s1 | The original string |
| s2 | The target string |
Creates a compact patch that can transform newText back into oldText.
Uses the Myers diff algorithm to find the minimal differences. Only stores the changes (inserts/removes), not unchanged lines.
| oldText | The original text |
| newText | The modified text |
Applies a patch to transform text back to its original form.
| newText | The modified text |
| patch | The patch created by createPatch() |