C# Class GitSharp.Core.Diff.RawText

A sequence supporting UNIX formatted text in byte[] format. Elements of the sequence are the lines of the file, as delimited by the UNIX newline character ('\n'). The file content is treated as 8 bit binary text, with no assumptions or requirements on character encoding. Note that the first line of the file is element 0, as defined by the Sequence interface API. Traditionally in a text editor a patch file the first line is line number 1. Callers may need to subtract 1 prior to invoking methods if they are converting from "line number" to "element index".
Inheritance: Sequence
Mostrar archivo Open project: stschake/GitSharp Class Usage Examples

Public Methods

Method Description
RawText ( byte input ) : System.IO

Create a new sequence from an existing content byte array. The entire array (indexes 0 through length-1) is used as the content.

equals ( int thisIdx, Sequence other, int otherIdx ) : bool
isMissingNewlineAtEnd ( ) : bool

Determine if the file ends with a LF ('\n').

size ( ) : int
writeLine ( Stream @out, int i ) : void

Write a specific line to the output stream, without its trailing LF. The specified line is copied as-is, with no character encoding translation performed. If the specified line ends with an LF ('\n'), the LF is not copied. It is up to the caller to write the LF, if desired, between output lines.

Private Methods

Method Description
HashLine ( byte raw, int ptr, int end ) : int

Compute a hash code for a single line.

computeHashes ( ) : IntList
equals ( RawText a, int ai, RawText b, int bi ) : bool

Method Details

RawText() public method

Create a new sequence from an existing content byte array. The entire array (indexes 0 through length-1) is used as the content.
public RawText ( byte input ) : System.IO
input byte /// the content array. The array is never modified, so passing /// through cached arrays is safe. ///
return System.IO

equals() public method

public equals ( int thisIdx, Sequence other, int otherIdx ) : bool
thisIdx int
other Sequence
otherIdx int
return bool

isMissingNewlineAtEnd() public method

Determine if the file ends with a LF ('\n').
public isMissingNewlineAtEnd ( ) : bool
return bool

size() public method

public size ( ) : int
return int

writeLine() public method

Write a specific line to the output stream, without its trailing LF. The specified line is copied as-is, with no character encoding translation performed. If the specified line ends with an LF ('\n'), the LF is not copied. It is up to the caller to write the LF, if desired, between output lines.
/// the stream write operation failed. ///
public writeLine ( Stream @out, int i ) : void
@out System.IO.Stream
i int /// Index of the line to extract. Note this is 0-based, so line /// number 1 is actually index 0.
return void