C# Class GitSharp.Core.Patch.FileHeader

Mostrar archivo Open project: jagregory/GitSharp Class Usage Examples

Public Properties

Property Type Description
NEW_NAME byte[]
OLD_NAME byte[]

Protected Properties

Property Type Description
DeletedFileMode byte[]
Index byte[]
NewFileMode byte[]

Public Methods

Method Description
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

Protected Methods

Method Description
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

Private Methods

Method Description
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

Method Details

FileHeader() public method

public FileHeader ( byte b, int offset ) : System
b byte
offset int
return System

GetOldMode() public method

The old file mode, if described in the patch
public GetOldMode ( ) : FileMode
return FileMode

ParseFileMode() protected method

protected ParseFileMode ( int ptr, int end ) : FileMode
ptr int
end int
return FileMode

ParseIndexLine() protected method

protected ParseIndexLine ( int ptr, int end ) : void
ptr int
end int
return void

ParseNewFileMode() protected method

protected ParseNewFileMode ( int ptr, int eol ) : void
ptr int
eol int
return void

ParseNewName() protected method

protected ParseNewName ( int ptr, int eol ) : void
ptr int
eol int
return void

ParseOldName() protected method

protected ParseOldName ( int ptr, int eol ) : void
ptr int
eol int
return void

ToEditList() public method

Returns a list describing the content edits performed on this file.
public ToEditList ( ) : EditList
return EditList

addHunk() public method

public addHunk ( GitSharp.Core.Patch.HunkHeader h ) : void
h GitSharp.Core.Patch.HunkHeader
return void

getChangeType() public method

The type of change this patch makes on NewName
public getChangeType ( ) : ChangeTypeEnum
return ChangeTypeEnum

getForwardBinaryHunk() public method

If a PatchTypeEnum.GIT_BINARY, the new-image delta/literal
public getForwardBinaryHunk ( ) : BinaryHunk
return BinaryHunk

getNewId() public method

Get the new object id from the index.
public getNewId ( ) : AbbreviatedObjectId
return AbbreviatedObjectId

getOldId() public method

Get the old object id from the index.
public getOldId ( ) : AbbreviatedObjectId
return AbbreviatedObjectId

getPatchType() public method

Style of patch used to modify this file
public getPatchType ( ) : PatchTypeEnum
return PatchTypeEnum

getReverseBinaryHunk() public method

If a PatchTypeEnum.GIT_BINARY, the old-image delta/literal
public getReverseBinaryHunk ( ) : BinaryHunk
return BinaryHunk

getScore() public method

Returns similarity score between OldName and NewName if getChangeType() is ChangeTypeEnum.COPY or ChangeTypeEnum.RENAME.
public getScore ( ) : int
return int

getScriptText() public method

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
return string

getScriptText() public method

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. ///
return string

getScriptText() public method

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.
return string

hasMetaDataChanges() public method

True if this patch modifies metadata about a file
public hasMetaDataChanges ( ) : bool
return bool

isHunkHdr() public static method

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. ///
return int

newHunkHeader() public method

public newHunkHeader ( int offset ) : GitSharp.Core.Patch.HunkHeader
offset int
return GitSharp.Core.Patch.HunkHeader

parseGitFileName() public method

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. ///
return int

parseGitHeaders() public method

public parseGitHeaders ( int ptr, int end ) : int
ptr int
end int
return int

parseTraditionalHeaders() public method

public parseTraditionalHeaders ( int ptr, int end ) : int
ptr int
end int
return int

Property Details

DeletedFileMode protected_oe static_oe property

protected static byte[] DeletedFileMode
return byte[]

Index protected_oe static_oe property

protected static byte[] Index
return byte[]

NEW_NAME public_oe static_oe property

public static byte[] NEW_NAME
return byte[]

NewFileMode protected_oe static_oe property

protected static byte[] NewFileMode
return byte[]

OLD_NAME public_oe static_oe property

public static byte[] OLD_NAME
return byte[]