ddn.data.cdm.conv

CDM conversion utilities.

This module provides conversion functions between CdmNode/CdmDocument and ddn.var, as well as JSON export functionality.

Functions 8

fnvar toVar(const ref CdmNode node) @safeConvert a CdmNode to a var value (lossy — strips metadata).
fnvar toVar(const ref CdmDocument doc) @safeConvert a CdmDocument to a var value.
fnCdmNode fromVar(var v) @safeConvert a var to a CdmNode (default formatting).
fnCdmDocument fromVar(var v, CdmDocument.Format fmt) @safeConvert a var to a CdmDocument with the given format.
fnstring toJson(const ref CdmNode node, bool pretty = false) @safeConvert a CdmNode to a JSON string.
fnstring toJson(const ref CdmDocument doc, bool pretty = false) @safeConvert a CdmDocument to a JSON string.
private fnvoid writeIndent(ref Appender!string app, int level) pure @safeWrite indentation spaces to the appender.
private fnvoid toJsonImpl( const ref CdmNode node, ref Appender!string app, int indent ) @safeRecursive JSON serialization implementation.