Regenerated docs.

This commit is contained in:
Ferdinand Majerech 2014-08-01 03:00:40 +02:00
parent 66679a601c
commit 3b058c234f
38 changed files with 11140 additions and 732 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 076a83227d143ba3c8deaf98c02a01e9
tags: fbb0d17656682115ca4d033fb2f83ba1
config: 4cd0b7d9cdc8d1c058e809aa7e0397b3
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -78,6 +78,7 @@ CSS-like format, RRGGBB, or from a mapping, where we use the following format:
//Get value of a hex digit.
uint hex(char c)
{
import std.ascii;
if(!std.ascii.isHexDigit(c))
{
throw new Exception("Invalid color: " ~ value);

View file

@ -24,9 +24,8 @@ Download the version of DMD for your operating system and install it.
.. note::
Other D compilers exist, such as
`GDC <http://bitbucket.org/goshawk/gdc/wiki/Home>`_ and
`LDC <http://www.dsource.org/projects/ldc/>`_. Setting up with either one of
them should be similar to DMD, but they are not yet as stable as DMD.
`GDC <http://gdcproject.org/>`_ and
`LDC <http://bitbucket.org/goshawk/gdc/wiki/Home>`_.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Download and compile D:YAML
@ -77,7 +76,7 @@ into the file:
.. code-block:: d
import std.stdio;
import dyaml.all;
import yaml;
void main()
{
@ -100,7 +99,7 @@ into the file:
Explanation of the code
^^^^^^^^^^^^^^^^^^^^^^^
First, we import the *dyaml.all* module. This is the only D:YAML module you
First, we import the *yaml* module. This is the only D:YAML module you
need to import - it automatically imports all needed modules.
Next we load the file using the *Loader.load()* method. *Loader* is a struct

View file

@ -257,16 +257,16 @@ Implicit tags:
This table shows D types stored in *yaml.Node* default YAML tags are converted to.
Some of these might change in the future (especially !!map and !!set).
====================== ================
====================== ====================
YAML tag D type
====================== ================
====================== ====================
!!null yaml.YAMLNull
!!bool bool
!!int long
!!float real
!!binary ubyte[]
!!timestamp datetime.SysTime
!!map, !!omap, !!pairs Node.Pair[]
!!seq, !!set Node[]
!!timestamp std.datetime.SysTime
!!map, !!omap, !!pairs yaml.Node.Pair[]
!!seq, !!set yaml.Node[]
!!str string
====================== ================
====================== ====================

View file

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -89,6 +89,7 @@ div.sphinxsidebar #searchbox input[type="submit"] {
img {
border: 0;
max-width: 100%;
}
/* -- search page ----------------------------------------------------------- */
@ -401,10 +402,6 @@ dl.glossary dt {
margin: 0;
}
.refcount {
color: #060;
}
.optional {
font-size: 1.3em;
}

View file

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

View file

@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -32,7 +32,7 @@ if (!window.console || !console.firebug) {
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
}
};
/**
* small helper function to urlencode strings
@ -61,18 +61,6 @@ jQuery.getQueryParameters = function(s) {
return result;
};
/**
* small function to check if an array contains
* a given item.
*/
jQuery.contains = function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == item)
return true;
}
return false;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
@ -180,6 +168,9 @@ var Documentation = {
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');

File diff suppressed because it is too large Load diff

View file

@ -4,38 +4,11 @@
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
jQuery.makeSearchSummary = function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
/**
* Porter Stemmer
@ -220,6 +193,38 @@ var Stemmer = function() {
}
/**
* Simple result scoring code.
*/
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// and returns the new score.
/*
score: function(result) {
return result[4];
},
*/
// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
// Used when the priority is not in the mapping.
objPrioDefault: 0,
// query found in title
title: 15,
// query found in terms
term: 5
};
/**
* Search Module
*/
@ -239,8 +244,13 @@ var Search = {
},
loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null, success: null,
dataType: "script", cache: true});
$.ajax({type: "GET", url: url, data: null,
dataType: "script", cache: true,
complete: function(jqxhr, textstatus) {
if (textstatus != "success") {
document.getElementById("searchindexloader").src = url;
}
}});
},
setIndex : function(index) {
@ -268,19 +278,20 @@ var Search = {
if (this._pulse_status >= 0)
return;
function pulse() {
var i;
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (var i = 0; i < Search._pulse_status; i++)
for (i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
};
}
pulse();
},
/**
* perform a search for something
* perform a search for something (or wait until index is loaded)
*/
performSearch : function(query) {
// create the required interface elements
@ -300,41 +311,46 @@ var Search = {
this.deferQuery(query);
},
/**
* execute search (requires search index to be loaded)
*/
query : function(query) {
var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
var i;
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
// Stem the searchterms and add them to the correct list
// stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var objectterms = [];
for (var i = 0; i < tmp.length; i++) {
if (tmp[i] != "") {
for (i = 0; i < tmp.length; i++) {
if (tmp[i] !== "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] === "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
var word = stemmer.stemWord(tmp[i].toLowerCase());
var toAppend;
// select the correct list
if (word[0] == '-') {
var toAppend = excluded;
toAppend = excluded;
word = word.substr(1);
}
else {
var toAppend = searchterms;
toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$.contains(toAppend, word))
if (!$u.contains(toAppend, word))
toAppend.push(word);
};
}
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:');
@ -342,89 +358,51 @@ var Search = {
// console.info('excluded: ', excluded);
// prepare search
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var fileMap = {};
var files = null;
// different result priorities
var importantResults = [];
var objectResults = [];
var regularResults = [];
var unimportantResults = [];
var titleterms = this._index.titleterms;
// array of [filename, title, anchor, descr, score]
var results = [];
$('#search-progress').empty();
// lookup as object
for (var i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i),
objectterms.slice(i+1, objectterms.length))
var results = this.performObjectSearch(objectterms[i], others);
// Assume first word is most likely to be the object,
// other words more likely to be in description.
// Therefore put matches for earlier words first.
// (Results are eventually used in reverse order).
objectResults = results[0].concat(objectResults);
importantResults = results[1].concat(importantResults);
unimportantResults = results[2].concat(unimportantResults);
for (i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0, i),
objectterms.slice(i+1, objectterms.length));
results = results.concat(this.performObjectSearch(objectterms[i], others));
}
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) == null)
break;
if (files.length == undefined) {
files = [files];
}
// create the mapping
for (var j = 0; j < files.length; j++) {
var file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
// lookup as search terms in fulltext
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
.concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
// let the scorer override scores with a custom scoring function
if (Scorer.score) {
for (i = 0; i < results.length; i++)
results[i][4] = Scorer.score(results[i]);
}
// now check if the files don't contain excluded terms
for (var file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the
// search result.
for (var i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
// now sort the results by score (in opposite order of appearance, since the
// display function below uses pop() to retrieve items) and then
// alphabetically
results.sort(function(a, b) {
var left = a[4];
var right = b[4];
if (left > right) {
return 1;
} else if (left < right) {
return -1;
} else {
// same score: sort alphabetically
left = a[1].toLowerCase();
right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
}
// if we have still a valid result we can add it
// to the result list
if (valid)
regularResults.push([filenames[file], titles[file], '', null]);
}
// delete unused variables in order to not waste
// memory until list is retrieved completely
delete filenames, titles, terms;
// now sort the regular results descending by title
regularResults.sort(function(a, b) {
var left = a[1].toLowerCase();
var right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
});
// combine all results
var results = unimportantResults.concat(regularResults)
.concat(objectResults).concat(importantResults);
// for debugging
//Search.lastresults = results.slice(); // a copy
//console.info('search results:', Search.lastresults);
// print the results
var resultCount = results.length;
@ -433,7 +411,7 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
@ -457,16 +435,18 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
item[0] + '.txt', function(data) {
if (data != '') {
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
Search.output.append(listItem);
}
listItem.slideDown(5, function() {
displayNextItem();
});
}, "text");
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
if (data !== '') {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
}});
} else {
// no source available, just display title
Search.output.append(listItem);
@ -489,20 +469,32 @@ var Search = {
displayNextItem();
},
/**
* search for object names
*/
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var importantResults = [];
var objectResults = [];
var unimportantResults = [];
var i;
var results = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var score = 0;
var parts = fullname.split('.');
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullname == object || parts[parts.length - 1] == object) {
score += Scorer.objNameMatch;
// matches in last name
} else if (parts[parts.length - 1].indexOf(object) > -1) {
score += Scorer.objPartialMatch;
}
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
@ -512,7 +504,7 @@ var Search = {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (var i = 0; i < otherterms.length; i++) {
for (i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
@ -523,37 +515,107 @@ var Search = {
}
}
var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '')
var anchor = match[3];
if (anchor === '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
// add custom score for some objects according to scorer
if (Scorer.objPrio.hasOwnProperty(match[2])) {
score += Scorer.objPrio[match[2]];
} else {
score += Scorer.objPrioDefault;
}
results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
return results;
},
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
/**
* search for full-text terms in the index
*/
performTermsSearch : function(searchterms, excluded, terms, score) {
var filenames = this._index.filenames;
var titles = this._index.titles;
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
var i, j, file, files;
var fileMap = {};
var results = [];
return [importantResults, objectResults, unimportantResults]
// perform the search on the required terms
for (i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) === undefined)
break;
if (files.length === undefined) {
files = [files];
}
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
}
// now check if the files don't contain excluded terms
for (file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
// if we have still a valid result we can add it to the result list
if (valid) {
results.push([filenames[file], titles[file], '', null, score]);
}
}
return results;
},
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
makeSearchSummary : function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
}
};
$(document).ready(function() {
Search.init();

View file

@ -16,12 +16,20 @@
* Once the browser is closed the cookie is deleted and the position
* reset to the default (expanded).
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
$(function() {
// global elements used by the functions.
// the 'sidebarbutton' element is defined as global after its
// creation, in the add_sidebar_button function
@ -134,7 +142,7 @@ $(function() {
var items = document.cookie.split(';');
for(var k=0; k<items.length; k++) {
var key_val = items[k].split('=');
var key = key_val[0];
var key = key_val[0].replace(/ /, ""); // strip leading spaces
if (key == 'sidebar') {
var value = key_val[1];
if ((value == 'collapsed') && (!sidebar_is_collapsed()))

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
*
* sphinx.websupport utilties for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.constructor - D:YAML 0.4 API documentation</title>
<title>dyaml.constructor - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -45,28 +44,7 @@
nodes. This can be used to implement custom data types. A tutorial can be
found <a href="../tutorials/custom_types.html">here</a>.</p>
<dl><dt class="d_decl"><a name="ConstructorException"></a>class <a name="ConstructorException"></a><span class="ddoc_psymbol">ConstructorException</span>: dyaml.exception.YAMLException;
</dt>
<dd><p>Exception thrown at constructor errors.
</p>
<p>Can be thrown by custom constructor functions.</p>
<dl><dt class="d_decl"><a name="ConstructorException.this"></a>@safe this(string <b>msg</b>, Mark <b>start</b>, Mark <b>end</b>, string <b>file</b> = __FILE__, int <b>line</b> = __LINE__);
</dt>
<dd><p>Construct a ConstructorException.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>string <b>msg</b></td>
<td valign=top>Error message.</td></tr>
<tr><td valign=top>Mark <b>start</b></td>
<td valign=top>Start position of the error context.</td></tr>
<tr><td valign=top>Mark <b>end</b></td>
<td valign=top>End position of the error context.</td></tr>
</table></div>
</dd>
</dl>
</dd>
<dt class="d_decl"><a name="Constructor"></a>class <a name="Constructor"></a><span class="ddoc_psymbol">Constructor</span>;
<dl><dt class="d_decl"><a name="Constructor"></a>class <a name="Constructor"></a><span class="ddoc_psymbol">Constructor</span>;
</dt>
<dd><p>Constructs YAML values.
</p>
@ -85,12 +63,18 @@
If a tag is detected with no known constructor function, it is considered an error.</p>
<dl><dt class="d_decl"><a name="Constructor.this"></a>nothrow @safe this(const Flag!"useDefaultConstructors" <b>defaultConstructors</b> = Yes.useDefaultConstructors);
<dl><dt class="d_decl"><a name="Constructor.this"></a>nothrow @safe this(const Flag!"useDefaultConstructors" <b>defaultConstructors</b> = Yes.useDefaultConstructors);
</dt>
<dd><p>Construct a Constructor.
</p>
<p>If you don't want to support default YAML tags/data types, you can use
<b>defaultConstructors</b> to disable constructor functions for these.
<br>
<b>defaultConstructors</b> to disable constructor functions for these.
<br>
<br>
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>Flag!"useDefaultConstructors" <b>defaultConstructors</b></td>
@ -103,12 +87,12 @@
<dd><p>Add a constructor function from scalar.
</p>
<p>The function must take a reference to <span class="d_inlinecode">Node</span> to construct from.
The node contains a string for scalars, for sequences and
for mappings.
The node contains a string for scalars, <span class="d_inlinecode">Node[]</span> for sequences and
<span class="d_inlinecode">Node.Pair[]</span> for mappings.
<br>
Any exception thrown by this function will be caught by D:YAML and
its message will be added to a that will also tell
its message will be added to a <span class="d_inlinecode">YAMLException</span> that will also tell
the user which type failed to construct, and position in the file.
<br>
@ -160,7 +144,7 @@ MyStruct constructMyStructScalar(<span class="d_keyword">ref</span> Node node)
<span class="d_comment">//Guaranteed to be string as we construct from scalar.
</span> <span class="d_comment">//!mystruct x:y:z
</span> <span class="d_keyword">auto</span> parts = node.as!string().split(<span class="d_string">":"</span>);
<span class="d_comment">//If this throws, the D:YAML will handle it and throw a YAMLException.
<span class="d_comment">// If this throws, the D:YAML will handle it and throw a YAMLException.
</span> <span class="d_keyword">return</span> MyStruct(to!<span class="d_keyword">int</span>(parts[0]), to!<span class="d_keyword">int</span>(parts[1]), to!<span class="d_keyword">int</span>(parts[2]));
}
@ -345,7 +329,7 @@ MyStruct constructMyStructMapping(<span class="d_keyword">ref</span> Node node)
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.dumper - D:YAML 0.4 API documentation</title>
<title>dyaml.dumper - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -56,7 +55,7 @@
Setters are provided to affect output details (style, encoding, etc.).
</p>
<b>Examples:</b><div class="pbr">Write to a file:
<b>Examples:</b><div class="pbr"> Write to a file:
<pre class="d_code"><span class="d_keyword">auto</span> node = Node([1, 2, 3, 4, 5]);
<span class="d_psymbol">Dumper</span>(<span class="d_string">"file.yaml"</span>).dump(node);
</pre>
@ -96,7 +95,7 @@ dumper.dump(node);
</pre>
</div>
<dl><dt class="d_decl"><a name="Dumper.this"></a>@trusted this(string <b>filename</b>);
<dl><dt class="d_decl"><a name="Dumper.this"></a>@trusted this(string <b>filename</b>);
</dt>
<dd><p>Construct a Dumper writing to a file.
</p>
@ -106,7 +105,7 @@ dumper.dump(node);
<b>Throws:</b><div class="pbr">YAMLException if the file can not be dumped to (e.g. cannot be opened).</div>
</dd>
<dt class="d_decl"><a name="Dumper.this"></a>@safe this(Stream <b>stream</b>);
<dt class="d_decl"><a name="Dumper.this"></a>@safe this(Stream <b>stream</b>);
</dt>
<dd><p>Construct a Dumper writing to a stream. This is useful to e.g. write to memory.</p>
@ -227,7 +226,7 @@ dumper.dump(Node(<span class="d_string">"foo"</span>));
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -1,73 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.encoding - D:YAML 0.4 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
</div>
</div>
<div id="navigation">
<div class="navblock">
<div id="toctop">
<ul><li><a href="../index.html">Documentation home</a></li>
</ul>
</div>
</div>
<div class="navblock">
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
<li><a href="dyaml.loader.html">dyaml.loader</a></li>
<li><a href="dyaml.node.html">dyaml.node</a></li>
<li><a href="dyaml.representer.html">dyaml.representer</a></li>
<li><a href="dyaml.resolver.html">dyaml.resolver</a></li>
<li><a href="dyaml.style.html">dyaml.style</a></li>
</ul>
</div>
</div>
<div id="content">
<h1>dyaml.encoding</h1>
<!-- Generated by Ddoc from dyaml/encoding.d -->
<br>
<dl><dt class="d_decl"><a name="Encoding"></a>enum <a name="Encoding"></a><span class="ddoc_psymbol">Encoding</span>: ubyte;
</dt>
<dd><p>Text encodings supported by D:YAML.</p>
<dl><dt class="d_decl"><a name="Encoding.UTF_8"></a><a name="UTF_8"></a><span class="ddoc_psymbol">UTF_8</span></dt>
<dd><p>Unicode UTF-8</p>
</dd>
<dt class="d_decl"><a name="Encoding.UTF_16"></a><a name="UTF_16"></a><span class="ddoc_psymbol">UTF_16</span></dt>
<dd><p>Unicode UTF-16</p>
</dd>
<dt class="d_decl"><a name="Encoding.UTF_32"></a><a name="UTF_32"></a><span class="ddoc_psymbol">UTF_32</span></dt>
<dd><p>Unicode UTF-32</p>
</dd>
</dl>
</dd>
</dl>
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>
</body>
</html>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.exception - D:YAML 0.4 API documentation</title>
<title>dyaml.exception - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -43,30 +42,14 @@
<!-- Generated by Ddoc from dyaml/exception.d -->
<p>Exceptions thrown by D:YAML and exception related code.</p>
<dl><dt class="d_decl"><a name="YAMLException"></a>class <a name="YAMLException"></a><span class="ddoc_psymbol">YAMLException</span>: object.Exception;
<dl><dt class="d_decl"><a name="YAMLException"></a>class <a name="YAMLException"></a><span class="ddoc_psymbol">YAMLException</span>: <u>object.Exception</u>;
</dt>
<dd><p>Base class for all exceptions thrown by D:YAML.</p>
<dl><dt class="d_decl"><a name="YAMLException.this"></a>pure nothrow @trusted this(string <b>msg</b>, string <b>file</b> = __FILE__, int <b>line</b> = __LINE__);
<dl><dt class="d_decl"><a name="YAMLException.this"></a>pure nothrow @safe this(string <b>msg</b>, string <b>file</b> = __FILE__, int <b>line</b> = __LINE__);
</dt>
<dd><p>Construct a YAMLException with specified message and position where it was thrown.</p>
</dd>
</dl>
</dd>
<dt class="d_decl"><a name="Mark"></a>struct <a name="Mark"></a><span class="ddoc_psymbol">Mark</span>;
</dt>
<dd><p>Position in a YAML stream, used for error messages.</p>
<dl><dt class="d_decl"><a name="Mark.this"></a>pure nothrow @safe this(const uint <b>line</b>, const uint <b>column</b>);
</dt>
<dd><p>Construct a Mark with specified <b>line</b> and <b>column</b> in the file.</p>
</dd>
<dt class="d_decl"><a name="Mark.toString"></a>const pure @trusted string <a name="toString"></a><span class="ddoc_psymbol">toString</span>();
</dt>
<dd><p>Get a string representation of the mark.</p>
</dd>
</dl>
</dd>
@ -75,7 +58,7 @@
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.hacks - D:YAML 0.4 API documentation</title>
<title>dyaml.hacks - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -41,12 +40,11 @@
<div id="content">
<h1>dyaml.hacks</h1>
<!-- Generated by Ddoc from dyaml/hacks.d -->
<p>Functionality that may be sometimes needed but allows unsafe or unstandard
behavior, and should only be used in specific cases.</p>
<p>Functionality that may sometimes be needed but allows unsafe or unstandard behavior, and should only be used in specific cases.</p>
<dl><dt class="d_decl"><a name="scalarStyleHack"></a>nothrow @safe ScalarStyle <a name="scalarStyleHack"></a><span class="ddoc_psymbol">scalarStyleHack</span>(ref const(Node) <b>node</b>);
</dt>
<dd><p>Get the scalar style a YAML <b>node</b> had in the file it was loaded from.
<dd><p>Get the scalar style a <b>node</b> had in the file it was loaded from.
</p>
<p>This is only useful for nodes loaded from files.
<br>
@ -75,6 +73,10 @@
<dd><p>Get the collection style a YAML <b>node</b> had in the file it was loaded from.
</p>
<p>May only be called on collection nodes (nodes where <b>node</b>.isScalar() != <b>true</b>).
<br>
<br>
</p>
<b>See Also:</b><div class="pbr">scalarStyleHack</div>
@ -82,13 +84,19 @@
</dd>
<dt class="d_decl"><a name="scalarStyleHack"></a>nothrow @safe void <a name="scalarStyleHack"></a><span class="ddoc_psymbol">scalarStyleHack</span>(ref Node <b>node</b>, const ScalarStyle <b>rhs</b>);
</dt>
<dd><p>Set the scalar style a YAML <b>node</b> had in the file it was loaded from.
<dd><p>Set the scalar style <b>node</b> should have when written to a file.
</p>
<p>Setting the style might be useful when generating YAML or reformatting existing
files.
<br>
May only be called on scalar nodes (nodes where <b>node</b>.isScalar() == <b>true</b>).</p>
files.
<br>
<br>
<br>
May only be called on scalar nodes (nodes where <b>node</b>.isScalar() == <b>true</b>).</p>
<b>Examples:</b><div class="pbr"><pre class="d_code">
writeln(<span class="d_string">"D:YAML scalarStyleHack setter unittest"</span>);
<span class="d_keyword">auto</span> <span class="d_param">node</span> = Node(5);
@ -99,13 +107,19 @@ writeln(<span class="d_string">"D:YAML scalarStyleHack setter unittest"</span>);
</dd>
<dt class="d_decl"><a name="collectionStyleHack"></a>nothrow @safe void <a name="collectionStyleHack"></a><span class="ddoc_psymbol">collectionStyleHack</span>(ref Node <b>node</b>, const CollectionStyle <b>rhs</b>);
</dt>
<dd><p>Set the scalar style a YAML <b>node</b> had in the file it was loaded from.
<dd><p>Set the collection style <b>node</b> should have when written to a file.
</p>
<p>Setting the style might be useful when generating YAML or reformatting existing
files.
<br>
May only be called on collection nodes (nodes where <b>node</b>.isScalar() != <b>true</b>).</p>
files.
<br>
<br>
<br>
May only be called on collection nodes (nodes where <b>node</b>.isScalar() != <b>true</b>).</p>
<b>Examples:</b><div class="pbr"><pre class="d_code">
writeln(<span class="d_string">"D:YAML collectionStyleHack setter unittest"</span>);
<span class="d_keyword">auto</span> <span class="d_param">node</span> = Node([1, 2, 3, 4, 5]);
@ -119,7 +133,7 @@ writeln(<span class="d_string">"D:YAML collectionStyleHack setter unittest"</spa
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.linebreak - D:YAML 0.4 API documentation</title>
<title>dyaml.linebreak - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -65,7 +64,7 @@
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.loader - D:YAML 0.4 API documentation</title>
<title>dyaml.loader - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -51,7 +50,7 @@
tags / data types.
</p>
<b>Examples:</b><div class="pbr">Load single YAML document from a file:
<b>Examples:</b><div class="pbr"> Load single YAML document from a file:
<pre class="d_code"><span class="d_keyword">auto</span> rootNode = <span class="d_psymbol">Loader</span>(<span class="d_string">"file.yaml"</span>).load();
...
</pre>
@ -73,37 +72,51 @@
</pre>
<br>
Load YAML from memory:
<pre class="d_code"><span class="d_keyword">import</span> std.stream;
<span class="d_keyword">import</span> std.stdio;
string yaml_input = <span class="d_string">"red: '#ff0000'\n"</span>
Load YAML from a string:
<pre class="d_code"><span class="d_keyword">char</span>[] yaml_input = <span class="d_string">"red: '#ff0000'\n"</span>
<span class="d_string">"green: '#00ff00'\n"</span>
<span class="d_string">"blue: '#0000ff'"</span>;
<span class="d_string">"blue: '#0000ff'"</span>.dup;
<span class="d_keyword">auto</span> colors = <span class="d_psymbol">Loader</span>.fromString(yaml_input).load();
<span class="d_keyword">foreach</span>(string color, string value; colors)
{
<span class="d_keyword">import</span> std.stdio;
writeln(color, <span class="d_string">" is "</span>, value, <span class="d_string">" in HTML/CSS"</span>);
}
</pre>
<br>
Load a file into a buffer in memory and then load YAML from that buffer:
<pre class="d_code"><span class="d_keyword">try</span>
{
<span class="d_keyword">import</span> std.file;
<span class="d_keyword">void</span>[] buffer = std.file.read(<span class="d_string">"file.yaml"</span>);
<span class="d_keyword">auto</span> yamlNode = <span class="d_psymbol">Loader</span>(buffer);
<span class="d_comment">// Read data from yamlNode here...
</span>}
<span class="d_keyword">catch</span>(FileException e)
{
writeln(<span class="d_string">"Failed to read file 'file.yaml'"</span>);
}
</pre>
<br>
Use a custom constructor/resolver to support custom data types and/or implicit tags:
<pre class="d_code"><span class="d_keyword">auto</span> constructor = <span class="d_keyword">new</span> Constructor();
<span class="d_keyword">auto</span> resolver = <span class="d_keyword">new</span> Resolver();
<span class="d_keyword">auto</span> resolver = <span class="d_keyword">new</span> Resolver();
<span class="d_comment">//Add constructor functions / resolver expressions here...
<span class="d_comment">// Add constructor functions / resolver expressions here...
</span>
<span class="d_keyword">auto</span> loader = <span class="d_psymbol">Loader</span>(<span class="d_string">"file.yaml"</span>);
loader.constructor = constructor;
loader.resolver = resolver;
<span class="d_keyword">auto</span> rootNode = loader.load(node);
loader.resolver = resolver;
<span class="d_keyword">auto</span> rootNode = loader.load(node);
</pre>
</div>
<dl><dt class="d_decl"><a name="Loader.this"></a>@trusted this(string <b>filename</b>);
<dl><dt class="d_decl"><a name="Loader.this"></a>@trusted this(string <b>filename</b>);
</dt>
<dd><p>Construct a Loader to load YAML from a file.
</p>
@ -113,37 +126,56 @@ loader.resolver = resolver;
<b>Throws:</b><div class="pbr">YAMLException if the file could not be opened or read.</div>
</dd>
<dt class="d_decl"><a name="Loader.fromString"></a>static Loader <a name="fromString"></a><span class="ddoc_psymbol">fromString</span>(string <b>data</b>);
<dt class="d_decl"><a name="Loader.fromString"></a>static @safe Loader <a name="fromString"></a><span class="ddoc_psymbol">fromString</span>(char[] <b>data</b>);
</dt>
<dd><p>Construct a Loader to load YAML from a string.
<dd><p>Construct a Loader to load YAML from a string (char []).
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>string <b>data</b></td>
<td valign=top>String to load YAML from.</td></tr>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>char[] <b>data</b></td>
<td valign=top>String to load YAML from. <b>will</b> be overwritten during
parsing as D:YAML reuses memory. Use <b>data</b>.dup if you don't
want to modify the original string.</td></tr>
</table></div>
<b>Returns:</b><div class="pbr">Loader loading YAML from given string.</div>
<b>Returns:</b><div class="pbr">Loader loading YAML from given string.
</div>
<b>Throws:</b><div class="pbr">YAMLException if <b>data</b> could not be read (e.g. a decoding error)</div>
<b>Examples:</b><div class="pbr"><pre class="d_code">
<span class="d_keyword">assert</span>(Loader.<span class="d_psymbol">fromString</span>(<span class="d_keyword">cast</span>(<span class="d_keyword">char</span>[])<span class="d_string">"42"</span>).load().as!<span class="d_keyword">int</span> == 42);
</pre>
</div>
</dd>
<dt class="d_decl"><a name="Loader.this"></a>@safe this(void[] <b>yamlData</b>);
</dt>
<dd><p>Construct a Loader to load YAML from a buffer.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>void[] <b>yamlData</b></td>
<td valign=top>Buffer with YAML data to load. This may be e.g. a file
loaded to memory or a string with YAML data. Note that
buffer <b>will</b> be overwritten, as D:YAML minimizes
memory allocations by reusing the input buffer.
<br>
<br>
Note that D:YAML looks for byte-order-marks YAML files encoded in
UTF-16/UTF-32 (and sometimes UTF-8) use to specify the encoding and
endianness, so it should be enough to load an entire file to a buffer and
pass it to D:YAML, regardless of Unicode encoding.</td></tr>
</table></div>
<b>Throws:</b><div class="pbr">YAMLException if <b>yamlData</b> contains data illegal in YAML.</div>
</dd>
<dt class="d_decl"><a name="Loader.this"></a>@safe this(Stream <b>stream</b>);
</dt>
<dd><p>Construct a Loader to load YAML from a stream.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>Stream <b>stream</b></td>
<td valign=top>Stream to read from. Must be readable and seekable.</td></tr>
</table></div>
<b>Throws:</b><div class="pbr">YAMLException if <b>stream</b> could not be read.</div>
</dd>
<dt class="d_decl"><a name="Loader.name"></a>pure nothrow @property @safe void <a name="name"></a><span class="ddoc_psymbol">name</span>(string <a name="name"></a><span class="ddoc_psymbol">name</span>);
<dt class="d_decl"><a name="Loader.name"></a>pure nothrow @nogc @safe void <a name="name"></a><span class="ddoc_psymbol">name</span>(string <a name="name"></a><span class="ddoc_psymbol">name</span>);
</dt>
<dd><p>Set stream name. Used in debugging messages.</p>
</dd>
<dt class="d_decl"><a name="Loader.resolver"></a>pure nothrow @property @safe void <a name="resolver"></a><span class="ddoc_psymbol">resolver</span>(Resolver <a name="resolver"></a><span class="ddoc_psymbol">resolver</span>);
<dt class="d_decl"><a name="Loader.resolver"></a>pure nothrow @nogc @safe void <a name="resolver"></a><span class="ddoc_psymbol">resolver</span>(Resolver <a name="resolver"></a><span class="ddoc_psymbol">resolver</span>);
</dt>
<dd><p>Specify custom Resolver to use.</p>
</dd>
<dt class="d_decl"><a name="Loader.constructor"></a>pure nothrow @property @safe void <a name="constructor"></a><span class="ddoc_psymbol">constructor</span>(Constructor <a name="constructor"></a><span class="ddoc_psymbol">constructor</span>);
<dt class="d_decl"><a name="Loader.constructor"></a>pure nothrow @nogc @safe void <a name="constructor"></a><span class="ddoc_psymbol">constructor</span>(Constructor <a name="constructor"></a><span class="ddoc_psymbol">constructor</span>);
</dt>
<dd><p>Specify custom Constructor to use.</p>
@ -165,14 +197,13 @@ loader.resolver = resolver;
or on a YAML parsing error.</div>
</dd>
<dt class="d_decl"><a name="Loader.loadAll"></a>@safe Node[] <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span>();
<dt class="d_decl"><a name="Loader.loadAll"></a>@trusted Node[] <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span>();
</dt>
<dd><p>Load all YAML documents.
</p>
<p>This is just a shortcut that iterates over all documents and returns
them all at once. Calling <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span> after iterating over the node or
vice versa will not return any documents, as they have all been parsed
already.
<p>This is just a shortcut that iterates over all documents and returns them
all at once. Calling <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span> after iterating over the node or vice versa
will not return any documents, as they have all been parsed already.
<br>
This can only be called once; this is enforced by contract.
@ -204,7 +235,7 @@ loader.resolver = resolver;
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.node - D:YAML 0.4 API documentation</title>
<title>dyaml.node - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -42,9 +41,10 @@
<h1>dyaml.node</h1>
<!-- Generated by Ddoc from dyaml/node.d -->
<p>Node of a YAML document. Used to read YAML data once it's loaded,
and to prepare data to emit.</p>
</p>
<p>and to prepare data to emit.</p>
<dl><dt class="d_decl"><a name="NodeException"></a>class <a name="NodeException"></a><span class="ddoc_psymbol">NodeException</span>: dyaml.exception.YAMLException;
<dl><dt class="d_decl"><a name="NodeException"></a>class <a name="NodeException"></a><span class="ddoc_psymbol">NodeException</span>: <u>dyaml.exception.YAMLException</u>;
</dt>
<dd><p>Exception thrown at node related errors.</p>
@ -68,43 +68,7 @@
sequence or mapping of nodes. You can get data from a <a name="Node"></a><span class="ddoc_psymbol">Node</span> directly or
iterate over it if it's a collection.</p>
<dl><dt class="d_decl"><a name="Node.Pair"></a>struct <a name="Pair"></a><span class="ddoc_psymbol">Pair</span>;
</dt>
<dd><p>Key-value pair of YAML nodes, used in mappings.</p>
<dl><dt class="d_decl"><a name="Node.Pair.key"></a>Node <a name="key"></a><span class="ddoc_psymbol">key</span>;
</dt>
<dd><p>Key node.</p>
</dd>
<dt class="d_decl"><a name="Node.Pair.value"></a>Node <a name="value"></a><span class="ddoc_psymbol">value</span>;
</dt>
<dd><p>Value node.</p>
</dd>
<dt class="d_decl"><a name="Node.Pair.this"></a>@safe this(K, V)(K <b>key</b>, V <b>value</b>);
</dt>
<dd><p>Construct a Pair from two values. Will be converted to Nodes if needed.</p>
</dd>
<dt class="d_decl"><a name="Node.Pair.opEquals"></a>const @safe bool <a name="opEquals"></a><span class="ddoc_psymbol">opEquals</span>(ref const Pair <b>rhs</b>);
</dt>
<dd><p>Equality test with another Pair.</p>
</dd>
<dt class="d_decl"><a name="Node.Pair.opAssign"></a>nothrow @safe void <a name="opAssign"></a><span class="ddoc_psymbol">opAssign</span>(Pair <b>rhs</b>);
</dt>
<dd><p>Assignment (shallow copy) by value.</p>
</dd>
<dt class="d_decl"><a name="Node.Pair.opAssign"></a>nothrow @safe void <a name="opAssign"></a><span class="ddoc_psymbol">opAssign</span>(ref Pair <b>rhs</b>);
</dt>
<dd><p>Assignment (shallow copy) by reference.</p>
</dd>
</dl>
</dd>
<dt class="d_decl"><a name="Node.this"></a>@trusted this(T)(T <b>value</b>, const string <b>tag</b> = null) if (isSomeString!T || !isArray!T &amp;&amp; !isAssociativeArray!T);
<dl><dt class="d_decl"><a name="Node.this"></a>@trusted this(T)(T <b>value</b>, const string <b>tag</b> = null) if (isSomeString!T || !isArray!T &amp;&amp; !isAssociativeArray!T);
</dt>
<dd><p>Construct a Node from a value.
</p>
@ -133,7 +97,7 @@
</table></div>
</dd>
<dt class="d_decl"><a name="Node.this"></a>@safe this(T)(T[] <b>array</b>, const string <b>tag</b> = null) if (!isSomeString!(T[]));
<dt class="d_decl"><a name="Node.this"></a>@safe this(T)(T[] <b>array</b>, const string <b>tag</b> = null) if (!isSomeString!(T[]));
</dt>
<dd><p>Construct a node from an array.
</p>
@ -155,15 +119,15 @@
must be in full form, e.g. "tag:yaml.org,2002:set",
not a shortcut, like "!!set".</td></tr>
</table></div>
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">//Will be emitted as a sequence (default for arrays)
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">// Will be emitted as a sequence (default for arrays)
</span><span class="d_keyword">auto</span> seq = Node([1, 2, 3, 4, 5]);
<span class="d_comment">//Will be emitted as a set (overriden tag)
<span class="d_comment">// Will be emitted as a set (overriden tag)
</span><span class="d_keyword">auto</span> set = Node([1, 2, 3, 4, 5], <span class="d_string">"tag:yaml.org,2002:set"</span>);
</pre>
</div>
</dd>
<dt class="d_decl"><a name="Node.this"></a>@safe this(K, V)(V[K] <b>array</b>, const string <b>tag</b> = null);
<dt class="d_decl"><a name="Node.this"></a>@safe this(K, V)(V[K] <b>array</b>, const string <b>tag</b> = null);
</dt>
<dd><p>Construct a node from an associative array.
</p>
@ -185,17 +149,17 @@
in full form, e.g. "tag:yaml.org,2002:omap", not a
shortcut, like "!!omap".</td></tr>
</table></div>
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">//Will be emitted as an unordered mapping (default for mappings)
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">// Will be emitted as an unordered mapping (default for mappings)
</span><span class="d_keyword">auto</span> map = Node([1 : <span class="d_string">"a"</span>, 2 : <span class="d_string">"b"</span>]);
<span class="d_comment">//Will be emitted as an ordered map (overriden tag)
<span class="d_comment">// Will be emitted as an ordered map (overriden tag)
</span><span class="d_keyword">auto</span> omap = Node([1 : <span class="d_string">"a"</span>, 2 : <span class="d_string">"b"</span>], <span class="d_string">"tag:yaml.org,2002:omap"</span>);
<span class="d_comment">//Will be emitted as pairs (overriden tag)
<span class="d_comment">// Will be emitted as pairs (overriden tag)
</span><span class="d_keyword">auto</span> pairs = Node([1 : <span class="d_string">"a"</span>, 2 : <span class="d_string">"b"</span>], <span class="d_string">"tag:yaml.org,2002:pairs"</span>);
</pre>
</div>
</dd>
<dt class="d_decl"><a name="Node.this"></a>@safe this(K, V)(K[] <b>keys</b>, V[] <b>values</b>, const string <b>tag</b> = null) if (!(isSomeString!(K[]) || isSomeString!(V[])));
<dt class="d_decl"><a name="Node.this"></a>@safe this(K, V)(K[] <b>keys</b>, V[] <b>values</b>, const string <b>tag</b> = null) if (!(isSomeString!(K[]) || isSomeString!(V[])));
</dt>
<dd><p>Construct a node from arrays of keys and values.
</p>
@ -231,11 +195,11 @@
in full form, e.g. "tag:yaml.org,2002:omap", not a
shortcut, like "!!omap".</td></tr>
</table></div>
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">//Will be emitted as an unordered mapping (default for mappings)
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_comment">// Will be emitted as an unordered mapping (default for mappings)
</span><span class="d_keyword">auto</span> map = Node([1, 2], [<span class="d_string">"a"</span>, <span class="d_string">"b"</span>]);
<span class="d_comment">//Will be emitted as an ordered map (overriden tag)
<span class="d_comment">// Will be emitted as an ordered map (overriden tag)
</span><span class="d_keyword">auto</span> omap = Node([1, 2], [<span class="d_string">"a"</span>, <span class="d_string">"b"</span>], <span class="d_string">"tag:yaml.org,2002:omap"</span>);
<span class="d_comment">//Will be emitted as pairs (overriden tag)
<span class="d_comment">// Will be emitted as pairs (overriden tag)
</span><span class="d_keyword">auto</span> pairs = Node([1, 2], [<span class="d_string">"a"</span>, <span class="d_string">"b"</span>], <span class="d_string">"tag:yaml.org,2002:pairs"</span>);
</pre>
</div>
@ -280,37 +244,39 @@
</dt>
<dd><p>Equality test.
</p>
<p>If T is Node, recursively compare all subnodes.
<p>If T is Node, recursively compares all subnodes.
This might be quite expensive if testing entire documents.
<br>
If T is not Node, get a value if type T from the node and test
If T is not Node, gets a value of type T from the node and tests
equality with that.
<br>
To test equality with a <b>null</b> YAML value, use YAMLNull.
</p>
<b>Examples:</b><div class="pbr"><pre class="d_code"><span class="d_keyword">auto</span> node = Node(42);
<span class="d_keyword">assert</span>(node == 42);
<span class="d_keyword">assert</span>(node != <span class="d_string">"42"</span>);
<span class="d_keyword">assert</span>(node != <span class="d_string">"43"</span>);
</pre>
</div>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>T rhs</td>
<td valign=top>Variable to test equality with.</td></tr>
</table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if equal, <b>false</b> otherwise.</div>
<b>Examples:</b><div class="pbr"><pre class="d_code">
<span class="d_keyword">auto</span> node = Node(42);
<span class="d_keyword">assert</span>(node == 42);
<span class="d_keyword">assert</span>(node != <span class="d_string">"42"</span>);
<span class="d_keyword">assert</span>(node != <span class="d_string">"43"</span>);
<span class="d_keyword">auto</span> node2 = Node(YAMLNull());
<span class="d_keyword">assert</span>(node2 == YAMLNull());
</pre>
</div>
</dd>
<dt class="d_decl"><a name="Node.as"></a>alias <a name="as"></a><span class="ddoc_psymbol">as</span> = get(T, Flag stringConversion = Yes.stringConversion)() if (!is(T == const));
</dt>
<dd><p>Shortcut for get().</p>
</dd>
<dt class="d_decl"><a name="Node.get"></a>@trusted T <a name="get"></a><span class="ddoc_psymbol">get</span>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() if (!is(T == const));
<dt class="d_decl"><a name="Node.get"></a>@property @trusted T <a name="get"></a><span class="ddoc_psymbol">get</span>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() if (!is(T == const));
</dt>
<dd><p>Get the value of the node as specified type.
</p>
@ -335,7 +301,7 @@
<br><b>Mapping default values:</b>
<br>
<div class="pbr">The '=' key can be used to denote the default value of a mapping.
<div class="pbr"> The '=' key can be used to denote the default value of a mapping.
This can be used when a node is scalar in early versions of a program,
but is replaced by a mapping later. Even if the node is a mapping, the
<a name="get"></a><span class="ddoc_psymbol">get</span> method can be used as if it was a scalar if it has a default value.
@ -344,7 +310,7 @@
</div>
</p>
<b>Examples:</b><div class="pbr">Automatic type conversion:
<b>Examples:</b><div class="pbr"> Automatic type conversion:
<pre class="d_code"><span class="d_keyword">auto</span> node = Node(42);
<span class="d_keyword">assert</span>(node.as!<span class="d_keyword">int</span> == 42);
@ -360,7 +326,7 @@
the value is out of range of requested type.</div>
</dd>
<dt class="d_decl"><a name="Node.get"></a>const @trusted T <a name="get"></a><span class="ddoc_psymbol">get</span>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() if (is(T == const));
<dt class="d_decl"><a name="Node.get"></a>const @property @trusted T <a name="get"></a><span class="ddoc_psymbol">get</span>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() if (is(T == const));
</dt>
<dd><p>Ditto.</p>
@ -378,7 +344,7 @@
<b>Throws:</b><div class="pbr">NodeException if this is not a sequence nor a mapping.</div>
</dd>
<dt class="d_decl"><a name="Node.opIndex"></a>@trusted Node <a name="opIndex"></a><span class="ddoc_psymbol">opIndex</span>(T)(T <b>index</b>);
<dt class="d_decl"><a name="Node.opIndex"></a>ref @trusted Node <a name="opIndex"></a><span class="ddoc_psymbol">opIndex</span>(T)(T <b>index</b>);
</dt>
<dd><p>Get the element at specified index.
</p>
@ -388,7 +354,8 @@
<br>
If the node is a mapping, return the value corresponding to the first
key equal to index.
key equal to index. containsKey() can be used to determine if a mapping
has a specific key.
<br>
To get element at a <b>null</b> index, use YAMLNull for index.
@ -403,7 +370,20 @@
<b>Throws:</b><div class="pbr">NodeException if the index could not be found,
non-integral index is used with a sequence or the node is
not a collection.</div>
<b>Examples:</b><div class="pbr"><pre class="d_code">
writeln(<span class="d_string">"D:YAML Node opIndex unittest"</span>);
<span class="d_keyword">alias</span> Node.Value Value;
<span class="d_keyword">alias</span> Node.Pair Pair;
Node narray = Node([11, 12, 13, 14]);
Node nmap = Node([<span class="d_string">"11"</span>, <span class="d_string">"12"</span>, <span class="d_string">"13"</span>, <span class="d_string">"14"</span>], [11, 12, 13, 14]);
<span class="d_keyword">assert</span>(narray[0].as!<span class="d_keyword">int</span> == 11);
<span class="d_keyword">assert</span>(<span class="d_keyword">null</span> !<span class="d_keyword">is</span> collectException(narray[42]));
<span class="d_keyword">assert</span>(nmap[<span class="d_string">"11"</span>].as!<span class="d_keyword">int</span> == 11);
<span class="d_keyword">assert</span>(nmap[<span class="d_string">"14"</span>].as!<span class="d_keyword">int</span> == 14);
</pre>
</div>
</dd>
<dt class="d_decl"><a name="Node.contains"></a>const @safe bool <a name="contains"></a><span class="ddoc_psymbol">contains</span>(T)(T <b>rhs</b>);
</dt>
@ -411,13 +391,10 @@
</p>
<p>If the node is a sequence, check if it <a name="contains"></a><span class="ddoc_psymbol">contains</span> the specified value.
If it's a mapping, check if it has a value that matches specified value.
<br>
To check for a <b>null</b> value, use YAMLNull for rhs.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>T rhs</td>
<td valign=top>Item to look for.</td></tr>
<td valign=top>Item to look for. Use YAMLNull to check for a <b>null</b> value.</td></tr>
</table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise.
@ -427,17 +404,10 @@
</dd>
<dt class="d_decl"><a name="Node.containsKey"></a>const @safe bool <a name="containsKey"></a><span class="ddoc_psymbol">containsKey</span>(T)(T <b>rhs</b>);
</dt>
<dd><p>Determine if a collection contains specified key.
</p>
<p>If the node is a mapping, check if it has a key
that matches specified key.
<br>
To check for a <b>null</b> key, use YAMLNull for rhs.
<dd><p>Determine if a mapping contains specified key.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>T rhs</td>
<td valign=top>Item to look for.</td></tr>
<td valign=top>Key to look for. Use YAMLNull to check for a <b>null</b> key.</td></tr>
</table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise.
@ -555,7 +525,7 @@
</table></div>
</dd>
<dt class="d_decl"><a name="Node.opBinaryRight"></a>@trusted Node* <a name="opBinaryRight"></a><span class="ddoc_psymbol">opBinaryRight</span>(string op, K)(K <b>key</b>) if (op == "in");
<dt class="d_decl"><a name="Node.opBinaryRight"></a>@system Node* <a name="opBinaryRight"></a><span class="ddoc_psymbol">opBinaryRight</span>(string op, K)(K <b>key</b>) if (op == "in");
</dt>
<dd><p>Determine whether a key is in a mapping, and access its value.
</p>
@ -633,7 +603,7 @@ Any modification to the node can invalidate the returned
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.representer - D:YAML 0.4 API documentation</title>
<title>dyaml.representer - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -46,7 +45,7 @@
</p>
<p>Code based on <a href="http://www.pyyaml.org">PyYAML</a>.</p>
<dl><dt class="d_decl"><a name="RepresenterException"></a>class <a name="RepresenterException"></a><span class="ddoc_psymbol">RepresenterException</span>: dyaml.exception.YAMLException;
<dl><dt class="d_decl"><a name="RepresenterException"></a>class <a name="RepresenterException"></a><span class="ddoc_psymbol">RepresenterException</span>: <u>dyaml.exception.YAMLException</u>;
</dt>
<dd><p>Exception thrown on Representer errors.</p>
@ -60,7 +59,7 @@
It can also override default node formatting styles for output.</p>
<dl><dt class="d_decl"><a name="Representer.this"></a>pure @safe this(const Flag!"<b>useDefaultRepresenters</b>" <b>useDefaultRepresenters</b> = Yes.<b>useDefaultRepresenters</b>);
<dl><dt class="d_decl"><a name="Representer.this"></a>pure @safe this(const Flag!"<b>useDefaultRepresenters</b>" <b>useDefaultRepresenters</b> = Yes.<b>useDefaultRepresenters</b>);
</dt>
<dd><p>Construct a Representer.
</p>
@ -79,7 +78,7 @@
</dd>
<dt class="d_decl"><a name="Representer.defaultCollectionStyle"></a>pure nothrow @property @safe void <a name="defaultCollectionStyle"></a><span class="ddoc_psymbol">defaultCollectionStyle</span>(CollectionStyle <b>style</b>);
</dt>
<dd><p>Set default style for collections. If <b>style</b> is <span class="d_inlinecode">CollectionStyle.Invalid</span>, the style is chosen automatically. </p>
<dd><p>Set default style for collections. If <b>style</b> is <span class="d_inlinecode">CollectionStyle.Invalid</span>, the style is chosen automatically.</p>
</dd>
<dt class="d_decl"><a name="Representer.addRepresenter"></a>pure @trusted void <a name="addRepresenter"></a><span class="ddoc_psymbol">addRepresenter</span>(T)(Node function(ref Node, Representer) <b>representer</b>);
@ -111,7 +110,7 @@
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>Node function(ref Node, Representer) representer</td>
<td valign=top>Representer function to add.</td></tr>
</table></div>
<b>Examples:</b><div class="pbr">Representing a simple struct:
<b>Examples:</b><div class="pbr"> Representing a simple struct:
<pre class="d_code"><span class="d_keyword">import</span> std.string;
<span class="d_keyword">import</span> dyaml.all;
@ -404,7 +403,7 @@ Node representMyStruct(<span class="d_keyword">ref</span> Node node, Representer
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.resolver - D:YAML 0.4 API documentation</title>
<title>dyaml.resolver - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -54,7 +53,7 @@
</p>
<p>Can be used to implicitly resolve custom data types of scalar values.</p>
<dl><dt class="d_decl"><a name="Resolver.this"></a>@safe this(Flag!"useDefaultImplicitResolvers" <b>defaultImplicitResolvers</b> = Yes.useDefaultImplicitResolvers);
<dl><dt class="d_decl"><a name="Resolver.this"></a>@safe this(Flag!"useDefaultImplicitResolvers" <b>defaultImplicitResolvers</b> = Yes.useDefaultImplicitResolvers);
</dt>
<dd><p>Construct a Resolver.
</p>
@ -89,7 +88,7 @@
<tr><td valign=top>string <b>first</b></td>
<td valign=top>String of possible starting characters of the scalar.</td></tr>
</table></div>
<b>Examples:</b><div class="pbr">Resolve scalars starting with 'A' to !tag :
<b>Examples:</b><div class="pbr"> Resolve scalars starting with 'A' to !tag :
<pre class="d_code"><span class="d_keyword">import</span> std.regex;
<span class="d_keyword">import</span> dyaml.all;
@ -133,7 +132,7 @@
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>dyaml.style - D:YAML 0.4 API documentation</title>
<title>dyaml.style - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -78,7 +77,7 @@
<dd><p>Collection styles.</p>
<dl><dt class="d_decl"><a name="CollectionStyle.Invalid"></a><a name="Invalid"></a><span class="ddoc_psymbol">Invalid</span></dt>
<dd><p><a name="Invalid"></a><span class="ddoc_psymbol">Invalid</span> (uninitialized) style </p>
<dd><p><a name="Invalid"></a><span class="ddoc_psymbol">Invalid</span> (uninitialized) style</p>
</dd>
<dt class="d_decl"><a name="CollectionStyle.Block"></a><a name="Block"></a><span class="ddoc_psymbol">Block</span></dt>
@ -96,7 +95,7 @@
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -4,13 +4,13 @@
<html lang='en'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>D:YAML 0.4 API documentation - D:YAML 0.4 API documentation</title>
<title>D:YAML 0.5 API documentation - D:YAML 0.5 API documentation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body><div id="top">
<div id="header">
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.4 API documentation</a>
<img id="logo" alt="D:YAML logo" src="images/logo.png"><a id="main-heading" href="index.html">D:YAML 0.5 API documentation</a>
</div>
</div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</a></li>
<li><a href="dyaml.dumper.html">dyaml.dumper</a></li>
<li><a href="dyaml.encoding.html">dyaml.encoding</a></li>
<li><a href="dyaml.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</a></li>
<li><a href="dyaml.linebreak.html">dyaml.linebreak</a></li>
@ -39,27 +38,26 @@
</div>
<div id="content">
<h1>D:YAML 0.4 API documentation</h1>
<h1>D:YAML 0.5 API documentation</h1>
<!-- Generated by Ddoc from ../doc/html/api/index.dd -->
<p>This is the complete API documentation for D:YAML. It describes all classes,
methods and global functions provided by the library. This is not the best place
to start learning how to use D:YAML. Rather, it should serve as a reference when
you need detailed information about every bit of D:YAML functionality. You can
find more introductory material in D:YAML <a href="../index.html">tutorials</a>.
<p>This is the complete API documentation for D:YAML. It describes all classes, methods and
global functions provided by the library. This is not the best place to start learning;
it should serve as a reference when detailed information about D:YAML functionality is
needed. To get started with D:YAML see <a href="../index.html">tutorials</a>.
</p>
<p>In this API documentation, each D:YAML module is documented separately. However,
to use D:YAML, you don't need to import these modules. All you need to do is
import the <i>yaml</i> module, which will import all needed modules.
<p>Although each D:YAML module is documented on a separate page, you don't need to import
individual modules. Importing the <i>yaml</i> module automatically imports all D:YAML
functionality.
</p>
</div>
<div id="copyright">
Copyright &copy; Ferdinand Majerech 2011. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Copyright &copy; Ferdinand Majerech 2011-2014. Based on <a href="http://www.pyyaml.org">PyYAML</a> by Kirill Simonov. |
Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div>

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Differences between D:YAML and the YAML specification &mdash; D:YAML 0.4 documentation</title>
<title>Differences between D:YAML and the YAML specification &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.4',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="../index.html" />
<link rel="top" title="D:YAML 0.5 documentation" href="../index.html" />
<link rel="prev" title="YAML syntax" href="../tutorials/yaml_syntax.html" />
</head>
<body>
@ -35,7 +33,7 @@
<li class="right" style="margin-right: 10px">
<a href="../tutorials/yaml_syntax.html" title="YAML syntax"
accesskey="P">previous</a></li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -136,13 +134,13 @@ struct appears in Phobos.</p>
<li class="right" style="margin-right: 10px">
<a href="../tutorials/yaml_syntax.html" title="YAML syntax"
>previous</a></li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to D:YAML documentation! &mdash; D:YAML 0.4 documentation</title>
<title>Welcome to D:YAML documentation! &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.4',
URL_ROOT: './',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="#" />
<link rel="top" title="D:YAML 0.5 documentation" href="#" />
<link rel="next" title="Getting started" href="tutorials/getting_started.html" />
</head>
<body>
@ -35,7 +33,7 @@
<li class="right" style="margin-right: 10px">
<a href="tutorials/getting_started.html" title="Getting started"
accesskey="N">next</a></li>
<li><a href="#">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="#">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -102,13 +100,13 @@
<li class="right" style="margin-right: 10px">
<a href="tutorials/getting_started.html" title="Getting started"
>next</a></li>
<li><a href="#">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="#">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

Binary file not shown.

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; D:YAML 0.4 documentation</title>
<title>Search &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.4',
URL_ROOT: './',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -26,18 +24,20 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="index.html" />
<link rel="top" title="D:YAML 0.5 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
<script type="text/javascript" id="searchindexloader"></script>
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li><a href="index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -85,13 +85,13 @@
<div class="related">
<h3>Navigation</h3>
<ul>
<li><a href="index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Custom YAML data types &mdash; D:YAML 0.4 documentation</title>
<title>Custom YAML data types &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.4',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="../index.html" />
<link rel="top" title="D:YAML 0.5 documentation" href="../index.html" />
<link rel="next" title="YAML syntax" href="yaml_syntax.html" />
<link rel="prev" title="Getting started" href="getting_started.html" />
</head>
@ -39,7 +37,7 @@
<li class="right" >
<a href="getting_started.html" title="Getting started"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -113,6 +111,7 @@ CSS-like format, RRGGBB, or from a mapping, where we use the following format:
<span class="c1">//Get value of a hex digit.</span>
<span class="kt">uint</span> <span class="n">hex</span><span class="p">(</span><span class="kt">char</span> <span class="n">c</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">import</span> <span class="n">std</span><span class="p">.</span><span class="n">ascii</span><span class="p">;</span>
<span class="k">if</span><span class="p">(!</span><span class="n">std</span><span class="p">.</span><span class="n">ascii</span><span class="p">.</span><span class="n">isHexDigit</span><span class="p">(</span><span class="n">c</span><span class="p">))</span>
<span class="p">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">Exception</span><span class="p">(</span><span class="s">&quot;Invalid color: &quot;</span> <span class="p">~</span> <span class="n">value</span><span class="p">);</span>
@ -372,13 +371,13 @@ directory of the D:YAML package.</p>
<li class="right" >
<a href="getting_started.html" title="Getting started"
>previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Getting started &mdash; D:YAML 0.4 documentation</title>
<title>Getting started &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.4',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="../index.html" />
<link rel="top" title="D:YAML 0.5 documentation" href="../index.html" />
<link rel="next" title="Custom YAML data types" href="custom_types.html" />
<link rel="prev" title="Welcome to D:YAML documentation!" href="../index.html" />
</head>
@ -39,7 +37,7 @@
<li class="right" >
<a href="../index.html" title="Welcome to D:YAML documentation!"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -65,9 +63,8 @@ Download the version of DMD for your operating system and install it.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Other D compilers exist, such as
<a class="reference external" href="http://bitbucket.org/goshawk/gdc/wiki/Home">GDC</a> and
<a class="reference external" href="http://www.dsource.org/projects/ldc/">LDC</a>. Setting up with either one of
them should be similar to DMD, but they are not yet as stable as DMD.</p>
<a class="reference external" href="http://gdcproject.org/">GDC</a> and
<a class="reference external" href="http://bitbucket.org/goshawk/gdc/wiki/Home">LDC</a>.</p>
</div>
</div>
<div class="section" id="download-and-compile-d-yaml">
@ -78,11 +75,13 @@ it, and move to the extracted directory.</p>
<p>D:YAML uses a modified version of the <a class="reference external" href="http://dsource.org/projects/cdc/">CDC</a>
script for compilation. To compile D:YAML, you first need to build CDC.
Do this by typing the following command into the console:</p>
<div class="highlight-python"><pre>dmd cdc.d</pre>
<div class="highlight-python"><div class="highlight"><pre>dmd cdc.d
</pre></div>
</div>
<p>Now compile D:YAML with CDC.
To do this on Unix/Linux, use the following command:</p>
<div class="highlight-python"><pre>./cdc</pre>
<div class="highlight-python"><div class="highlight"><pre>./cdc
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cdc</span><span class="o">.</span><span class="n">exe</span>
@ -106,7 +105,7 @@ To do this on Unix/Linux, use the following command:</p>
<p>Now we need to parse it. Create a file called <tt class="docutils literal"><span class="pre">main.d</span></tt>. Paste following code
into the file:</p>
<div class="highlight-d"><div class="highlight"><pre><span class="k">import</span> <span class="n">std</span><span class="p">.</span><span class="n">stdio</span><span class="p">;</span>
<span class="k">import</span> <span class="n">dyaml</span><span class="p">.</span><span class="n">all</span><span class="p">;</span>
<span class="k">import</span> <span class="n">yaml</span><span class="p">;</span>
<span class="kt">void</span> <span class="n">main</span><span class="p">()</span>
<span class="p">{</span>
@ -127,7 +126,7 @@ into the file:</p>
</div>
<div class="section" id="explanation-of-the-code">
<h3>Explanation of the code<a class="headerlink" href="#explanation-of-the-code" title="Permalink to this headline"></a></h3>
<p>First, we import the <em>dyaml.all</em> module. This is the only D:YAML module you
<p>First, we import the <em>yaml</em> module. This is the only D:YAML module you
need to import - it automatically imports all needed modules.</p>
<p>Next we load the file using the <em>Loader.load()</em> method. <em>Loader</em> is a struct
used for parsing YAML documents. The <em>load()</em> method loads the file as
@ -174,16 +173,19 @@ directory.</p>
<p>For example, if you extracted and compiled D:YAML in <tt class="docutils literal"><span class="pre">/home/xxx/dyaml</span></tt>, your
project is in <tt class="docutils literal"><span class="pre">/home/xxx/dyaml-project</span></tt>, and you are currently in that
directory, compile the project with the following command on Unix/Linux:</p>
<div class="highlight-python"><pre>dmd -I../dyaml/source -L-L../dyaml -L-ldyaml main.d</pre>
<div class="highlight-python"><div class="highlight"><pre>dmd -I../dyaml/source -L-L../dyaml -L-ldyaml main.d
</pre></div>
</div>
<p>And the following on Windows:</p>
<div class="highlight-python"><pre>dmd -I../dyaml/source ../dyaml/libdyaml.lib main.d</pre>
<div class="highlight-python"><div class="highlight"><pre>dmd -I../dyaml/source ../dyaml/libdyaml.lib main.d
</pre></div>
</div>
<p>This will produce an executable called <tt class="docutils literal"><span class="pre">main</span></tt> or <tt class="docutils literal"><span class="pre">main.exe</span></tt> in your
directory. When you run it, it should produce the following output:</p>
<div class="highlight-python"><pre>Hello
<div class="highlight-python"><div class="highlight"><pre>Hello
World
The answer is 42</pre>
The answer is 42
</pre></div>
</div>
</div>
<div class="section" id="conclusion">
@ -235,13 +237,13 @@ example in the <tt class="docutils literal"><span class="pre">example/getting_st
<li class="right" >
<a href="../index.html" title="Welcome to D:YAML documentation!"
>previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>YAML syntax &mdash; D:YAML 0.4 documentation</title>
<title>YAML syntax &mdash; D:YAML 0.5 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.4',
VERSION: '0.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="D:YAML 0.4 documentation" href="../index.html" />
<link rel="top" title="D:YAML 0.5 documentation" href="../index.html" />
<link rel="next" title="Differences between D:YAML and the YAML specification" href="../articles/spec_differences.html" />
<link rel="prev" title="Custom YAML data types" href="custom_types.html" />
</head>
@ -39,7 +37,7 @@
<li class="right" >
<a href="custom_types.html" title="Custom YAML data types"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
@ -252,8 +250,8 @@ supports implicit resolution for custom, user specified tags.</p>
Some of these might change in the future (especially !!map and !!set).</p>
<table border="1" class="docutils">
<colgroup>
<col width="58%" />
<col width="42%" />
<col width="52%" />
<col width="48%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">YAML tag</th>
@ -277,13 +275,13 @@ Some of these might change in the future (especially !!map and !!set).</p>
<td>ubyte[]</td>
</tr>
<tr class="row-odd"><td>!!timestamp</td>
<td>datetime.SysTime</td>
<td>std.datetime.SysTime</td>
</tr>
<tr class="row-even"><td>!!map, !!omap, !!pairs</td>
<td>Node.Pair[]</td>
<td>yaml.Node.Pair[]</td>
</tr>
<tr class="row-odd"><td>!!seq, !!set</td>
<td>Node[]</td>
<td>yaml.Node[]</td>
</tr>
<tr class="row-even"><td>!!str</td>
<td>string</td>
@ -328,13 +326,13 @@ Some of these might change in the future (especially !!map and !!set).</p>
<li class="right" >
<a href="custom_types.html" title="Custom YAML data types"
>previous</a> |</li>
<li><a href="../index.html">D:YAML 0.4 documentation</a> &raquo;</li>
<li><a href="../index.html">D:YAML 0.5 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Last updated on Aug 01, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>