The OpenD Programming Language

serializeTextPretty

Ion serialization function with pretty formatting and custom output range.

  1. void serializeTextPretty(Appender appender, V value, int serdeTarget)
    template serializeTextPretty(string sep = "\t")
    void
    serializeTextPretty
    (
    Appender
    V
    )
    (
    scope ref Appender appender
    ,
    auto scope ref const V value
    ,
    int serdeTarget = SerdeTarget.ion
    )
    if (
    isOutputRange!(Appender, const(char)[])
    )
  2. string serializeTextPretty(V value, int serdeTarget)

Members

Functions

serializeTextPretty
void serializeTextPretty(Appender appender, V value, int serdeTarget)

Examples

import mir.format: stringBuf;
auto buffer = stringBuf;
static struct S { int a; }
serializeTextPretty!"    "(buffer, S(4));
assert(buffer.data == "{\n    a: 4\n}");

Meta