dyaml/examples/getting_started/main.d

19 lines
366 B
D
Raw Normal View History

2011-08-16 12:53:13 +00:00
import std.stdio;
import yaml;
void main()
{
//Read the input.
Node root = Loader("input.yaml").load();
//Display the data read.
2011-08-16 12:53:13 +00:00
foreach(string word; root["Hello World"])
{
writeln(word);
}
writeln("The answer is ", root["Answer"].as!int);
//Dump the loaded document to output.yaml.
Dumper("output.yaml").dump(root);
2011-08-16 12:53:13 +00:00
}