Package antlr
Class PreservingFileWriter
java.lang.Object
java.io.Writer
java.io.OutputStreamWriter
java.io.FileWriter
antlr.PreservingFileWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
PreservingFileWriter only overwrites target if the new file is different.
Mainly added in order to prevent big and unnecessary recompiles in C++
projects.
I/O is buffered.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the file and see if the actual target is different if so the target file is overwritten by the copy.Methods inherited from class java.io.OutputStreamWriter
append, append, flush, getEncoding, write, write, write
Methods inherited from class java.io.Writer
append, nullWriter, write, write
-
Field Details
-
target_file
-
tmp_file
-
-
Constructor Details
-
PreservingFileWriter
- Throws:
IOException
-
-
Method Details
-
close
Close the file and see if the actual target is different if so the target file is overwritten by the copy. If not we do nothing- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStreamWriter
- Throws:
IOException
-