License
BSD-3-Clause
CF Writer - Serializer for CF Configuration Files
This module provides a writer/serializer that converts CF documents to CF text format with roundtrip-preserving output using the document's metadata to reproduce original formatting as closely as possible.
Configuration options for the CF writer.
Controls formatting behavior for fresh output and as fallback for modified nodes in roundtrip mode.
string indentIndentation string (default: 3 spaces per CODE_STYLE)bool sortKeysSort object keys for deterministic outputbool useHCLStyleOmit `=` before objects (HCL-style)SeparatorStyle separatorStyleDefault separator for fresh outputQuoteStyle quoteStyleDefault quote style for fresh outputbool minifiedMinified output (no whitespace/newlines)Internal CF writer implementation.
void writeDocument(CfDocument doc)Writes a complete CfDocument.void writeMembers(CfMember[] members, int depth, bool explicit)Writes a sequence of object members.void writeSeparator(SeparatorStyle style, bool isLast)Writes a separator between members/elements.void writeString(CfNode * node)Writes a string node.void writeInteger(CfNode * node)Writes an integer node.void writeFloat(CfNode * node)Writes a float node.void writeFloatValue(double value)Writes a float value with proper handling of special values.void writeObject(CfNode * node, int depth)Writes an object node.void writeArray(CfNode * node, int depth)Writes an array node.void writeComments(CfComment[] comments, int depth)Writes comments.void writeComment(CfComment comment)Writes a single comment.void writeIndent(int depth)Writes indentation.this(CfWriterConfig cfg)Constructs a CfWriter with the given configuration.string toCF(CfDocument doc, CfWriterConfig config = CfWriterConfig.init)Converts a `CfDocument` to CF format string.string quoteString(string s, QuoteStyle style) @safe pureQuotes a string with the specified style.string escapeChar(char c, char quote) @safe pure nothrowEscapes a character for inclusion in a quoted string.