public class FileHeader extends DiffEntry
Modifier and Type | Class and Description |
---|---|
static class |
FileHeader.PatchType
Type of patch used by this file.
|
DiffEntry.ChangeType, DiffEntry.Side
Constructor and Description |
---|
FileHeader(byte[] headerLines,
EditList edits,
FileHeader.PatchType type)
Constructs a new FileHeader
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer() |
int |
getEndOffset() |
BinaryHunk |
getForwardBinaryHunk() |
List<? extends HunkHeader> |
getHunks() |
FileHeader.PatchType |
getPatchType() |
BinaryHunk |
getReverseBinaryHunk() |
String |
getScriptText()
Convert the patch script for this file into a string.
|
String |
getScriptText(Charset oldCharset,
Charset newCharset)
Convert the patch script for this file into a string.
|
int |
getStartOffset() |
boolean |
hasMetaDataChanges() |
EditList |
toEditList() |
getChangeType, getId, getMode, getNewId, getNewMode, getNewPath, getOldId, getOldMode, getOldPath, getPath, getScore, getTreeFilterMarks, isMarked, scan, scan, scan, toString
public FileHeader(byte[] headerLines, EditList edits, FileHeader.PatchType type)
headerLines
- buffer holding the diff header for this fileedits
- the edits for this filetype
- the type of patch used to modify this filepublic byte[] getBuffer()
public int getStartOffset()
getBuffer()
.public int getEndOffset()
public String getScriptText()
The default character encoding (Constants.CHARSET
) is assumed for
both the old and new files.
public String getScriptText(Charset oldCharset, Charset newCharset)
oldCharset
- hint character set to decode the old lines with.newCharset
- hint character set to decode the new lines with.public FileHeader.PatchType getPatchType()
public boolean hasMetaDataChanges()
public List<? extends HunkHeader> getHunks()
public BinaryHunk getForwardBinaryHunk()
FileHeader.PatchType.GIT_BINARY
, the new-image delta/literalpublic BinaryHunk getReverseBinaryHunk()
FileHeader.PatchType.GIT_BINARY
, the old-image delta/literalpublic EditList toEditList()
Copyright © 2015 Eclipse JGit Project. All rights reserved.