C# Класс 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".
Наследование: Sequence
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

RawText() публичный Метод

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. ///
Результат System.IO

equals() публичный Метод

public equals ( int thisIdx, Sequence other, int otherIdx ) : bool
thisIdx int
other Sequence
otherIdx int
Результат bool

isMissingNewlineAtEnd() публичный Метод

Determine if the file ends with a LF ('\n').
public isMissingNewlineAtEnd ( ) : bool
Результат bool

size() публичный Метод

public size ( ) : int
Результат int

writeLine() публичный Метод

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.
Результат void