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