This commit is contained in:
Alexander Zhirov 2025-08-31 18:42:22 +03:00
commit 5fe468a947
Signed by: alexander
GPG key ID: C8D8BE544A27C511
10 changed files with 730 additions and 0 deletions

39
README.md Normal file
View file

@ -0,0 +1,39 @@
# libxdiff
A D wrapper around the C **libxdiff**: thin bindings ([xdiff.d](https://git.zhirov.kz/dlang/xdiff)) + a small OO layer (`MMFile`, `MMBlocks`) for diff/patch/merge with clear ownership.
## Features
* **MMFile** — compact in-memory file (single buffer).
* **MMBlocks** — native libxdiff block chain with compaction.
* `computePatch`, `applyPatch` (returns accepted + rejected parts).
* `merge3Raw` (three-way merge) with `nothrow` callbacks.
* Deep copies where needed, explicit move of ownership, no double-free traps.
## Installation
Add to `dub.json`:
```json
{
"dependencies": {
"libxdiff": "~>0.1.0"
}
}
```
Or to `dub.sdl`:
```
dependency "libxdiff" version="~>0.1.0"
```
Run `dub build`.
## Usage
Import the module: `import libxdiff;`
## License
Boost Software License 1.0. See [LICENSE](LICENSE).