serializeConfig

Serialize T into file path

@safe
void
serializeConfig
(
T
)
(
auto ref T t
,
string path
)

Examples

struct A
{
    @ConfigProperty() int a;
    @ConfigProperty() float b;
    @ConfigProperty() string someString;
}
import std.stdio : writeln;
import std.file : remove;
auto a = A(12, 42.0, "I shall contain=====stuff .123.123.1.23.");
serializeConfig(a, "test.cfg");
A test;
deserializeConfig(test, "test.cfg");
assert(test.a == a.a);
assert(test.b == a.b);
assert(test.someString == a.someString);
remove("test.cfg");

Meta