C# Класс GitSharp.Core.Patch.FileHeader

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
NEW_NAME byte[]
OLD_NAME byte[]

Защищенные свойства (Protected)

Свойство Тип Описание
DeletedFileMode byte[]
Index byte[]
NewFileMode byte[]

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

Метод Описание
FileHeader ( byte b, int offset ) : System
GetOldMode ( ) : FileMode

The old file mode, if described in the patch

ToEditList ( ) : EditList

Returns a list describing the content edits performed on this file.

addHunk ( GitSharp.Core.Patch.HunkHeader h ) : void
getChangeType ( ) : ChangeTypeEnum

The type of change this patch makes on NewName

getForwardBinaryHunk ( ) : BinaryHunk

If a PatchTypeEnum.GIT_BINARY, the new-image delta/literal

getNewId ( ) : AbbreviatedObjectId

Get the new object id from the index.

getOldId ( ) : AbbreviatedObjectId

Get the old object id from the index.

getPatchType ( ) : PatchTypeEnum

Style of patch used to modify this file

getReverseBinaryHunk ( ) : BinaryHunk

If a PatchTypeEnum.GIT_BINARY, the old-image delta/literal

getScore ( ) : int

Returns similarity score between OldName and NewName if getChangeType() is ChangeTypeEnum.COPY or ChangeTypeEnum.RENAME.

getScriptText ( ) : string

Convert the patch script for this file into a string. The default character encoding Constants.CHARSET is assumed for both the old and new files.

getScriptText ( Encoding charsetGuess ) : string

Convert the patch script for this file into a string.

getScriptText ( Encoding oldCharset, Encoding newCharset ) : string

Convert the patch script for this file into a string.

hasMetaDataChanges ( ) : bool

True if this patch modifies metadata about a file

isHunkHdr ( byte buf, int start, int end ) : int

Determine if this is a patch hunk header.

newHunkHeader ( int offset ) : GitSharp.Core.Patch.HunkHeader
parseGitFileName ( int ptr, int end ) : int

Parse a "diff --git" or "diff --cc" line.

parseGitHeaders ( int ptr, int end ) : int
parseTraditionalHeaders ( int ptr, int end ) : int

Защищенные методы

Метод Описание
ParseFileMode ( int ptr, int end ) : FileMode
ParseIndexLine ( int ptr, int end ) : void
ParseNewFileMode ( int ptr, int eol ) : void
ParseNewName ( int ptr, int eol ) : void
ParseOldName ( int ptr, int eol ) : void

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

Метод Описание
Eq ( int aPtr, int aEnd, int bPtr, int bEnd ) : bool
ExtractFileLines ( Encoding csGuess ) : string[]
P1 ( string r ) : string
ParseName ( String expect, int ptr, int end ) : string
TrySimpleConversion ( Encoding charsetGuess ) : bool

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

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

public FileHeader ( byte b, int offset ) : System
b byte
offset int
Результат System

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

The old file mode, if described in the patch
public GetOldMode ( ) : FileMode
Результат FileMode

ParseFileMode() защищенный Метод

protected ParseFileMode ( int ptr, int end ) : FileMode
ptr int
end int
Результат FileMode

ParseIndexLine() защищенный Метод

protected ParseIndexLine ( int ptr, int end ) : void
ptr int
end int
Результат void

ParseNewFileMode() защищенный Метод

protected ParseNewFileMode ( int ptr, int eol ) : void
ptr int
eol int
Результат void

ParseNewName() защищенный Метод

protected ParseNewName ( int ptr, int eol ) : void
ptr int
eol int
Результат void

ParseOldName() защищенный Метод

protected ParseOldName ( int ptr, int eol ) : void
ptr int
eol int
Результат void

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

Returns a list describing the content edits performed on this file.
public ToEditList ( ) : EditList
Результат EditList

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

public addHunk ( GitSharp.Core.Patch.HunkHeader h ) : void
h GitSharp.Core.Patch.HunkHeader
Результат void

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

The type of change this patch makes on NewName
public getChangeType ( ) : ChangeTypeEnum
Результат ChangeTypeEnum

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

If a PatchTypeEnum.GIT_BINARY, the new-image delta/literal
public getForwardBinaryHunk ( ) : BinaryHunk
Результат BinaryHunk

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

Get the new object id from the index.
public getNewId ( ) : AbbreviatedObjectId
Результат AbbreviatedObjectId

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

Get the old object id from the index.
public getOldId ( ) : AbbreviatedObjectId
Результат AbbreviatedObjectId

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

Style of patch used to modify this file
public getPatchType ( ) : PatchTypeEnum
Результат PatchTypeEnum

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

If a PatchTypeEnum.GIT_BINARY, the old-image delta/literal
public getReverseBinaryHunk ( ) : BinaryHunk
Результат BinaryHunk

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

Returns similarity score between OldName and NewName if getChangeType() is ChangeTypeEnum.COPY or ChangeTypeEnum.RENAME.
public getScore ( ) : int
Результат int

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

Convert the patch script for this file into a string. The default character encoding Constants.CHARSET is assumed for both the old and new files.
public getScriptText ( ) : string
Результат string

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

Convert the patch script for this file into a string.
public getScriptText ( Encoding charsetGuess ) : string
charsetGuess System.Text.Encoding /// optional array to suggest the character set to use when /// decoding each file's line. If supplied the array must have a /// length of + 1 /// representing the old revision character sets and the new /// revision character set. ///
Результат string

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

Convert the patch script for this file into a string.
public getScriptText ( Encoding oldCharset, Encoding newCharset ) : string
oldCharset System.Text.Encoding hint character set to decode the old lines with.
newCharset System.Text.Encoding hint character set to decode the new lines with.
Результат string

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

True if this patch modifies metadata about a file
public hasMetaDataChanges ( ) : bool
Результат bool

isHunkHdr() публичный статический Метод

Determine if this is a patch hunk header.
public static isHunkHdr ( byte buf, int start, int end ) : int
buf byte the buffer to scan
start int first position in the buffer to evaluate
end int /// last position to consider; usually the end of the buffer /// (buf.length) or the first position on the next /// line. This is only used to avoid very long runs of '@' from /// killing the scan loop. ///
Результат int

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

public newHunkHeader ( int offset ) : GitSharp.Core.Patch.HunkHeader
offset int
Результат GitSharp.Core.Patch.HunkHeader

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

Parse a "diff --git" or "diff --cc" line.
public parseGitFileName ( int ptr, int end ) : int
ptr int /// first character After the "diff --git " or "diff --cc " part. ///
end int /// one past the last position to parse. ///
Результат int

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

public parseGitHeaders ( int ptr, int end ) : int
ptr int
end int
Результат int

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

public parseTraditionalHeaders ( int ptr, int end ) : int
ptr int
end int
Результат int

Описание свойств

DeletedFileMode защищенное статическое свойство

protected static byte[] DeletedFileMode
Результат byte[]

Index защищенное статическое свойство

protected static byte[] Index
Результат byte[]

NEW_NAME публичное статическое свойство

public static byte[] NEW_NAME
Результат byte[]

NewFileMode защищенное статическое свойство

protected static byte[] NewFileMode
Результат byte[]

OLD_NAME публичное статическое свойство

public static byte[] OLD_NAME
Результат byte[]