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 # 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. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 076a83227d143ba3c8deaf98c02a01e9 config: 4cd0b7d9cdc8d1c058e809aa7e0397b3
tags: fbb0d17656682115ca4d033fb2f83ba1 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. //Get value of a hex digit.
uint hex(char c) uint hex(char c)
{ {
import std.ascii;
if(!std.ascii.isHexDigit(c)) if(!std.ascii.isHexDigit(c))
{ {
throw new Exception("Invalid color: " ~ value); 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:: .. note::
Other D compilers exist, such as Other D compilers exist, such as
`GDC <http://bitbucket.org/goshawk/gdc/wiki/Home>`_ and `GDC <http://gdcproject.org/>`_ and
`LDC <http://www.dsource.org/projects/ldc/>`_. Setting up with either one of `LDC <http://bitbucket.org/goshawk/gdc/wiki/Home>`_.
them should be similar to DMD, but they are not yet as stable as DMD.
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Download and compile D:YAML Download and compile D:YAML
@ -77,7 +76,7 @@ into the file:
.. code-block:: d .. code-block:: d
import std.stdio; import std.stdio;
import dyaml.all; import yaml;
void main() void main()
{ {
@ -100,7 +99,7 @@ into the file:
Explanation of the code 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. need to import - it automatically imports all needed modules.
Next we load the file using the *Loader.load()* method. *Loader* is a struct 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. 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). Some of these might change in the future (especially !!map and !!set).
====================== ================ ====================== ====================
YAML tag D type YAML tag D type
====================== ================ ====================== ====================
!!null yaml.YAMLNull !!null yaml.YAMLNull
!!bool bool !!bool bool
!!int long !!int long
!!float real !!float real
!!binary ubyte[] !!binary ubyte[]
!!timestamp datetime.SysTime !!timestamp std.datetime.SysTime
!!map, !!omap, !!pairs Node.Pair[] !!map, !!omap, !!pairs yaml.Node.Pair[]
!!seq, !!set Node[] !!seq, !!set yaml.Node[]
!!str string !!str string
====================== ================ ====================== ====================

View file

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

View file

@ -4,7 +4,7 @@
* *
* Sphinx stylesheet -- default theme. * 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. * :license: BSD, see LICENSE for details.
* *
*/ */

View file

@ -4,7 +4,7 @@
* *
* Sphinx JavaScript utilities for all documentation. * 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. * :license: BSD, see LICENSE for details.
* *
*/ */
@ -32,7 +32,7 @@ if (!window.console || !console.firebug) {
*/ */
jQuery.urldecode = function(x) { jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' '); return decodeURIComponent(x).replace(/\+/g, ' ');
} };
/** /**
* small helper function to urlencode strings * small helper function to urlencode strings
@ -61,18 +61,6 @@ jQuery.getQueryParameters = function(s) {
return result; 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 * highlight a given string on a jquery object by wrapping it in
* span elements with the given class name. * span elements with the given class name.
@ -180,6 +168,9 @@ var Documentation = {
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) { if (terms.length) {
var body = $('div.body'); var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() { window.setTimeout(function() {
$.each(terms, function() { $.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted'); 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. * 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. * :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 * 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 * Search Module
*/ */
@ -239,8 +244,13 @@ var Search = {
}, },
loadIndex : function(url) { loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null, success: null, $.ajax({type: "GET", url: url, data: null,
dataType: "script", cache: true}); dataType: "script", cache: true,
complete: function(jqxhr, textstatus) {
if (textstatus != "success") {
document.getElementById("searchindexloader").src = url;
}
}});
}, },
setIndex : function(index) { setIndex : function(index) {
@ -268,19 +278,20 @@ var Search = {
if (this._pulse_status >= 0) if (this._pulse_status >= 0)
return; return;
function pulse() { function pulse() {
var i;
Search._pulse_status = (Search._pulse_status + 1) % 4; Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = ''; var dotString = '';
for (var i = 0; i < Search._pulse_status; i++) for (i = 0; i < Search._pulse_status; i++)
dotString += '.'; dotString += '.';
Search.dots.text(dotString); Search.dots.text(dotString);
if (Search._pulse_status > -1) if (Search._pulse_status > -1)
window.setTimeout(pulse, 500); window.setTimeout(pulse, 500);
}; }
pulse(); pulse();
}, },
/** /**
* perform a search for something * perform a search for something (or wait until index is loaded)
*/ */
performSearch : function(query) { performSearch : function(query) {
// create the required interface elements // create the required interface elements
@ -300,41 +311,46 @@ var Search = {
this.deferQuery(query); this.deferQuery(query);
}, },
/**
* execute search (requires search index to be loaded)
*/
query : function(query) { 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 stemmer = new Stemmer();
var searchterms = []; var searchterms = [];
var excluded = []; var excluded = [];
var hlterms = []; var hlterms = [];
var tmp = query.split(/\s+/); var tmp = query.split(/\s+/);
var objectterms = []; var objectterms = [];
for (var i = 0; i < tmp.length; i++) { for (i = 0; i < tmp.length; i++) {
if (tmp[i] != "") { if (tmp[i] !== "") {
objectterms.push(tmp[i].toLowerCase()); objectterms.push(tmp[i].toLowerCase());
} }
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") { tmp[i] === "") {
// skip this "word" // skip this "word"
continue; continue;
} }
// stem the word // stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase(); var word = stemmer.stemWord(tmp[i].toLowerCase());
var toAppend;
// select the correct list // select the correct list
if (word[0] == '-') { if (word[0] == '-') {
var toAppend = excluded; toAppend = excluded;
word = word.substr(1); word = word.substr(1);
} }
else { else {
var toAppend = searchterms; toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase()); hlterms.push(tmp[i].toLowerCase());
} }
// only add if not already in the list // only add if not already in the list
if (!$.contains(toAppend, word)) if (!$u.contains(toAppend, word))
toAppend.push(word); toAppend.push(word);
}; }
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:'); // console.debug('SEARCH: searching for:');
@ -342,89 +358,51 @@ var Search = {
// console.info('excluded: ', excluded); // console.info('excluded: ', excluded);
// prepare search // prepare search
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms; var terms = this._index.terms;
var fileMap = {}; var titleterms = this._index.titleterms;
var files = null;
// different result priorities // array of [filename, title, anchor, descr, score]
var importantResults = []; var results = [];
var objectResults = [];
var regularResults = [];
var unimportantResults = [];
$('#search-progress').empty(); $('#search-progress').empty();
// lookup as object // lookup as object
for (var i = 0; i < objectterms.length; i++) { for (i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i), var others = [].concat(objectterms.slice(0, i),
objectterms.slice(i+1, objectterms.length)) objectterms.slice(i+1, objectterms.length));
var results = this.performObjectSearch(objectterms[i], others); results = results.concat(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);
} }
// perform the search on the required terms // lookup as search terms in fulltext
for (var i = 0; i < searchterms.length; i++) { results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
var word = searchterms[i]; .concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
// no match but word was a required one
if ((files = terms[word]) == null) // let the scorer override scores with a custom scoring function
break; if (Scorer.score) {
if (files.length == undefined) { for (i = 0; i < results.length; i++)
files = [files]; results[i][4] = Scorer.score(results[i]);
}
// 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];
}
} }
// now check if the files don't contain excluded terms // now sort the results by score (in opposite order of appearance, since the
for (var file in fileMap) { // display function below uses pop() to retrieve items) and then
var valid = true; // alphabetically
results.sort(function(a, b) {
// check if all requirements are matched var left = a[4];
if (fileMap[file].length != searchterms.length) var right = b[4];
continue; if (left > right) {
return 1;
// ensure that none of the excluded terms is in the } else if (left < right) {
// search result. return -1;
for (var i = 0; i < excluded.length; i++) { } else {
if (terms[excluded[i]] == file || // same score: sort alphabetically
$.contains(terms[excluded[i]] || [], file)) { left = a[1].toLowerCase();
valid = false; right = b[1].toLowerCase();
break; 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 // for debugging
var results = unimportantResults.concat(regularResults) //Search.lastresults = results.slice(); // a copy
.concat(objectResults).concat(importantResults); //console.info('search results:', Search.lastresults);
// print the results // print the results
var resultCount = results.length; var resultCount = results.length;
@ -433,7 +411,7 @@ var Search = {
if (results.length) { if (results.length) {
var item = results.pop(); var item = results.pop();
var listItem = $('<li style="display:none"></li>'); var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
// dirhtml builder // dirhtml builder
var dirname = item[0] + '/'; var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) { if (dirname.match(/\/index\/$/)) {
@ -457,16 +435,18 @@ var Search = {
displayNextItem(); displayNextItem();
}); });
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
item[0] + '.txt', function(data) { dataType: "text",
if (data != '') { complete: function(jqxhr, textstatus) {
listItem.append($.makeSearchSummary(data, searchterms, hlterms)); var data = jqxhr.responseText;
Search.output.append(listItem); if (data !== '') {
} listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
listItem.slideDown(5, function() { }
displayNextItem(); Search.output.append(listItem);
}); listItem.slideDown(5, function() {
}, "text"); displayNextItem();
});
}});
} else { } else {
// no source available, just display title // no source available, just display title
Search.output.append(listItem); Search.output.append(listItem);
@ -489,20 +469,32 @@ var Search = {
displayNextItem(); displayNextItem();
}, },
/**
* search for object names
*/
performObjectSearch : function(object, otherterms) { performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames; var filenames = this._index.filenames;
var objects = this._index.objects; var objects = this._index.objects;
var objnames = this._index.objnames; var objnames = this._index.objnames;
var titles = this._index.titles; var titles = this._index.titles;
var importantResults = []; var i;
var objectResults = []; var results = [];
var unimportantResults = [];
for (var prefix in objects) { for (var prefix in objects) {
for (var name in objects[prefix]) { for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name; var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) { 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 match = objects[prefix][name];
var objname = objnames[match[1]][2]; var objname = objnames[match[1]][2];
var title = titles[match[0]]; var title = titles[match[0]];
@ -512,7 +504,7 @@ var Search = {
var haystack = (prefix + ' ' + name + ' ' + var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase(); objname + ' ' + title).toLowerCase();
var allfound = true; var allfound = true;
for (var i = 0; i < otherterms.length; i++) { for (i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) { if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false; allfound = false;
break; break;
@ -523,37 +515,107 @@ var Search = {
} }
} }
var descr = objname + _(', in ') + title; var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '') var anchor = match[3];
if (anchor === '')
anchor = fullname; anchor = fullname;
else if (anchor == '-') else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname; anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr]; // add custom score for some objects according to scorer
switch (match[2]) { if (Scorer.objPrio.hasOwnProperty(match[2])) {
case 1: objectResults.push(result); break; score += Scorer.objPrio[match[2]];
case 0: importantResults.push(result); break; } else {
case 2: unimportantResults.push(result); break; score += Scorer.objPrioDefault;
} }
results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
} }
} }
} }
// sort results descending return results;
objectResults.sort(function(a, b) { },
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
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) { var i, j, file, files;
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); 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() { $(document).ready(function() {
Search.init(); Search.init();

View file

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

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -45,28 +44,7 @@
nodes. This can be used to implement custom data types. A tutorial can be nodes. This can be used to implement custom data types. A tutorial can be
found <a href="../tutorials/custom_types.html">here</a>.</p> 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; <dl><dt class="d_decl"><a name="Constructor"></a>class <a name="Constructor"></a><span class="ddoc_psymbol">Constructor</span>;
</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>;
</dt> </dt>
<dd><p>Constructs YAML values. <dd><p>Constructs YAML values.
</p> </p>
@ -85,12 +63,18 @@
If a tag is detected with no known constructor function, it is considered an error.</p> 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> </dt>
<dd><p>Construct a Constructor. <dd><p>Construct a Constructor.
</p> </p>
<p>If you don't want to support default YAML tags/data types, you can use <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> </p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>Flag!"useDefaultConstructors" <b>defaultConstructors</b></td> <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. <dd><p>Add a constructor function from scalar.
</p> </p>
<p>The function must take a reference to <span class="d_inlinecode">Node</span> to construct from. <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 The node contains a string for scalars, <span class="d_inlinecode">Node[]</span> for sequences and
for mappings. <span class="d_inlinecode">Node.Pair[]</span> for mappings.
<br> <br>
Any exception thrown by this function will be caught by D:YAML and 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. the user which type failed to construct, and position in the file.
<br> <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 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_comment">//!mystruct x:y:z
</span> <span class="d_keyword">auto</span> parts = node.as!string().split(<span class="d_string">":"</span>); </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])); </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>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -56,7 +55,7 @@
Setters are provided to affect output details (style, encoding, etc.). Setters are provided to affect output details (style, encoding, etc.).
</p> </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]); <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); <span class="d_psymbol">Dumper</span>(<span class="d_string">"file.yaml"</span>).dump(node);
</pre> </pre>
@ -96,7 +95,7 @@ dumper.dump(node);
</pre> </pre>
</div> </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> </dt>
<dd><p>Construct a Dumper writing to a file. <dd><p>Construct a Dumper writing to a file.
</p> </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> <b>Throws:</b><div class="pbr">YAMLException if the file can not be dumped to (e.g. cannot be opened).</div>
</dd> </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> </dt>
<dd><p>Construct a Dumper writing to a stream. This is useful to e.g. write to memory.</p> <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>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </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'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -43,30 +42,14 @@
<!-- Generated by Ddoc from dyaml/exception.d --> <!-- Generated by Ddoc from dyaml/exception.d -->
<p>Exceptions thrown by D:YAML and exception related code.</p> <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> </dt>
<dd><p>Base class for all exceptions thrown by D:YAML.</p> <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> </dt>
<dd><p>Construct a YAMLException with specified message and position where it was thrown.</p> <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> </dd>
</dl> </dl>
</dd> </dd>
@ -75,7 +58,7 @@
</div> </div>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -41,12 +40,11 @@
<div id="content"> <div id="content">
<h1>dyaml.hacks</h1> <h1>dyaml.hacks</h1>
<!-- Generated by Ddoc from dyaml/hacks.d --> <!-- Generated by Ddoc from dyaml/hacks.d -->
<p>Functionality that may be sometimes needed but allows unsafe or unstandard <p>Functionality that may sometimes be needed but allows unsafe or unstandard behavior, and should only be used in specific cases.</p>
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>); <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> </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>
<p>This is only useful for nodes loaded from files. <p>This is only useful for nodes loaded from files.
<br> <br>
@ -75,6 +73,10 @@
<dd><p>Get the collection style a YAML <b>node</b> had in the file it was loaded from. <dd><p>Get the collection style a YAML <b>node</b> had in the file it was loaded from.
</p> </p>
<p>May only be called on collection nodes (nodes where <b>node</b>.isScalar() != <b>true</b>). <p>May only be called on collection nodes (nodes where <b>node</b>.isScalar() != <b>true</b>).
<br>
<br>
</p> </p>
<b>See Also:</b><div class="pbr">scalarStyleHack</div> <b>See Also:</b><div class="pbr">scalarStyleHack</div>
@ -82,13 +84,19 @@
</dd> </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 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> </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>
<p>Setting the style might be useful when generating YAML or reformatting existing <p>Setting the style might be useful when generating YAML or reformatting existing
files.
<br> <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"> <b>Examples:</b><div class="pbr"><pre class="d_code">
writeln(<span class="d_string">"D:YAML scalarStyleHack setter unittest"</span>); 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); <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> </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 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> </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>
<p>Setting the style might be useful when generating YAML or reformatting existing <p>Setting the style might be useful when generating YAML or reformatting existing
files.
<br> <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"> <b>Examples:</b><div class="pbr"><pre class="d_code">
writeln(<span class="d_string">"D:YAML collectionStyleHack setter unittest"</span>); 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]); <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>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -65,7 +64,7 @@
</div> </div>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -51,7 +50,7 @@
tags / data types. tags / data types.
</p> </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 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> </pre>
@ -73,37 +72,51 @@
</pre> </pre>
<br> <br>
Load YAML from memory: Load YAML from a string:
<pre class="d_code"><span class="d_keyword">import</span> std.stream; <pre class="d_code"><span class="d_keyword">char</span>[] yaml_input = <span class="d_string">"red: '#ff0000'\n"</span>
<span class="d_keyword">import</span> std.stdio;
string yaml_input = <span class="d_string">"red: '#ff0000'\n"</span>
<span class="d_string">"green: '#00ff00'\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">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">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>); writeln(color, <span class="d_string">" is "</span>, value, <span class="d_string">" in HTML/CSS"</span>);
} }
</pre> </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> <br>
Use a custom constructor/resolver to support custom data types and/or implicit tags: Use a custom constructor/resolver to support custom data types and/or implicit tags:
<pre class="d_code"><span class="d_keyword">auto</span> constructor = <span class="d_keyword">new</span> Constructor(); <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>
<span class="d_keyword">auto</span> loader = <span class="d_psymbol">Loader</span>(<span class="d_string">"file.yaml"</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.constructor = constructor;
loader.resolver = resolver; loader.resolver = resolver;
<span class="d_keyword">auto</span> rootNode = loader.load(node); <span class="d_keyword">auto</span> rootNode = loader.load(node);
</pre> </pre>
</div> </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> </dt>
<dd><p>Construct a Loader to load YAML from a file. <dd><p>Construct a Loader to load YAML from a file.
</p> </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> <b>Throws:</b><div class="pbr">YAMLException if the file could not be opened or read.</div>
</dd> </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> </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> </p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>string <b>data</b></td> <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.</td></tr> <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> </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> </dd>
<dt class="d_decl"><a name="Loader.this"></a>@safe this(Stream <b>stream</b>); <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>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> </dt>
<dd><p>Set stream name. Used in debugging messages.</p> <dd><p>Set stream name. Used in debugging messages.</p>
</dd> </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> </dt>
<dd><p>Specify custom Resolver to use.</p> <dd><p>Specify custom Resolver to use.</p>
</dd> </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> </dt>
<dd><p>Specify custom Constructor to use.</p> <dd><p>Specify custom Constructor to use.</p>
@ -165,14 +197,13 @@ loader.resolver = resolver;
or on a YAML parsing error.</div> or on a YAML parsing error.</div>
</dd> </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> </dt>
<dd><p>Load all YAML documents. <dd><p>Load all YAML documents.
</p> </p>
<p>This is just a shortcut that iterates over all documents and returns <p>This is just a shortcut that iterates over all documents and returns them
them all at once. Calling <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span> after iterating over the node or all at once. Calling <a name="loadAll"></a><span class="ddoc_psymbol">loadAll</span> after iterating over the node or vice versa
vice versa will not return any documents, as they have all been parsed will not return any documents, as they have all been parsed already.
already.
<br> <br>
This can only be called once; this is enforced by contract. This can only be called once; this is enforced by contract.
@ -204,7 +235,7 @@ loader.resolver = resolver;
</div> </div>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -42,9 +41,10 @@
<h1>dyaml.node</h1> <h1>dyaml.node</h1>
<!-- Generated by Ddoc from dyaml/node.d --> <!-- Generated by Ddoc from dyaml/node.d -->
<p>Node of a YAML document. Used to read YAML data once it's loaded, <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> </dt>
<dd><p>Exception thrown at node related errors.</p> <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 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> 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>; <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>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);
</dt> </dt>
<dd><p>Construct a Node from a value. <dd><p>Construct a Node from a value.
</p> </p>
@ -133,7 +97,7 @@
</table></div> </table></div>
</dd> </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> </dt>
<dd><p>Construct a node from an array. <dd><p>Construct a node from an array.
</p> </p>
@ -155,15 +119,15 @@
must be in full form, e.g. "tag:yaml.org,2002:set", must be in full form, e.g. "tag:yaml.org,2002:set",
not a shortcut, like "!!set".</td></tr> not a shortcut, like "!!set".</td></tr>
</table></div> </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><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>); </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> </pre>
</div> </div>
</dd> </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> </dt>
<dd><p>Construct a node from an associative array. <dd><p>Construct a node from an associative array.
</p> </p>
@ -185,17 +149,17 @@
in full form, e.g. "tag:yaml.org,2002:omap", not a in full form, e.g. "tag:yaml.org,2002:omap", not a
shortcut, like "!!omap".</td></tr> shortcut, like "!!omap".</td></tr>
</table></div> </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><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><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>); </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> </pre>
</div> </div>
</dd> </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> </dt>
<dd><p>Construct a node from arrays of keys and values. <dd><p>Construct a node from arrays of keys and values.
</p> </p>
@ -231,11 +195,11 @@
in full form, e.g. "tag:yaml.org,2002:omap", not a in full form, e.g. "tag:yaml.org,2002:omap", not a
shortcut, like "!!omap".</td></tr> shortcut, like "!!omap".</td></tr>
</table></div> </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><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><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>); </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> </pre>
</div> </div>
@ -280,37 +244,39 @@
</dt> </dt>
<dd><p>Equality test. <dd><p>Equality test.
</p> </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. This might be quite expensive if testing entire documents.
<br> <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. equality with that.
<br> <br>
To test equality with a <b>null</b> YAML value, use YAMLNull. To test equality with a <b>null</b> YAML value, use YAMLNull.
</p> </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> <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> <td valign=top>Variable to test equality with.</td></tr>
</table></div> </table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if equal, <b>false</b> otherwise.</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> </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 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> </dt>
<dd><p>Shortcut for get().</p> <dd><p>Shortcut for get().</p>
</dd> </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> </dt>
<dd><p>Get the value of the node as specified type. <dd><p>Get the value of the node as specified type.
</p> </p>
@ -335,7 +301,7 @@
<br><b>Mapping default values:</b> <br><b>Mapping default values:</b>
<br> <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, 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 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. <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> </div>
</p> </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); <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); <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> the value is out of range of requested type.</div>
</dd> </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> </dt>
<dd><p>Ditto.</p> <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> <b>Throws:</b><div class="pbr">NodeException if this is not a sequence nor a mapping.</div>
</dd> </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> </dt>
<dd><p>Get the element at specified index. <dd><p>Get the element at specified index.
</p> </p>
@ -388,7 +354,8 @@
<br> <br>
If the node is a mapping, return the value corresponding to the first 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> <br>
To get element at a <b>null</b> index, use YAMLNull for index. 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, <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 non-integral index is used with a sequence or the node is
not a collection.</div> 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> </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 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> </dt>
@ -411,13 +391,10 @@
</p> </p>
<p>If the node is a sequence, check if it <a name="contains"></a><span class="ddoc_psymbol">contains</span> the specified value. <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. 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> </p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>T rhs</td> <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> </table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise. <b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise.
@ -427,17 +404,10 @@
</dd> </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 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> </dt>
<dd><p>Determine if a collection contains specified key. <dd><p>Determine if a mapping 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.
</p> </p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>T rhs</td> <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> </table></div>
<b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise. <b>Returns:</b><div class="pbr"><b>true</b> if rhs was found, <b>false</b> otherwise.
@ -555,7 +525,7 @@
</table></div> </table></div>
</dd> </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> </dt>
<dd><p>Determine whether a key is in a mapping, and access its value. <dd><p>Determine whether a key is in a mapping, and access its value.
</p> </p>
@ -633,7 +603,7 @@ Any modification to the node can invalidate the returned
</div> </div>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -46,7 +45,7 @@
</p> </p>
<p>Code based on <a href="http://www.pyyaml.org">PyYAML</a>.</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> </dt>
<dd><p>Exception thrown on Representer errors.</p> <dd><p>Exception thrown on Representer errors.</p>
@ -60,7 +59,7 @@
It can also override default node formatting styles for output.</p> 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> </dt>
<dd><p>Construct a Representer. <dd><p>Construct a Representer.
</p> </p>
@ -79,7 +78,7 @@
</dd> </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 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> </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> </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>); <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> <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> <td valign=top>Representer function to add.</td></tr>
</table></div> </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; <pre class="d_code"><span class="d_keyword">import</span> std.string;
<span class="d_keyword">import</span> dyaml.all; <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>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -54,7 +53,7 @@
</p> </p>
<p>Can be used to implicitly resolve custom data types of scalar values.</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> </dt>
<dd><p>Construct a Resolver. <dd><p>Construct a Resolver.
</p> </p>
@ -89,7 +88,7 @@
<tr><td valign=top>string <b>first</b></td> <tr><td valign=top>string <b>first</b></td>
<td valign=top>String of possible starting characters of the scalar.</td></tr> <td valign=top>String of possible starting characters of the scalar.</td></tr>
</table></div> </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; <pre class="d_code"><span class="d_keyword">import</span> std.regex;
<span class="d_keyword">import</span> dyaml.all; <span class="d_keyword">import</span> dyaml.all;
@ -133,7 +132,7 @@
</div> </div>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

@ -4,13 +4,13 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" > <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"> <link rel="stylesheet" type="text/css" href="css/style.css">
</head> </head>
<body><div id="top"> <body><div id="top">
<div id="header"> <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>
</div> </div>
@ -25,7 +25,6 @@
<ul><li><a href="index.html">Main page</a></li> <ul><li><a href="index.html">Main page</a></li>
<li><a href="dyaml.constructor.html">dyaml.constructor</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.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.exception.html">dyaml.exception</a></li>
<li><a href="dyaml.hacks.html">dyaml.hacks</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.linebreak.html">dyaml.linebreak</a></li>
@ -78,7 +77,7 @@
<dd><p>Collection styles.</p> <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> <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> </dd>
<dt class="d_decl"><a name="CollectionStyle.Block"></a><a name="Block"></a><span class="ddoc_psymbol">Block</span></dt> <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>
<div id="copyright"> <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>. Page generated by AutoDDoc and <a href="http://www.digitalmars.com/d/2.0/ddoc.html">Ddoc</a>.
</div> </div>

View file

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

View file

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

View file

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

Binary file not shown.

View file

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

View file

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -8,7 +6,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +14,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../', URL_ROOT: '../',
VERSION: '0.4', VERSION: '0.5',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.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="next" title="Custom YAML data types" href="custom_types.html" />
<link rel="prev" title="Welcome to D:YAML documentation!" href="../index.html" /> <link rel="prev" title="Welcome to D:YAML documentation!" href="../index.html" />
</head> </head>
@ -39,7 +37,7 @@
<li class="right" > <li class="right" >
<a href="../index.html" title="Welcome to D:YAML documentation!" <a href="../index.html" title="Welcome to D:YAML documentation!"
accesskey="P">previous</a> |</li> 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> </ul>
</div> </div>
@ -65,9 +63,8 @@ Download the version of DMD for your operating system and install it.</p>
<div class="admonition note"> <div class="admonition note">
<p class="first admonition-title">Note</p> <p class="first admonition-title">Note</p>
<p class="last">Other D compilers exist, such as <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://gdcproject.org/">GDC</a> and
<a class="reference external" href="http://www.dsource.org/projects/ldc/">LDC</a>. Setting up with either one of <a class="reference external" href="http://bitbucket.org/goshawk/gdc/wiki/Home">LDC</a>.</p>
them should be similar to DMD, but they are not yet as stable as DMD.</p>
</div> </div>
</div> </div>
<div class="section" id="download-and-compile-d-yaml"> <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> <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. script for compilation. To compile D:YAML, you first need to build CDC.
Do this by typing the following command into the console:</p> 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> </div>
<p>Now compile D:YAML with CDC. <p>Now compile D:YAML with CDC.
To do this on Unix/Linux, use the following command:</p> 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> </div>
<p>On Windows:</p> <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> <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 <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> 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> <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="kt">void</span> <span class="n">main</span><span class="p">()</span>
<span class="p">{</span> <span class="p">{</span>
@ -127,7 +126,7 @@ into the file:</p>
</div> </div>
<div class="section" id="explanation-of-the-code"> <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> <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> 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 <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 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 <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 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> 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> </div>
<p>And the following on Windows:</p> <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> </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 <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> 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 World
The answer is 42</pre> The answer is 42
</pre></div>
</div> </div>
</div> </div>
<div class="section" id="conclusion"> <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" > <li class="right" >
<a href="../index.html" title="Welcome to D:YAML documentation!" <a href="../index.html" title="Welcome to D:YAML documentation!"
>previous</a> |</li> >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> </ul>
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov. &copy; Copyright 2011-2014, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on May 19, 2014. Last updated on Aug 01, 2014.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div> </div>
</body> </body>
</html> </html>

View file

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