Better Loader docs.

This commit is contained in:
Ferdinand Majerech 2014-07-31 14:52:40 +02:00
parent c8949226de
commit 151871e1b3

View file

@ -53,7 +53,7 @@ import dyaml.token;
/// } /// }
/// -------------------- /// --------------------
/// ///
/// Load YAML from memory: /// Load YAML from a string:
/// -------------------- /// --------------------
/// char[] yaml_input = "red: '#ff0000'\n" /// char[] yaml_input = "red: '#ff0000'\n"
/// "green: '#00ff00'\n" /// "green: '#00ff00'\n"
@ -68,6 +68,22 @@ import dyaml.token;
/// } /// }
/// -------------------- /// --------------------
/// ///
/// Load a file into a buffer in memory and then load YAML from that buffer:
/// --------------------
/// try
/// {
/// import std.file;
/// void[] buffer = std.file.read("file.yaml");
/// auto yamlNode = Loader(buffer);
///
/// // Read data from yamlNode here...
/// }
/// catch(FileException e)
/// {
/// writeln("Failed to read file 'file.yaml'");
/// }
/// --------------------
///
/// Use a custom constructor/resolver to support custom data types and/or implicit tags: /// Use a custom constructor/resolver to support custom data types and/or implicit tags:
/// -------------------- /// --------------------
/// auto constructor = new Constructor(); /// auto constructor = new Constructor();