docs: update docs for bindings and api

This commit is contained in:
Aleksey Kulikov 2022-04-28 16:04:30 +03:00
parent a3213a88a2
commit 9d61584165
52 changed files with 352 additions and 209 deletions

View file

@ -9,6 +9,12 @@ import 'package:libgit2dart/src/util.dart';
class Patch {
/// Initializes a new instance of [Patch] class from provided
/// pointer to patch object in memory and pointers to old and new blobs/buffers.
///
/// Note: For internal use. Instead, use one of:
/// - [Patch.fromBlobs]
/// - [Patch.fromBlobAndBuffer]
/// - [Patch.fromBuffers]
/// - [Patch.fromDiff]
Patch(this._patchPointer) {
_finalizer.attach(this, _patchPointer, detach: this);
}
@ -151,6 +157,8 @@ class Patch {
late final Pointer<git_patch> _patchPointer;
/// Line counts of each type in a patch.
///
/// This helps imitate a `diff --numstat` type of output.
PatchStats get stats {
final result = bindings.lineStats(_patchPointer);