Skip to content

ThomasHambach/csharpdiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage

CSharpDiff

C# Diff with Unified Diff Support, this codebase is a port from the popular JS library jsdiff by kpdecker.

Warning

The only functionality implemented at this time is the unified diff. Everything is guaranteed to be a bit buggy.

Usage Example

Diff

Sentence

using CSharpDiff.Diff;

var text1 = "Here im. Rock you like old man.";
var text2 = "Here im. Rock you like hurricane.";

var diff = new DiffSentence();
var difference = diff.diff(text1, text2);

Patch

Create

using CSharpDiff.Patch;

var text1 = "...";
var text2 = "...";

var ps = new Patch();
string patch = ps.create("filename1", "filename2", text1, text2, "header1", "header2", new PatchServiceOptions());

Works Well With

Todo

  • Clean-up code (Code smells and bugs according to Sonar)
  • Patch
    • Create
    • Apply
    • Merge
    • Parse
  • Diff
    • Array (difficult, JS allows type mixing)
    • Base
    • Character
    • CSS
    • JSON
    • Line
    • Sentence
    • Word
  • Convert
    • XML
    • DMP

Contributing

Idk, just make a pull request.

Releases

No releases published

Packages

No packages published

Languages