8e0ca41eb5
Replace stream-based dumping interface with an outputrange-based interface merged-on-behalf-of: Cameron Ross <elpenguino@gmail.com>
19 lines
405 B
D
19 lines
405 B
D
import std.stdio;
|
|
import dyaml;
|
|
|
|
void main()
|
|
{
|
|
//Read the input.
|
|
Node root = Loader.fromFile("input.yaml").load();
|
|
|
|
//Display the data read.
|
|
foreach(string word; root["Hello World"])
|
|
{
|
|
writeln(word);
|
|
}
|
|
writeln("The answer is ", root["Answer"].as!int);
|
|
|
|
//Dump the loaded document to output.yaml.
|
|
dumper(File("output.yaml", "w").lockingTextWriter).dump(root);
|
|
}
|