ddn.odf.mimetype

MIME type handling and detection for OpenDocument files.

Maps between ODF document types, file extensions, and their standard MIME types as defined by OASIS ODF 1.2.

Supported types

All ODF families are fully supported: text (.odt), spreadsheet (.ods), drawing (.odg), presentation (.odp), chart (.odc), formula (.odf), image (.odi), database (.odb), and their template variants.

Functions 7

fnstring odfMimeType(OdfDocumentType docType) @safe pure nothrow @nogcReturns the standard MIME type string for the given document type.
fnstring odfExtension(OdfDocumentType docType) @safe pure nothrow @nogcReturns the typical file extension (without dot) for the given document type.
fnOdfDocumentType odfDocumentTypeFromMime(string mimeType) @safe pure nothrowAttempts to detect the document type from a MIME type string.
fnOdfDocumentType odfDocumentTypeFromExtension(string ext) @safe pure nothrowAttempts to detect the document type from a file extension.
fnbool isValidDocumentType(OdfDocumentType docType) @safe pure nothrow @nogcChecks whether the given document type represents a valid ODF document.
fnOdfDocumentType odfBaseFamily(OdfDocumentType docType) @safe pure nothrow @nogcReturns the document family base type for template and variant types.
fnbool isTemplateType(OdfDocumentType docType) @safe pure nothrow @nogcReturns `true` if the document type is a template variant.