C# Class GitSharp.Core.Diff.DiffFormatter

Format an EditList as a Git style unified patch script.
ファイルを表示 Open project: jagregory/GitSharp Class Usage Examples

Public Methods

Method Description
DiffFormatter ( ) : System

Create a new formatter with a default level of context.

format ( Stream @out, FileHeader head, RawText a, RawText b ) : void

Format a patch script, reusing a previously parsed FileHeader. This formatter is primarily useful for editing an existing patch script to increase or reduce the number of lines of context within the script. All header lines are reused as-is from the supplied FileHeader.

setContext ( int lineCount ) : void

Change the number of lines of context to display.

Private Methods

Method Description
CombineA ( IList e, int i ) : bool
CombineB ( IList e, int i ) : bool
End ( Edit edit, int a, int b ) : bool
FindCombinedEnd ( IList edits, int i ) : int
FormatEdits ( Stream @out, RawText a, RawText b, EditList edits ) : void
WriteHunkHeader ( Stream @out, int aCur, int aEnd, int bCur, int bEnd ) : void
WriteInteger ( Stream @out, int count ) : void
WriteLine ( Stream @out, char prefix, RawText text, int cur ) : void
WriteRange ( Stream @out, char prefix, int begin, int cnt ) : void

Method Details

DiffFormatter() public method

Create a new formatter with a default level of context.
public DiffFormatter ( ) : System
return System

format() public method

Format a patch script, reusing a previously parsed FileHeader. This formatter is primarily useful for editing an existing patch script to increase or reduce the number of lines of context within the script. All header lines are reused as-is from the supplied FileHeader.
public format ( Stream @out, FileHeader head, RawText a, RawText b ) : void
@out Stream
head GitSharp.Core.Patch.FileHeader existing file header containing the header lines to copy.
a RawText /// Text source for the pre-image version of the content. /// This must match the content of . ///
b RawText writing to the supplied stream failed.
return void

setContext() public method

Change the number of lines of context to display.
public setContext ( int lineCount ) : void
lineCount int /// Number of lines of context to see before the first /// modification and After the last modification within a hunk of /// the modified file. ///
return void