2011-08-16 12:53:13 +00:00
|
|
|
import std.stdio;
|
2018-04-27 03:17:09 +00:00
|
|
|
import dyaml;
|
2011-08-16 12:53:13 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2011-10-15 14:31:23 +00:00
|
|
|
//Read the input.
|
2018-05-31 07:02:21 +00:00
|
|
|
Node root = Loader.fromFile("input.yaml").load();
|
2011-10-15 14:31:23 +00:00
|
|
|
|
|
|
|
//Display the data read.
|
2011-08-16 12:53:13 +00:00
|
|
|
foreach(string word; root["Hello World"])
|
|
|
|
{
|
|
|
|
writeln(word);
|
|
|
|
}
|
2011-10-22 15:06:32 +00:00
|
|
|
writeln("The answer is ", root["Answer"].as!int);
|
2011-10-15 14:31:23 +00:00
|
|
|
|
|
|
|
//Dump the loaded document to output.yaml.
|
2018-06-22 03:59:10 +00:00
|
|
|
dumper(File("output.yaml", "w").lockingTextWriter).dump(root);
|
2011-08-16 12:53:13 +00:00
|
|
|
}
|