ddn.odf.manifest
ODF manifest support (META-INF/manifest.xml).
Provides a package-level manifest model that can read, write, and preserve manifest data needed by container logic. The manifest lists every entry within an ODF ZIP container along with its media type.
XML-backed parsing uses a lightweight inline parser. After S3T1, the same public API is enriched with ddn-data-xml support.
Types 2
structManifestEntry
A single entry within an ODF manifest.
Represents one <manifest:file-entry> element, holding the entry's full path, media type, and optional version metadata.
Fields
string fullPathstring mediaTypestring odfVersionstring preferredViewModestring fullPathVersionMethods
bool isRoot() @property const @safe pure nothrow @nogcWhether this entry represents the package root (`/`).bool isDirectory() @property const @safe pure nothrow @nogcWhether this entry represents a directory (empty media type, trailing `/`).bool isFile() @property const @safe pure nothrow @nogcWhether this entry represents a file (non-directory with a non-empty path).bool isStandardEntry() @property const @safe pure nothrow @nogcWhether this entry is one of the standard ODF entries.classManifestModel
Package-level manifest model for an ODF container.
Reads, writes, and preserves manifest data listing every entry within an ODF ZIP container along with its media type.
Fields
private ManifestEntry[] _entriesprivate size_t[string] _entryIndexprivate string _manifestVersionprivate string[string] _unknownRootAttrsMethods
ManifestModel fromXml(const(ubyte)[] xmlBytes)Creates a manifest model by parsing raw XML bytes.ManifestModel fromXmlString(string xml)Creates a manifest model by parsing an XML string.const(ManifestEntry)[] entries() @property const @safe pure nothrow @nogcReturns all manifest entries in document order.string manifestVersion() @property const @safe pure nothrow @nogcReturns the manifest version string (e.g. `"1.2"`).bool contains(string fullPath) const @safe pure nothrow @nogcChecks whether an entry with the given path exists.const(ManifestEntry) * getEntry(string fullPath) const @safe pure nothrowRetrieves a pointer to the entry with the given path.string mediaTypeOf(string fullPath) const @safe pure nothrow @nogcReturns the media type of the entry at the given path.const(ManifestEntry) * rootEntry() const @safe pure nothrowReturns a pointer to the root (`/`) entry.void addEntry(string fullPath, string mediaType = "",
string odfVersion = "")Adds or replaces a manifest entry.bool removeEntry(string fullPath)Removes the entry with the given path and reindexes remaining entries.void addStandardEntries(string rootMediaType)Adds the set of standard ODF entries with the given root media type.void parseXml(string xml)void extractVersion(string rootTag)void extractEntries(string body)ManifestEntry parseEntryTag(string tag)string extractAttr(string tag, string attrName)Constructors
this()Constructs an empty manifest model with version `1.2`.Variables 1
enumvar
MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"ODF manifest XML namespace URI.