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

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 fullPath
string mediaType
string odfVersion
string preferredViewMode
string fullPathVersion
Methods
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.

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[] _entries
private size_t[string] _entryIndex
private string _manifestVersion
private string[string] _unknownRootAttrs
Methods
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"`).
size_t entryCount() @property const @safe pure nothrow @nogcReturns the number of entries.
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.
string toXmlString() constSerializes the manifest to an XML string.
ubyte[] toXmlBytes() constSerializes the manifest to raw XML bytes.
void parseXml(string xml)
void extractVersion(string rootTag)
void extractEntries(string body)
string extractAttr(string tag, string attrName)
string escapeAttr(string s) @safe pure
string unescapeAttr(string s) @safe pure
Constructors
this()Constructs an empty manifest model with version `1.2`.

Variables 1

enumvarMANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"

ODF manifest XML namespace URI.