ddn.odf.container.writer
Packaged ODF ZIP writer.
Writes valid ODF ZIP packages through ddn.archive.zip, with the mimetype entry first and uncompressed, followed by standard streams in deterministic order, and preserved unknown entries.
class OdfPackageWriter
Types 1
classOdfPackageWriter
Writes an ODF ZIP package to a file path or in-memory buffer.
The writer emits a valid ODF package with the mimetype entry first and stored uncompressed, followed by standard streams in deterministic order. Unknown entries from a source package can be preserved.
Fields
private ArchiveWriter _archiveprivate OdfWriteOptions _optionsprivate bool _finishedprivate bool _closedMethods
OdfPackageWriter open(string path,
OdfWriteOptions options = OdfWriteOptions.init)Creates a writer that writes to a file path.OdfPackageWriter openToSink(ContentSink sink,
OdfWriteOptions options = OdfWriteOptions.init)Creates a writer that writes to an in-memory buffer.void writeMimetype(string mimeType)Writes the `mimetype` entry.void writeMimetype(OdfDocumentType docType)Writes the `mimetype` entry from a document type.void writeFile(string path, const(ubyte)[] content)Writes a file entry to the package.void writeDirectory(string path)Writes a directory entry to the package.void writeMinimalPackage(OdfDocumentType docType)Writes a minimal valid ODF package for the given document type.void writeFromReader(OdfPackageReader reader)Writes all entries from a source package reader, preserving unknown entries.void finish()Finishes writing the ZIP package.void close()Closes the writer and releases resources.bool isFinished() @property const @safe pure nothrow @nogcReturns `true` if the writer has been finished.bool isClosed() @property const @safe pure nothrow @nogcReturns `true` if the writer has been closed.string minimalContentXml(OdfDocumentType docType)string minimalStylesXml()string minimalMetaXml()string minimalSettingsXml()string minimalManifestXml(OdfDocumentType docType)Constructors
this(ArchiveWriter archive, OdfWriteOptions options)Destructors