TextWriter (object)¶
バージョン 1.12.0 で追加.
The TextWriter is used to write ascii data to files.
参考
/*
** Example: TextWriter
*/
require FileIO;
operator entry() {
FilePath path = FilePath('${TEMP}/textWriter.txt').expandEnvVars();
{
TextWriter writer = TextWriter(path.string());
writer.writeLine("Fabric");
writer.writeLine("Engine");
writer.writeLine("FileIO");
writer.writeLine("Extension");
report('Ascii file written.');
}
}
/*
** Output:
Ascii file written.
*/
Methods¶
TextWriter ( in String filePath ) | |
TextWriter ( in TextWriter other ) | |
TextWriter () | |
TextWriter | clone ? () |
Boolean | close ! () |
Boolean | isOpen ? () |
Boolean | open ! ( in String filePath ) |
write ! ( in String text ) | |
writeLine ! ( in String text ) | |
~TextWriter () |
Methods in detail¶
TextWriter ( in String filePath )
constructs a new writer object with a given filePath
TextWriter ( in TextWriter other )
copy constructor
TextWriter ()
standard constructor
TextWriter TextWriter.clone? ()
clone method
Boolean TextWriter.close! ()
closes a currently opened file, returns true if successful
Boolean TextWriter.isOpen? ()
returns true if the file is currently open
Boolean TextWriter.open! ( in String filePath )
opens a new writable file, returns true if successful
TextWriter.write! ( in String text )
writes the content of the string into the file
TextWriter.writeLine! ( in String text )
writes the content of the string into the file, adding a line break
~ TextWriter ()
standard destructor