|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappli.diff.jdiff
Comparison of C/C++/JAVA files, or directory trees. The comparison is made independently of the file formatting, due to the interal usage of a source beautifier. The full output displays files being in oly one directory, and, for the files common to both trees, the modifications to apply to have the first file identical to the second one.
Field Summary | |
private static boolean |
onlyDirDiffOutput
|
private static boolean |
recurse
|
private static boolean |
silentMode
|
Constructor Summary | |
jdiff()
|
Method Summary | |
private static void |
beautify(ASFormatter form,
java.io.File file)
Beautify a file. |
private static TextBuffer |
beautify(ASFormatter form,
TextBuffer txt,
java.util.ArrayList lines)
|
private static int |
blkLength(java.util.ArrayList lines,
int lineNum,
int blklen)
|
static java.util.ArrayList |
compareDirectories(java.lang.String dir1,
java.lang.String dir2,
java.lang.String[] extensions)
Compare two directories |
private static SimpleDiff |
computeDiffs(java.io.File f1,
java.io.File f2)
Compute the differences between two files (TextBuffers) |
private static ASFormatter |
createBeautifier()
Initialize options for the beautifier |
private static void |
displayDiffs(SimpleDiff d,
java.io.File f1,
java.io.File f2)
|
private static void |
exit(boolean hasDiffs)
Exit according to the existence of differences |
private static void |
exit(int n)
Exits with a status |
private static int |
linePos(java.util.ArrayList lines,
int lineNum)
|
static void |
main(java.lang.String[] args)
Main programme. |
private static void |
println()
Prints a newline out under the control of -s option |
private static void |
println(java.lang.String str)
Prints a line out under the control of -s option |
private static void |
usage()
Display the programme usage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static boolean silentMode
private static boolean onlyDirDiffOutput
private static boolean recurse
Constructor Detail |
public jdiff()
Method Detail |
public static void main(java.lang.String[] args) throws java.io.IOException
args
- command line arguments
java.io.IOException
- Descriptionprivate static void println(java.lang.String str)
str
- the string to print outprivate static void println()
private static void exit(int n)
n
- status valueprivate static void exit(boolean hasDiffs)
hasDiffs
- true if there are differencesprivate static ASFormatter createBeautifier()
private static void beautify(ASFormatter form, java.io.File file)
form
- ASFormatter object already initializedfile
- File objectprivate static TextBuffer beautify(ASFormatter form, TextBuffer txt, java.util.ArrayList lines)
public static java.util.ArrayList compareDirectories(java.lang.String dir1, java.lang.String dir2, java.lang.String[] extensions) throws java.io.IOException, java.lang.IllegalArgumentException
dir1
- first directory. It must be an absolute pathdir2
- second directory. It must be an absolute pathextensions
- an array of Strings containing the extensions like ".java"
java.io.IOException
java.lang.IllegalArgumentException
private static SimpleDiff computeDiffs(java.io.File f1, java.io.File f2)
f1
- first File for the comparisonf2
- second File for the comparison
private static void displayDiffs(SimpleDiff d, java.io.File f1, java.io.File f2) throws java.io.IOException
java.io.IOException
private static int linePos(java.util.ArrayList lines, int lineNum)
private static int blkLength(java.util.ArrayList lines, int lineNum, int blklen)
private static void usage()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |