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