- YAML
- JSON
- All known
import siryul;
struct Data {
uint a;
Nullable!uint b;
string c;
@Optional bool d;
}
writeln(Data(1, Nullable!uint.init, "Hello world!", true).toString!YAML());
//%YAML 1.1
//---
//a: 1
//b: null
//c: Hello world!
//d: true
import siryul;
struct Data {
uint a;
Nullable!uint b;
string c;
@Optional bool d;
}
//With a document like...
//%YAML 1.1
//---
//a: 1
//b: null
//c: Hello world!
Data data = fromFile!(Data, YAML)("doc.yml");