class Writer < Object
Typical use is to use the
Writer factory function to instantiate an
object of an appropriate derived class based on the file extension of the
auto writer <- Writer(path);
A write of a single buffer can then be performed with:
A write of a sequence of buffers can be performed with:
writer.startSequence(); writer.write(buffer1); writer.write(buffer2); writer.write(buffer3); writer.endSequence();
which is useful for not keeping the entire contents of the file, to be written, in memory.
Finally, close the file:
A file may not be valid until the writer is closed, depending on the file format.
|Writer||Create a writer for a file.|
|open||Open a file.|
|write||Write the entire contents of the file.|
|flush||Flush accumulated writes to the file.|
|close||Close the file.|
|startMapping||Start a mapping.|
|endMapping||End a mapping.|
|startSequence||Start a sequence.|
|endSequence||End a sequence.|
Factory Function Details
Create a writer for a file.
- path: Path of the file.
Returns: the writer.
The file extension of
path is used to determine the precise type of the
returned object. Supported file extension are
Member Function Details
Close the file.
End a mapping.
End a sequence.
Flush accumulated writes to the file.
Open a file.
- path : Path of the file.
Start a mapping.
Start a sequence.
Write the entire contents of the file.
- buffer: Buffer to write.