ddn.data.cdm.document

CDM document root container.

This module provides the CdmDocument struct which serves as the root container for a parsed configuration document, holding the root node, format metadata, and document-level comments.

Types 1

Root container for a parsed configuration document.

CdmDocument encapsulates a complete parsed configuration file, including the root node, detected format, source location, and any comments that appear before or after the root content.

Examples

auto doc = CdmDocument(CdmDocument.Format.JSON);
doc.source = "config.json";
doc.root = CdmNode.emptyObject();
doc.root["name"] = CdmNode("myapp");
assert(!doc.empty);
Fields
Format formatThe detected or specified format
string sourceSource file path or URI
CdmNode rootThe root node of the document
CdmComment[] prologCommentsComments appearing before the root element
CdmComment[] epilogCommentsComments appearing after the root element
string encodingCharacter encoding (default UTF-8)
Methods
bool empty() const pure nothrow @nogc @safeReturns true if this document is empty.
CdmDocument dup() const pure @safeCreates a deep copy of this document.
Nested Templates
FormatThe detected or specified document format.