| Modifier and Type | Class and Description |
|---|---|
| public static enum | FileHeader.
Type of patch used by this file. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final byte[] | buf
Buffer holding the patch data for this file. |
| private static final byte[] | |
| private static final byte[] | |
| pack-priv static final byte[] | |
| private static final byte[] | |
| pack-priv int | |
| pack-priv BinaryHunk | forwardBinaryHunk
If |
| private List | hunks
The hunks of this file |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| private static final byte[] | |
| pack-priv static final byte[] | |
| private static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv FileHeader. | patchType
Type of patch used to modify this file |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| pack-priv BinaryHunk | reverseBinaryHunk
If |
| private static final byte[] | |
| pack-priv final int | startOffset
Offset within |
| Access | Constructor and Description |
|---|---|
| public | FileHeader(byte[]
buffer holding the diff header for this file headerLines, EditList the edits for this file edits, FileHeader.the type of patch used to modify this file typeConstructs a new FileHeader |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private boolean | |
| private String[] | |
| public byte[] | Returns: the byte array holding this file's patch script.Get the byte array holding this file's patch script. |
| public int | Returns: offset one past the end of the file script.Get offset one past the end of the file script. |
| public BinaryHunk | Returns: the new-image delta/literal if this is aPatchType#GIT_BINARY.Get the new-image delta/literal if this is a
|
| public List | Returns: hunks altering this file; in order of appearance in patch.Get hunks altering this file; in order of appearance in patch |
| pack-priv int | |
| public FileHeader. | Returns: style of patch used to modify this file.Get style of patch used to modify this file. |
| public BinaryHunk | Returns: the old-image delta/literal if this is aPatchType#GIT_BINARY.Get the old-image delta/literal if this is a
|
| public String | Returns: the patch script, as a Unicode string.Convert the patch script for this file into a string. |
| public String | Returns: the patch script, as a Unicode string.hint character set to decode the old lines with. oldCharset, Charset hint character set to decode the new lines with. newCharset)Convert the patch script for this file into a string. |
| pack-priv String | Returns: the patch script, as a Unicode string.hint which charset is used charsetGuess)Convert the patch script for this file into a string. |
| public int | Returns: offset of the start of this file's script ingetBuffer().Get offset of the start of this file's script in |
| public boolean | Returns: true if this patch modifies metadata about a file .Whether this patch modifies metadata about a file |
| pack-priv static int | Returns: the number of "ancestor revisions" in the hunk header. A traditional two-way diff ("@@ -...") returns 1; a combined diff for a 3 way-merge returns 3. If this is not a hunk header, 0 is returned instead.the buffer to scan buf, int first position in the buffer to evaluate start, int last position to consider; usually the end of the buffer (
end)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.Determine if this is a patch hunk header. |
| pack-priv HunkHeader | |
| private static String | |
| pack-priv FileMode | |
| pack-priv int | Returns: first character after the LF at the end of the line; -1 on error.first character after the "diff --git " or "diff --cc " part. ptr, int one past the last position to parse. end)Parse a "diff --git" or "diff --cc" line. |
| pack-priv int | |
| pack-priv void | |
| private String | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv int | |
| public EditList | Returns: a list describing the content edits performed on this file.Convert to a list describing the content edits performed on this file. |
| private static boolean |
| buf | back to summary |
|---|---|
| pack-priv final byte[] buf Buffer holding the patch data for this file. | |
| COPY_FROM | back to summary |
|---|---|
| private static final byte[] COPY_FROM | |
| COPY_TO | back to summary |
|---|---|
| private static final byte[] COPY_TO | |
| DELETED_FILE_MODE | back to summary |
|---|---|
| pack-priv static final byte[] DELETED_FILE_MODE | |
| DISSIMILARITY_INDEX | back to summary |
|---|---|
| private static final byte[] DISSIMILARITY_INDEX | |
| endOffset | back to summary |
|---|---|
| pack-priv int endOffset Position 1 past the end of this file within | |
| forwardBinaryHunk | back to summary |
|---|---|
| pack-priv BinaryHunk forwardBinaryHunk If | |
| hunks | back to summary |
|---|---|
| private List<HunkHeader> hunks The hunks of this file | |
| INDEX | back to summary |
|---|---|
| pack-priv static final byte[] INDEX | |
| NEW_FILE_MODE | back to summary |
|---|---|
| pack-priv static final byte[] NEW_FILE_MODE | |
| NEW_MODE | back to summary |
|---|---|
| private static final byte[] NEW_MODE | |
| NEW_NAME | back to summary |
|---|---|
| pack-priv static final byte[] NEW_NAME | |
| OLD_MODE | back to summary |
|---|---|
| private static final byte[] OLD_MODE | |
| OLD_NAME | back to summary |
|---|---|
| pack-priv static final byte[] OLD_NAME | |
| patchType | back to summary |
|---|---|
| pack-priv FileHeader. Type of patch used to modify this file | |
| RENAME_FROM | back to summary |
|---|---|
| private static final byte[] RENAME_FROM | |
| RENAME_NEW | back to summary |
|---|---|
| private static final byte[] RENAME_NEW | |
| RENAME_OLD | back to summary |
|---|---|
| private static final byte[] RENAME_OLD | |
| RENAME_TO | back to summary |
|---|---|
| private static final byte[] RENAME_TO | |
| reverseBinaryHunk | back to summary |
|---|---|
| pack-priv BinaryHunk reverseBinaryHunk If | |
| SIMILARITY_INDEX | back to summary |
|---|---|
| private static final byte[] SIMILARITY_INDEX | |
| startOffset | back to summary |
|---|---|
| pack-priv final int startOffset Offset within | |
| FileHeader | back to summary |
|---|---|
| public FileHeader(byte[] headerLines, EditList edits, FileHeader. Constructs a new FileHeader
| |
| FileHeader | back to summary |
|---|---|
| pack-priv FileHeader(byte[] b, int offset) | |
| addHunk | back to summary |
|---|---|
| pack-priv void addHunk(HunkHeader h) | |
| eq | back to summary |
|---|---|
| private boolean eq(int aPtr, int aEnd, int bPtr, int bEnd) | |
| extractFileLines | back to summary |
|---|---|
| private String[] extractFileLines(Charset[] csGuess) | |
| getBuffer | back to summary |
|---|---|
| public byte[] getBuffer() Get the byte array holding this file's patch script.
| |
| getEndOffset | back to summary |
|---|---|
| public int getEndOffset() Get offset one past the end of the file script.
| |
| getForwardBinaryHunk | back to summary |
|---|---|
| public BinaryHunk getForwardBinaryHunk() Get the new-image delta/literal if this is a
| |
| getHunks | back to summary |
|---|---|
| public List Get hunks altering this file; in order of appearance in patch
| |
| getParentCount | back to summary |
|---|---|
| pack-priv int getParentCount() | |
| getPatchType | back to summary |
|---|---|
| public FileHeader. Get style of patch used to modify this file.
| |
| getReverseBinaryHunk | back to summary |
|---|---|
| public BinaryHunk getReverseBinaryHunk() Get the old-image delta/literal if this is a
| |
| getScriptText | back to summary |
|---|---|
| public String getScriptText() Convert the patch script for this file into a string.
The default character encoding
(
| |
| getScriptText | back to summary |
|---|---|
| public String getScriptText(Charset oldCharset, Charset newCharset) Convert the patch script for this file into a string. | |
| getScriptText | back to summary |
|---|---|
| pack-priv String getScriptText(Charset[] charsetGuess) Convert the patch script for this file into a string. | |
| getStartOffset | back to summary |
|---|---|
| public int getStartOffset() Get offset of the start of this file's script in
| |
| hasMetaDataChanges | back to summary |
|---|---|
| public boolean hasMetaDataChanges() Whether this patch modifies metadata about a file
| |
| isHunkHdr | back to summary |
|---|---|
| pack-priv static int isHunkHdr(byte[] buf, int start, int end) Determine if this is a patch hunk header.
| |
| newHunkHeader | back to summary |
|---|---|
| pack-priv HunkHeader newHunkHeader(int offset) | |
| p1 | back to summary |
|---|---|
| private static String p1(final String r) | |
| parseFileMode | back to summary |
|---|---|
| pack-priv FileMode parseFileMode(int ptr, int end) | |
| parseGitFileName | back to summary |
|---|---|
| pack-priv int parseGitFileName(int ptr, int end) Parse a "diff --git" or "diff --cc" line.
| |
| parseGitHeaders | back to summary |
|---|---|
| pack-priv int parseGitHeaders(int ptr, int end) | |
| parseIndexLine | back to summary |
|---|---|
| pack-priv void parseIndexLine(int ptr, int end) | |
| parseName | back to summary |
|---|---|
| private String parseName(String expect, int ptr, int end) | |
| parseNewFileMode | back to summary |
|---|---|
| pack-priv void parseNewFileMode(int ptr, int eol) | |
| parseNewName | back to summary |
|---|---|
| pack-priv void parseNewName(int ptr, int eol) | |
| parseOldName | back to summary |
|---|---|
| pack-priv void parseOldName(int ptr, int eol) | |
| parseTraditionalHeaders | back to summary |
|---|---|
| pack-priv int parseTraditionalHeaders(int ptr, int end) | |
| toEditList | back to summary |
|---|---|
| public EditList toEditList() Convert to a list describing the content edits performed on this file.
| |
| trySimpleConversion | back to summary |
|---|---|
| private static boolean trySimpleConversion(Charset[] charsetGuess) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileHeader. | BINARY
An empty patch with a message "Binary files ... |
| public static final FileHeader. | GIT_BINARY
A Git binary patch, holding pre and post image deltas |
| public static final FileHeader. | UNIFIED
A traditional unified diff style patch of a text file. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static FileHeader. | |
| public static FileHeader. |
| BINARY | back to summary |
|---|---|
| public static final FileHeader. An empty patch with a message "Binary files ... differ" | |
| GIT_BINARY | back to summary |
|---|---|
| public static final FileHeader. A Git binary patch, holding pre and post image deltas | |
| UNIFIED | back to summary |
|---|---|
| public static final FileHeader. A traditional unified diff style patch of a text file. | |
| PatchType | back to summary |
|---|---|
| private PatchType() | |
| valueOf | back to summary |
|---|---|
| public static FileHeader. | |
| values | back to summary |
|---|---|
| public static FileHeader. | |