Regenerated docs
This commit is contained in:
parent
9775f35120
commit
0a0e966a26
55 changed files with 4873 additions and 13281 deletions
189
doc/html/api/dyaml/constructor.html
Normal file
189
doc/html/api/dyaml/constructor.html
Normal file
|
@ -0,0 +1,189 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.constructor</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.constructor</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/constructor.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/constructor.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/constructor.html">constructor</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><a class="anchor" id="constructNull"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/YAMLNull.html">YAMLNull</a> <a href="dyaml/constructor.html#constructNull">constructNull</a>(ref <a href="dyaml/node/Node.html">Node</a> node) @safe pure nothrow @nogc
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a _null _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructMerge"></a><div class="symbol"><div class="description"><pre><code>public YAMLMerge <a href="dyaml/constructor.html#constructMerge">constructMerge</a>(ref <a href="dyaml/node/Node.html">Node</a> node) @safe pure nothrow @nogc
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a merge _node - a _node that merges another _node into a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructBool"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/constructor.html#constructBool">constructBool</a>(ref <a href="dyaml/node/Node.html">Node</a> node) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a boolean _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructLong"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">long</a> <a href="dyaml/constructor.html#constructLong">constructLong</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct an integer (long) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructReal"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">real</a> <a href="dyaml/constructor.html#constructReal">constructReal</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a floating point (real) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructBinary"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">ubyte</a>[] <a href="dyaml/constructor.html#constructBinary">constructBinary</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a binary (base64) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructTimestamp"></a><div class="symbol"><div class="description"><pre><code>public SysTime <a href="dyaml/constructor.html#constructTimestamp">constructTimestamp</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a timestamp (SysTime) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructString"></a><div class="symbol"><div class="description"><pre><code>public string <a href="dyaml/constructor.html#constructString">constructString</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a string _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="getPairs"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>.Pair[] <a href="dyaml/constructor.html#getPairs">getPairs</a>(
|
||||
string type,
|
||||
<a href="dyaml/node/Node.html">Node</a>[] nodes)
|
||||
</code></pre>
|
||||
<div class="section "><p>Convert a sequence of single-element mappings into a sequence of pairs.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructOrderedMap"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>.Pair[] <a href="dyaml/constructor.html#constructOrderedMap">constructOrderedMap</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct an ordered map (ordered sequence of key:value pairs without duplicates) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructPairs"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>.Pair[] <a href="dyaml/constructor.html#constructPairs">constructPairs</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a pairs (ordered sequence of key: value pairs allowing duplicates) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructSet"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>[] <a href="dyaml/constructor.html#constructSet">constructSet</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a set _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructSequence"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>[] <a href="dyaml/constructor.html#constructSequence">constructSequence</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a sequence (array) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructMap"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>.Pair[] <a href="dyaml/constructor.html#constructMap">constructMap</a>(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct an unordered map (unordered set of key:value _pairs without duplicates) _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="description"><div class="section "><p>Class that processes YAML mappings, sequences and scalars into nodes. This can be
|
||||
used to add custom data types. A tutorial can be found
|
||||
<a href="../tutorials/custom_types.html">here</a>.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/constructor.html#constructNull">constructNull</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-pure">pure</span>, <span class="attr-nothrow">nothrow</span>, <span class="attr-nogc">@nogc</span></span></span></td><td></td><td><p>Construct a _null _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructMerge">constructMerge</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-pure">pure</span>, <span class="attr-nothrow">nothrow</span>, <span class="attr-nogc">@nogc</span></span></span></td><td></td><td><p>Construct a merge _node - a _node that merges another _node into a mapping.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructBool">constructBool</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Construct a boolean _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructLong">constructLong</a><span class="extrainfo"></span></td><td></td><td><p>Construct an integer (long) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructReal">constructReal</a><span class="extrainfo"></span></td><td></td><td><p>Construct a floating point (real) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructBinary">constructBinary</a><span class="extrainfo"></span></td><td></td><td><p>Construct a binary (base64) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructTimestamp">constructTimestamp</a><span class="extrainfo"></span></td><td></td><td><p>Construct a timestamp (SysTime) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructString">constructString</a><span class="extrainfo"></span></td><td></td><td><p>Construct a string _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#getPairs">getPairs</a><span class="extrainfo"></span></td><td></td><td><p>Convert a sequence of single-element mappings into a sequence of pairs.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructOrderedMap">constructOrderedMap</a><span class="extrainfo"></span></td><td></td><td><p>Construct an ordered map (ordered sequence of key:value pairs without duplicates) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructPairs">constructPairs</a><span class="extrainfo"></span></td><td></td><td><p>Construct a pairs (ordered sequence of key: value pairs allowing duplicates) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructSet">constructSet</a><span class="extrainfo"></span></td><td></td><td><p>Construct a set _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructSequence">constructSequence</a><span class="extrainfo"></span></td><td></td><td><p>Construct a sequence (array) _node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor.html#constructMap">constructMap</a><span class="extrainfo"></span></td><td></td><td><p>Construct an unordered map (unordered set of key:value _pairs without duplicates) _node.
|
||||
</p>
|
||||
</td></tr></table><h2>Classes</h2><table><tr><td><a href="dyaml/constructor/Constructor.html">Constructor</a></td><td></td><td><p>Constructs YAML values.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
291
doc/html/api/dyaml/constructor/Constructor.html
Normal file
291
doc/html/api/dyaml/constructor/Constructor.html
Normal file
|
@ -0,0 +1,291 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Constructor</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/constructor.html>constructor</a>.</small><span class="highlight">Constructor</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/constructor.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/constructor.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/constructor.html">constructor</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public final class Constructor
|
||||
</code></pre>
|
||||
<div class="section "><p>Constructs YAML values.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Each YAML scalar, sequence or mapping has a tag specifying its data type.
|
||||
Constructor uses user-specifyable functions to create a node of desired
|
||||
data type from a scalar, sequence or mapping.
|
||||
</p>
|
||||
<p> Each of these functions is associated with a tag, and can process either
|
||||
a scalar, a sequence, or a mapping. The constructor passes each value to
|
||||
the function with corresponding tag, which then returns the resulting value
|
||||
that can be stored in a node.
|
||||
</p>
|
||||
<p> If a tag is detected with no known constructor function, it is considered an error.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(const Flag!"useDefaultConstructors" defaultConstructors = Yes.useDefaultConstructors) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Constructor.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>/// If you don't want to support default YAML tags/data types, you can use
|
||||
defaultConstructors to disable constructor functions for these.
|
||||
</p>
|
||||
<p>/// Params: defaultConstructors = Use constructors for default YAML tags?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="addConstructorScalar"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/constructor/Constructor.html#addConstructorScalar">addConstructorScalar</a>(T)(
|
||||
const string tag,
|
||||
T function(ref <a href="dyaml/node/Node.html">Node</a>) ctor) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Add a constructor function from scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>The function must take a reference to <code class="d_inlinecode">Node</code> to construct from.
|
||||
The node contains a string for scalars, <code class="d_inlinecode">Node[]</code> for sequences and
|
||||
<code class="d_inlinecode">Node.Pair[]</code> for mappings.
|
||||
</p>
|
||||
<p> Any exception thrown by this function will be caught by D:YAML and
|
||||
its message will be added to a <code class="d_inlinecode">YAMLException</code> that will also tell
|
||||
the user which type failed to construct, and position in the file.
|
||||
</p>
|
||||
<p> The value returned by this function will be stored in the resulting node.
|
||||
</p>
|
||||
<p> Only one constructor function can be set for one tag.
|
||||
</p>
|
||||
<p> Structs and classes must implement the <code class="d_inlinecode">opCmp()</code> operator for D:YAML
|
||||
support. The signature of the operator that must be implemented
|
||||
is <code class="d_inlinecode">const int opCmp(ref const MyStruct s)</code> for structs where
|
||||
<i>MyStruct</i> is the struct type, and <code class="d_inlinecode">int opCmp(Object o)</code> for
|
||||
classes. Note that the class <code class="d_inlinecode">opCmp()</code> should not alter the compared
|
||||
values - it is not const for compatibility reasons.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Tag for the function to handle.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">ctor</td><td class="paramDoc"><p>Constructor function.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
|
||||
<pre><code> import std.string;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
MyStruct constructMyStructScalar(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
{
|
||||
//Guaranteed to be string as we construct from scalar.
|
||||
//!mystruct x:y:z
|
||||
auto parts = node.as!string().split(":");
|
||||
// If <a href="dyaml/constructor/Constructor.html#this">this</a> throws, the D:YAML will handle it and throw a <a href="dyaml/exception/YAMLException.html">YAMLException</a>.
|
||||
return MyStruct(to!int(parts[0]), to!int(parts[1]), to!int(parts[2]));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml");
|
||||
auto constructor = new <a href="dyaml/constructor/Constructor.html">Constructor</a>;
|
||||
constructor.<a href="dyaml/constructor/Constructor.html#addConstructorScalar">addConstructorScalar</a>("!mystruct", &constructMyStructScalar);
|
||||
loader.constructor = constructor;
|
||||
<a href="dyaml/node/Node.html">Node</a> node = loader.load();
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="addConstructorSequence"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/constructor/Constructor.html#addConstructorSequence">addConstructorSequence</a>(T)(
|
||||
const string tag,
|
||||
T function(ref <a href="dyaml/node/Node.html">Node</a>) ctor) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Add a constructor function from sequence.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
|
||||
<pre><code> import std.string;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
MyStruct constructMyStructSequence(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
{
|
||||
//node is guaranteed to be sequence.
|
||||
//!mystruct [x, y, z]
|
||||
return MyStruct(node[0].as!int, node[1].as!int, node[2].as!int);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml");
|
||||
auto constructor = new <a href="dyaml/constructor/Constructor.html">Constructor</a>;
|
||||
constructor.<a href="dyaml/constructor/Constructor.html#addConstructorSequence">addConstructorSequence</a>("!mystruct", &constructMyStructSequence);
|
||||
loader.constructor = constructor;
|
||||
<a href="dyaml/node/Node.html">Node</a> node = loader.load();
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="section seealso">
|
||||
<h2>See Also:</h2>
|
||||
<div class="seealso-content">
|
||||
<pre class="prettyprint"><code><a href="dyaml/constructor/Constructor.html#addConstructorScalar">addConstructorScalar</a>
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="addConstructorMapping"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/constructor/Constructor.html#addConstructorMapping">addConstructorMapping</a>(T)(
|
||||
const string tag,
|
||||
T function(ref <a href="dyaml/node/Node.html">Node</a>) ctor) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Add a constructor function from a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
|
||||
<pre><code> import std.string;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
MyStruct constructMyStructMapping(ref <a href="dyaml/node/Node.html">Node</a> node)
|
||||
{
|
||||
//node is guaranteed to be mapping.
|
||||
//!mystruct {"x": x, "y": y, "z": z}
|
||||
return MyStruct(node["x"].as!int, node["y"].as!int, node["z"].as!int);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml");
|
||||
auto constructor = new <a href="dyaml/constructor/Constructor.html">Constructor</a>;
|
||||
constructor.<a href="dyaml/constructor/Constructor.html#addConstructorMapping">addConstructorMapping</a>("!mystruct", &constructMyStructMapping);
|
||||
loader.constructor = constructor;
|
||||
<a href="dyaml/node/Node.html">Node</a> node = loader.load();
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="section seealso">
|
||||
<h2>See Also:</h2>
|
||||
<div class="seealso-content">
|
||||
<pre class="prettyprint"><code><a href="dyaml/constructor/Constructor.html#addConstructorScalar">addConstructorScalar</a>
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/constructor/Constructor.html#this">this</a></td><td></td><td><p>Construct a Constructor.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor/Constructor.html#addConstructorScalar">addConstructorScalar</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Add a constructor function from scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor/Constructor.html#addConstructorSequence">addConstructorSequence</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Add a constructor function from sequence.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/constructor/Constructor.html#addConstructorMapping">addConstructorMapping</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Add a constructor function from a mapping.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
64
doc/html/api/dyaml/dumper.html
Normal file
64
doc/html/api/dyaml/dumper.html
Normal file
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.dumper</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.dumper</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/dumper.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/dumper.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/dumper.html">dumper</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>YAML dumper.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Code based on <a href="http://www.pyyaml.org">PyYAML</a>.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Structs</h2><table><tr><td><a href="dyaml/dumper/Dumper.html">Dumper</a></td><td></td><td><p>Dumps YAML documents to files or streams.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
319
doc/html/api/dyaml/dumper/Dumper.html
Normal file
319
doc/html/api/dyaml/dumper/Dumper.html
Normal file
|
@ -0,0 +1,319 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Dumper</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/dumper.html>dumper</a>.</small><span class="highlight">Dumper</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/dumper.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/dumper.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/dumper.html">dumper</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public struct Dumper
|
||||
</code></pre>
|
||||
<div class="section "><p>Dumps YAML documents to files or streams.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>User specified Representer and/or Resolver can be used to support new
|
||||
tags / data types.
|
||||
</p>
|
||||
<p>Setters are provided to affect output details (style, encoding, etc.).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
|
||||
Write to a file:
|
||||
<pre><code>auto node = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
<a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml").<a href="dyaml/dumper/Dumper.html#dump">dump</a>(node);</code></pre>
|
||||
|
||||
Write multiple YAML documents to a file:
|
||||
<pre><code>auto node1 = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
auto node2 = <a href="dyaml/node/Node.html">Node</a>("This document contains only one string");
|
||||
<a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml").<a href="dyaml/dumper/Dumper.html#dump">dump</a>(node1, node2);
|
||||
|
||||
//Or with an array:
|
||||
//<a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml").<a href="dyaml/dumper/Dumper.html#dump">dump</a>([node1, node2]);
|
||||
|
||||
</code></pre>
|
||||
|
||||
Write to memory:
|
||||
<pre><code>import std.stream;
|
||||
auto stream = new MemoryStream();
|
||||
auto node = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
<a href="dyaml/dumper/Dumper.html">Dumper</a>(stream).<a href="dyaml/dumper/Dumper.html#dump">dump</a>(node);</code></pre>
|
||||
|
||||
Use a custom representer/resolver to support custom data types and/or implicit tags:
|
||||
<pre><code>auto node = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
auto <a href="dyaml/dumper/Dumper.html#representer">representer</a> = new <a href="dyaml/representer/Representer.html">Representer</a>();
|
||||
auto <a href="dyaml/dumper/Dumper.html#resolver">resolver</a> = new <a href="dyaml/resolver/Resolver.html">Resolver</a>();
|
||||
|
||||
//Add <a href="dyaml/dumper/Dumper.html#representer">representer</a> functions / <a href="dyaml/dumper/Dumper.html#resolver">resolver</a> expressions here...
|
||||
|
||||
auto dumper = <a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml");
|
||||
dumper.<a href="dyaml/dumper/Dumper.html#representer">representer</a> = <a href="dyaml/dumper/Dumper.html#representer">representer</a>;
|
||||
dumper.<a href="dyaml/dumper/Dumper.html#resolver">resolver</a> = <a href="dyaml/dumper/Dumper.html#resolver">resolver</a>;
|
||||
dumper.<a href="dyaml/dumper/Dumper.html#dump">dump</a>(node);</code></pre>
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(string filename) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Dumper writing to a file.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">filename</td><td class="paramDoc"><p>File name to write to.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException if the file can not be dumped to (e.g. cannot be opened).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(Stream stream) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Dumper writing to a _stream. This is useful to e.g. write to memory.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="name"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#name">name</a>(string name) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set stream _name. Used in debugging messages.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="resolver"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#resolver">resolver</a>(<a href="dyaml/resolver/Resolver.html">Resolver</a> resolver) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify custom Resolver to use.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representer"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#representer">representer</a>(<a href="dyaml/representer/Representer.html">Representer</a> representer) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify custom Representer to use.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="canonical"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#canonical">canonical</a>(<a href="http://dlang.org/type.html#basic-data-types">bool</a> canonical) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Write scalars in _canonical form?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="indent"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#indent">indent</a>(<a href="http://dlang.org/type.html#basic-data-types">uint</a> indent) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set indentation width. 2 by default. Must not be zero.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Contracts</h2><pre><code>in
|
||||
{
|
||||
assert (<a href="dyaml/dumper/Dumper.html#indent">indent</a> != 0, "Can't use zero YAML <a href="dyaml/dumper/Dumper.html#indent">indent</a> width");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="textWidth"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#textWidth">textWidth</a>(<a href="http://dlang.org/type.html#basic-data-types">uint</a> width) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set preferred text _width.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="lineBreak"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#lineBreak">lineBreak</a>(<a href="dyaml/linebreak/LineBreak.html">LineBreak</a> lineBreak) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set line break to use. Unix by default.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="encoding"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#encoding">encoding</a>(Encoding encoding) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set character _encoding to use. UTF-8 by default.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="explicitStart"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#explicitStart">explicitStart</a>(<a href="http://dlang.org/type.html#basic-data-types">bool</a> explicit) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Always explicitly write document start?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="explicitEnd"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#explicitEnd">explicitEnd</a>(<a href="http://dlang.org/type.html#basic-data-types">bool</a> explicit) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Always explicitly write document end?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="YAMLVersion"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#YAMLVersion">YAMLVersion</a>(string YAMLVersion) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify YAML version string. "1.1" by default.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="tagDirectives"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#tagDirectives">tagDirectives</a>(string[string] tags) pure @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify tag directives.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>A tag directive specifies a shorthand notation for specifying _tags.
|
||||
Each tag directive associates a handle with a prefix. This allows for
|
||||
compact tag notation.
|
||||
</p>
|
||||
<p>Each handle specified MUST start and end with a '!' character
|
||||
(a single character "!" handle is allowed as well).
|
||||
</p>
|
||||
<p>Only alphanumeric characters, '-', and '__' may be used in handles.
|
||||
</p>
|
||||
<p>Each prefix MUST not be empty.
|
||||
</p>
|
||||
<p>The "!!" handle is used for default YAML _tags with prefix
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>"tag</h2>
|
||||
<p>yaml.org,2002:". This can be overridden.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tags</td><td class="paramDoc"><p>Tag directives (keys are handles, values are prefixes).
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
<pre><code><a href="dyaml/dumper/Dumper.html">Dumper</a> dumper = <a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml");
|
||||
string[string] directives;
|
||||
directives["!short!"] = "tag:long.org,2011:";
|
||||
//This will emit tags starting with "tag:long.org,2011"
|
||||
//with a "!short!" prefix instead.
|
||||
dumper.<a href="dyaml/dumper/Dumper.html#tagDirectives">tagDirectives</a>(directives);
|
||||
dumper.<a href="dyaml/dumper/Dumper.html#dump">dump</a>(<a href="dyaml/node/Node.html">Node</a>("foo"));</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="dump"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/dumper/Dumper.html#dump">dump</a>(<a href="dyaml/node/Node.html">Node</a>[] documents...) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Dump one or more YAML _documents to the file/stream.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Note that while you can call dump() multiple times on the same
|
||||
dumper, you will end up writing multiple YAML "files" to the same
|
||||
file/stream.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">documents</td><td class="paramDoc"><p>Documents to _dump (root nodes of the _documents).
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException on error (e.g. invalid nodes,
|
||||
unable to write to file/stream).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/dumper/Dumper.html#this">this</a></td><td></td><td><p>Construct a Dumper writing to a file.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/dumper/Dumper.html#this">this</a></td><td></td><td><p>Construct a Dumper writing to a _stream. This is useful to e.g. write to memory.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#name">name</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set stream _name. Used in debugging messages.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#resolver">resolver</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Specify custom Resolver to use.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#representer">representer</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Specify custom Representer to use.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#canonical">canonical</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Write scalars in _canonical form?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#indent">indent</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set indentation width. 2 by default. Must not be zero.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#textWidth">textWidth</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set preferred text _width.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#lineBreak">lineBreak</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set line break to use. Unix by default.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#encoding">encoding</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set character _encoding to use. UTF-8 by default.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#explicitStart">explicitStart</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Always explicitly write document start?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#explicitEnd">explicitEnd</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Always explicitly write document end?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#YAMLVersion">YAMLVersion</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Specify YAML version string. "1.1" by default.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/dumper/Dumper.html#tagDirectives">tagDirectives</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Specify tag directives.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/dumper/Dumper.html#dump">dump</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Dump one or more YAML _documents to the file/stream.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
59
doc/html/api/dyaml/exception.html
Normal file
59
doc/html/api/dyaml/exception.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.exception</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.exception</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/exception.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/exception.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/exception.html">exception</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>Exceptions thrown by D:YAML and _exception related code.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Classes</h2><table><tr><td><a href="dyaml/exception/YAMLException.html">YAMLException</a></td><td></td><td><p>Base class for all exceptions thrown by D:YAML.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
doc/html/api/dyaml/exception/YAMLException.html
Normal file
71
doc/html/api/dyaml/exception/YAMLException.html
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>YAMLException</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/exception.html>exception</a>.</small><span class="highlight">YAMLException</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/exception.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/exception.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/exception.html">exception</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public class YAMLException : Exception
|
||||
</code></pre>
|
||||
<div class="section "><p>Base class for all exceptions thrown by D:YAML.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(
|
||||
string msg,
|
||||
string file = __FILE__,
|
||||
size_t line = __LINE__) @safe pure nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a YAMLException with specified message and position where it was thrown.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/exception/YAMLException.html#this">this</a></td><td></td><td><p>Construct a YAMLException with specified message and position where it was thrown.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
164
doc/html/api/dyaml/hacks.html
Normal file
164
doc/html/api/dyaml/hacks.html
Normal file
|
@ -0,0 +1,164 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.hacks</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.hacks</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/hacks.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/hacks.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/hacks.html">hacks</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><a class="anchor" id="scalarStyleHack"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/style/ScalarStyle.html">ScalarStyle</a> <a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a>(ref const(<a href="dyaml/node/Node.html">Node</a>) node) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Get the scalar style a node had in the file it was loaded from.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is only useful for nodes loaded from files.
|
||||
</p>
|
||||
<p> This is a "hack" because a YAML application is supposed to be unaware of styles
|
||||
used in YAML styles, i.e. treating different styles differently is unstandard.
|
||||
However, determining style may be useful in some cases, e.g. YAML utilities.
|
||||
</p>
|
||||
<p> May only be called on scalar nodes (nodes where node.isScalar() == true).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
<pre><code> // <a href="dyaml/node/Node.html">Node</a> node // loaded from a file
|
||||
if(node.isScalar)
|
||||
{
|
||||
import std.stdio;
|
||||
writeln(node.<a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a>());
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="collectionStyleHack"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/style/CollectionStyle.html">CollectionStyle</a> <a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a>(ref const(<a href="dyaml/node/Node.html">Node</a>) node) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Get the collection style a YAML node had in the file it was loaded from.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>May only be called on collection nodes (nodes where node.isScalar() != true).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section seealso">
|
||||
<h2>See Also:</h2>
|
||||
<div class="seealso-content">
|
||||
<p> scalarStyleHack
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="scalarStyleHack"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
const <a href="dyaml/style/ScalarStyle.html">ScalarStyle</a> rhs) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set the scalar style node should have when written to a file.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Setting the style might be useful when generating YAML or reformatting existing files.
|
||||
</p>
|
||||
<p> May only be called on scalar nodes (nodes where node.isScalar() == true).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Example</h2>
|
||||
<pre><code>writeln("D:YAML <a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a> setter unittest");
|
||||
auto node = <a href="dyaml/node/Node.html">Node</a>(5);
|
||||
node.<a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a> = <a href="dyaml/style/ScalarStyle.html#DoubleQuoted">ScalarStyle.DoubleQuoted</a>;
|
||||
assert(node.<a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a>() == <a href="dyaml/style/ScalarStyle.html#DoubleQuoted">ScalarStyle.DoubleQuoted</a>);
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="collectionStyleHack"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
const <a href="dyaml/style/CollectionStyle.html">CollectionStyle</a> rhs) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set the collection style node should have when written to a file.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Setting the style might be useful when generating YAML or reformatting existing files.
|
||||
</p>
|
||||
<p> May only be called on collection nodes (nodes where node.isScalar() != true).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Example</h2>
|
||||
<pre><code>writeln("D:YAML <a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a> setter unittest");
|
||||
auto node = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
node.<a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a> = <a href="dyaml/style/CollectionStyle.html#Block">CollectionStyle.Block</a>;
|
||||
assert(node.<a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a>() == <a href="dyaml/style/CollectionStyle.html#Block">CollectionStyle.Block</a>);
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><div class="description"><div class="section "><p>Functionality that may sometimes be needed but allows unsafe or unstandard behavior, and should only be used in specific cases.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Get the scalar style a node had in the file it was loaded from.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Get the collection style a YAML node had in the file it was loaded from.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/hacks.html#scalarStyleHack">scalarStyleHack</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set the scalar style node should have when written to a file.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/hacks.html#collectionStyleHack">collectionStyleHack</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set the collection style node should have when written to a file.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
doc/html/api/dyaml/linebreak.html
Normal file
54
doc/html/api/dyaml/linebreak.html
Normal file
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.linebreak</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.linebreak</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/linebreak.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/linebreak.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/linebreak.html">linebreak</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"></div><div class="section members"><h2>Enums</h2><table><tr><td><a href="dyaml/linebreak/LineBreak.html">LineBreak</a></td><td></td><td><p>Enumerates platform specific line breaks.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
65
doc/html/api/dyaml/linebreak/LineBreak.html
Normal file
65
doc/html/api/dyaml/linebreak/LineBreak.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>LineBreak</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/linebreak.html>linebreak</a>.</small><span class="highlight">LineBreak</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/linebreak.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/linebreak.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/linebreak.html">linebreak</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public enum LineBreak
|
||||
</code></pre>
|
||||
<div class="section "><p>Enumerates platform specific line breaks.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Values</h2><table><tr><td>Unix</td><td></td><td><p>Unix line break ("\n").
|
||||
</p>
|
||||
</td></tr><tr><td>Windows</td><td></td><td><p>Windows line break ("\r\n").
|
||||
</p>
|
||||
</td></tr><tr><td>Macintosh</td><td></td><td><p>Macintosh line break ("\r").
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
59
doc/html/api/dyaml/loader.html
Normal file
59
doc/html/api/dyaml/loader.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.loader</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.loader</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/loader.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/loader.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/loader.html">loader</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>Class used to load YAML documents.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Structs</h2><table><tr><td><a href="dyaml/loader/Loader.html">Loader</a></td><td></td><td><p>Loads YAML documents from files or streams.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
329
doc/html/api/dyaml/loader/Loader.html
Normal file
329
doc/html/api/dyaml/loader/Loader.html
Normal file
|
@ -0,0 +1,329 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Loader</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/loader.html>loader</a>.</small><span class="highlight">Loader</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/loader.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/loader.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/loader.html">loader</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public struct Loader
|
||||
</code></pre>
|
||||
<div class="section "><p>Loads YAML documents from files or streams.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>User specified Constructor and/or Resolver can be used to support new
|
||||
tags / data types.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
|
||||
Load single YAML document from a file:
|
||||
<pre><code> auto rootNode = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml").<a href="dyaml/loader/Loader.html#load">load</a>();
|
||||
...
|
||||
</code></pre>
|
||||
|
||||
Load all YAML documents from a file:
|
||||
<pre><code> auto nodes = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml").<a href="dyaml/loader/Loader.html#loadAll">loadAll</a>();
|
||||
...
|
||||
</code></pre>
|
||||
|
||||
Iterate over YAML documents in a file, lazily loading them:
|
||||
<pre><code> auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml");
|
||||
|
||||
foreach(ref node; loader)
|
||||
{
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
Load YAML from a string:
|
||||
<pre><code> char[] yaml_input = "red: '#ff0000'\n"
|
||||
"green: '#00ff00'\n"
|
||||
"blue: '#0000ff'".dup;
|
||||
|
||||
auto colors = <a href="dyaml/loader/Loader.html#fromString">Loader.fromString</a>(yaml_input).<a href="dyaml/loader/Loader.html#load">load</a>();
|
||||
|
||||
foreach(string color, string value; colors)
|
||||
{
|
||||
import std.stdio;
|
||||
writeln(color, " is ", value, " in HTML/CSS");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
Load a file into a buffer in memory and then load YAML from that buffer:
|
||||
<pre><code> try
|
||||
{
|
||||
import std.file;
|
||||
void[] buffer = std.file.read("file.yaml");
|
||||
auto yamlNode = <a href="dyaml/loader/Loader.html">Loader</a>(buffer);
|
||||
|
||||
// Read data from yamlNode here...
|
||||
}
|
||||
catch(FileException e)
|
||||
{
|
||||
writeln("Failed to read file 'file.yaml'");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
Use a custom constructor/resolver to support custom data types and/or implicit tags:
|
||||
<pre><code> auto <a href="dyaml/loader/Loader.html#constructor">constructor</a> = new <a href="dyaml/constructor/Constructor.html">Constructor</a>();
|
||||
auto <a href="dyaml/loader/Loader.html#resolver">resolver</a> = new <a href="dyaml/resolver/Resolver.html">Resolver</a>();
|
||||
|
||||
// Add <a href="dyaml/loader/Loader.html#constructor">constructor</a> functions / <a href="dyaml/loader/Loader.html#resolver">resolver</a> expressions here...
|
||||
|
||||
auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.yaml");
|
||||
loader.<a href="dyaml/loader/Loader.html#constructor">constructor</a> = <a href="dyaml/loader/Loader.html#constructor">constructor</a>;
|
||||
loader.<a href="dyaml/loader/Loader.html#resolver">resolver</a> = <a href="dyaml/loader/Loader.html#resolver">resolver</a>;
|
||||
auto rootNode = loader.<a href="dyaml/loader/Loader.html#load">load</a>(node);
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(string filename) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Loader to load YAML from a file.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">filename</td><td class="paramDoc"><p>Name of the file to load from.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException if the file could not be opened or read.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="fromString"></a><div class="symbol"><div class="description"><pre><code>public static <a href="dyaml/loader/Loader.html">Loader</a> <a href="dyaml/loader/Loader.html#fromString">fromString</a>(<a href="http://dlang.org/type.html#basic-data-types">char</a>[] data) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Loader to load YAML from a string (char []).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">data</td><td class="paramDoc"><p>String to load YAML from. <b>will</b> be overwritten during parsing as D:YAML reuses memory. Use data.dup if you don't want to modify the original string.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Loader loading YAML from given string.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException if data could not be read (e.g. a decoding error)
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Example</h2>
|
||||
<pre><code>assert(<a href="dyaml/loader/Loader.html#fromString">Loader.fromString</a>(cast(char[])"42").<a href="dyaml/loader/Loader.html#load">load</a>().as!int == 42);
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(<a href="http://dlang.org/type.html#basic-data-types">void</a>[] yamlData) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Loader to load YAML from a buffer.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">yamlData</td><td class="paramDoc"><p>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. <b>Must not be deleted or modified by the user as long as nodes loaded by this Loader are in use!</b> - Nodes may refer to data in this buffer. 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.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException if yamlData contains data illegal in YAML.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="name"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/loader/Loader.html#name">name</a>(string name) pure @safe nothrow @nogc
|
||||
</code></pre>
|
||||
<div class="section "><p>Set stream _name. Used in debugging messages.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="resolver"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/loader/Loader.html#resolver">resolver</a>(<a href="dyaml/resolver/Resolver.html">Resolver</a> resolver) pure @safe nothrow @nogc
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify custom Resolver to use.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="constructor"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/loader/Loader.html#constructor">constructor</a>(<a href="dyaml/constructor/Constructor.html">Constructor</a> constructor) pure @safe nothrow @nogc
|
||||
</code></pre>
|
||||
<div class="section "><p>Specify custom Constructor to use.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="load"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/loader/Loader.html#load">load</a>() @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Load single YAML document.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Contracts</h2><pre><code>in
|
||||
{
|
||||
assert (!done_, "<a href="dyaml/loader/Loader.html">Loader</a>: Trying to <a href="dyaml/loader/Loader.html#load">load</a> YAML twice");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If none or more than one YAML document is found, this throws a YAMLException.
|
||||
</p>
|
||||
<p> This can only be called once; this is enforced by contract.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Root node of the document.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException if there wasn't exactly one document
|
||||
or on a YAML parsing error.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="loadAll"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>[] <a href="dyaml/loader/Loader.html#loadAll">loadAll</a>() @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Load all YAML documents.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is just a shortcut that iterates over all documents and returns them
|
||||
all at once. Calling loadAll after iterating over the node or vice versa
|
||||
will not return any documents, as they have all been parsed already.
|
||||
</p>
|
||||
<p> This can only be called once; this is enforced by contract.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Array of root nodes of all documents in the file/stream.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException on a parsing error.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opApply"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">int</a> <a href="dyaml/loader/Loader.html#opApply">opApply</a>(<a href="http://dlang.org/type.html#basic-data-types">int</a> delegate(ref <a href="dyaml/node/Node.html">Node</a>) dg) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Foreach over YAML documents.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Contracts</h2><pre><code>in
|
||||
{
|
||||
assert (!done_, "<a href="dyaml/loader/Loader.html">Loader</a>: Trying to <a href="dyaml/loader/Loader.html#load">load</a> YAML twice");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Parses documents lazily, when they are needed.
|
||||
</p>
|
||||
<p> Foreach over a Loader can only be used once; this is enforced by contract.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> YAMLException on a parsing error.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/loader/Loader.html#this">this</a></td><td></td><td><p>Construct a Loader to load YAML from a file.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-static">static</span></span></span><a href="dyaml/loader/Loader.html#fromString">fromString</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Construct a Loader to load YAML from a string (char []).
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#this">this</a></td><td></td><td><p>Construct a Loader to load YAML from a buffer.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#name">name</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span>, <span class="attr-nogc">@nogc</span></span></span></td><td></td><td><p>Set stream _name. Used in debugging messages.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#resolver">resolver</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span>, <span class="attr-nogc">@nogc</span></span></span></td><td></td><td><p>Specify custom Resolver to use.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#constructor">constructor</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span>, <span class="attr-nogc">@nogc</span></span></span></td><td></td><td><p>Specify custom Constructor to use.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#load">load</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Load single YAML document.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#loadAll">loadAll</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Load all YAML documents.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/loader/Loader.html#opApply">opApply</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Foreach over YAML documents.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
64
doc/html/api/dyaml/node.html
Normal file
64
doc/html/api/dyaml/node.html
Normal file
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.node</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.node</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/node.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/node.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/node.html">node</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>Node of a YAML document. Used to read YAML data once it's loaded,
|
||||
and to prepare data to emit.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Structs</h2><table><tr><td><a href="dyaml/node/YAMLNull.html">YAMLNull</a></td><td></td><td><p>Null YAML type. Used in nodes with _null values.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html">Node</a></td><td></td><td><p>YAML node.
|
||||
</p>
|
||||
</td></tr></table><h2>Classes</h2><table><tr><td><a href="dyaml/node/NodeException.html">NodeException</a></td><td></td><td><p>Exception thrown at node related errors.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
866
doc/html/api/dyaml/node/Node.html
Normal file
866
doc/html/api/dyaml/node/Node.html
Normal file
|
@ -0,0 +1,866 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Node</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/node.html>node</a>.</small><span class="highlight">Node</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/node.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/node.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/node.html">node</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public struct Node
|
||||
</code></pre>
|
||||
<div class="section "><p>YAML node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is a pseudo-dynamic type that can store any YAML value, including a
|
||||
sequence or mapping of nodes. You can get data from a Node directly or
|
||||
iterate over it if it's a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(T)(
|
||||
T value,
|
||||
const string tag = null) @trusted
|
||||
if(!scalarCtorNothrow!T && (!isArray!T && !isAssociativeArray!T))
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Node from a value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Any type except for Node can be stored in a Node, but default YAML
|
||||
types (integers, floats, strings, timestamps, etc.) will be stored
|
||||
more efficiently. To create a node representing a null value,
|
||||
construct it from YAMLNull.
|
||||
</p>
|
||||
<p> Note that to emit any non-default types you store
|
||||
in a node, you need a Representer to represent them in YAML -
|
||||
otherwise emitting will fail.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">value</td><td class="paramDoc"><p>Value to store in the node.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. Tag must be in full form, e.g. "tag:yaml.org,2002:int", not a shortcut, like "!!int".
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(T)(
|
||||
T value,
|
||||
const string tag = null) @safe pure nothrow
|
||||
if(scalarCtorNothrow!T)
|
||||
</code></pre>
|
||||
<div class="section "><p>Ditto.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(T)(
|
||||
T[] array,
|
||||
const string tag = null) @safe
|
||||
if(!isSomeString!(T[]))
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a node from an _array.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If _array is an _array of nodes or pairs, it is stored directly.
|
||||
Otherwise, every value in the array is converted to a node, and
|
||||
those nodes are stored.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">array</td><td class="paramDoc"><p>Values to store in the node.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. This is used to differentiate between YAML sequences ("!!seq") and sets ("!!set"), which both are internally represented as an array_ of nodes. Tag must be in full form, e.g. "tag:yaml.org,2002:set", not a shortcut, like "!!set".
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
<pre><code> // Will be emitted <a href="dyaml/node/Node.html#as">as</a> a sequence (default for arrays)
|
||||
auto seq = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5]);
|
||||
// Will be emitted <a href="dyaml/node/Node.html#as">as</a> a set (overriden <a href="dyaml/node/Node.html#tag">tag</a>)
|
||||
auto set = <a href="dyaml/node/Node.html">Node</a>([1, 2, 3, 4, 5], "<a href="dyaml/node/Node.html#tag">tag</a>:yaml.org,2002:set");
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(K, V)(
|
||||
V[K] array,
|
||||
const string tag = null) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a node from an associative _array.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If keys and/or values of _array are nodes, they stored directly.
|
||||
Otherwise they are converted to nodes and then stored.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">array</td><td class="paramDoc"><p>Values to store in the node.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. This is used to differentiate between YAML unordered mappings ("!!map"), ordered mappings ("!!omap"), and pairs ("!!pairs") which are all internally represented as an _array of node pairs. Tag must be in full form, e.g. "tag:yaml.org,2002:omap", not a shortcut, like "!!omap".
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
<pre><code> // Will be emitted <a href="dyaml/node/Node.html#as">as</a> an unordered mapping (default for mappings)
|
||||
auto map = <a href="dyaml/node/Node.html">Node</a>([1 : "a", 2 : "b"]);
|
||||
// Will be emitted <a href="dyaml/node/Node.html#as">as</a> an ordered map (overriden <a href="dyaml/node/Node.html#tag">tag</a>)
|
||||
auto omap = <a href="dyaml/node/Node.html">Node</a>([1 : "a", 2 : "b"], "<a href="dyaml/node/Node.html#tag">tag</a>:yaml.org,2002:omap");
|
||||
// Will be emitted <a href="dyaml/node/Node.html#as">as</a> pairs (overriden <a href="dyaml/node/Node.html#tag">tag</a>)
|
||||
auto pairs = <a href="dyaml/node/Node.html">Node</a>([1 : "a", 2 : "b"], "<a href="dyaml/node/Node.html#tag">tag</a>:yaml.org,2002:pairs");
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(K, V)(
|
||||
K[] keys,
|
||||
V[] values,
|
||||
const string tag = null) @safe
|
||||
if(!(isSomeString!(K[]) || isSomeString!(V[])))
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a node from arrays of _keys and _values.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Contracts</h2><pre><code>in
|
||||
{
|
||||
assert (keys.<a href="dyaml/node/Node.html#length">length</a> == values.<a href="dyaml/node/Node.html#length">length</a>, "Lengths of keys and values arrays to construct ""a YAML node from don't match");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Constructs a mapping node with key-value pairs from
|
||||
_keys and _values, keeping their order. Useful when order
|
||||
is important (ordered maps, pairs).
|
||||
</p>
|
||||
<p> keys and values must have equal length.
|
||||
</p>
|
||||
<p> If _keys and/or _values are nodes, they are stored directly/
|
||||
Otherwise they are converted to nodes and then stored.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">keys</td><td class="paramDoc"><p>Keys of the mapping, from first to last pair.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">values</td><td class="paramDoc"><p>Values of the mapping, from first to last pair.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. This is used to differentiate between YAML unordered mappings ("!!map"), ordered mappings ("!!omap"), and pairs ("!!pairs") which are all internally represented as an array of node pairs. Tag must be in full form, e.g. "tag:yaml.org,2002:omap", not a shortcut, like "!!omap".
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
<pre><code> // Will be emitted <a href="dyaml/node/Node.html#as">as</a> an unordered mapping (default for mappings)
|
||||
auto map = <a href="dyaml/node/Node.html">Node</a>([1, 2], ["a", "b"]);
|
||||
// Will be emitted <a href="dyaml/node/Node.html#as">as</a> an ordered map (overriden <a href="dyaml/node/Node.html#tag">tag</a>)
|
||||
auto omap = <a href="dyaml/node/Node.html">Node</a>([1, 2], ["a", "b"], "<a href="dyaml/node/Node.html#tag">tag</a>:yaml.org,2002:omap");
|
||||
// Will be emitted <a href="dyaml/node/Node.html#as">as</a> pairs (overriden <a href="dyaml/node/Node.html#tag">tag</a>)
|
||||
auto pairs = <a href="dyaml/node/Node.html">Node</a>([1, 2], ["a", "b"], "<a href="dyaml/node/Node.html#tag">tag</a>:yaml.org,2002:pairs");
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isValid"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isValid">isValid</a>() const @safe pure nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node valid (initialized)?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isScalar"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isScalar">isScalar</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node a scalar value?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isSequence"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isSequence">isSequence</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node a sequence?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isMapping"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isMapping">isMapping</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node a mapping?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isUserType"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isUserType">isUserType</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node a user defined type?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="isNull"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#isNull">isNull</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Is this node null?
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="tag"></a><div class="symbol"><div class="description"><pre><code>public @property string <a href="dyaml/node/Node.html#tag">tag</a>() const @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Return tag of the node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opEquals"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#opEquals">opEquals</a>(T)(const auto ref T rhs) const @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Equality test.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If T is Node, recursively compares all subnodes.
|
||||
This might be quite expensive if testing entire documents.
|
||||
</p>
|
||||
<p> If T is not Node, gets a value of type T from the node and tests
|
||||
equality with that.
|
||||
</p>
|
||||
<p> To test equality with a null YAML value, use YAMLNull.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">rhs</td><td class="paramDoc"><p>Variable to test equality with.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> true if equal, false otherwise.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Example</h2>
|
||||
<pre><code>auto node = <a href="dyaml/node/Node.html">Node</a>(42);
|
||||
|
||||
assert(node == 42);
|
||||
assert(node != "42");
|
||||
assert(node != "43");
|
||||
|
||||
auto node2 = <a href="dyaml/node/Node.html">Node</a>(<a href="dyaml/node/YAMLNull.html">YAMLNull</a>());
|
||||
assert(node2 == <a href="dyaml/node/YAMLNull.html">YAMLNull</a>());
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="as"></a><div class="symbol"><div class="description"><pre><code>alias as = <a href="dyaml/node/Node.html#get">get</a>
|
||||
</code></pre>
|
||||
<div class="section "><p>Shortcut for get().
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="get"></a><div class="symbol"><div class="description"><pre><code>public @property T <a href="dyaml/node/Node.html#get">get</a>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() @trusted
|
||||
if(!is(T == const))
|
||||
</code></pre>
|
||||
<div class="section "><p>Get the value of the node as specified type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If the specifed type does not match type in the node,
|
||||
conversion is attempted. The stringConversion template
|
||||
parameter can be used to disable conversion from non-string
|
||||
types to strings.
|
||||
</p>
|
||||
<p> Numeric values are range checked, throwing if out of range of
|
||||
requested type.
|
||||
</p>
|
||||
<p> Timestamps are stored as std.datetime.SysTime.
|
||||
Binary values are decoded and stored as ubyte[].
|
||||
</p>
|
||||
<p> To get a null value, use get!YAMLNull . This is to
|
||||
prevent getting null values for types such as strings or classes.
|
||||
</p>
|
||||
<p> <b>Mapping default values:</b>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
|
||||
Automatic type conversion:
|
||||
<pre><code> auto node = <a href="dyaml/node/Node.html">Node</a>(42);
|
||||
|
||||
assert(node.<a href="dyaml/node/Node.html#as">as</a>!int == 42);
|
||||
assert(node.<a href="dyaml/node/Node.html#as">as</a>!string == "42");
|
||||
assert(node.<a href="dyaml/node/Node.html#as">as</a>!double == 42.0);
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Value of the node as specified type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if unable to convert to specified type, or if
|
||||
the value is out of range of requested type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="get"></a><div class="symbol"><div class="description"><pre><code>public @property T <a href="dyaml/node/Node.html#get">get</a>(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() const @trusted
|
||||
if(is(T == const))
|
||||
</code></pre>
|
||||
<div class="section "><p>Ditto.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="length"></a><div class="symbol"><div class="description"><pre><code>public @property size_t <a href="dyaml/node/Node.html#length">length</a>() const @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>If this is a collection, return its _length.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Otherwise, throw NodeException.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Number of elements in a sequence or key-value pairs in a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if this is not a sequence nor a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opIndex"></a><div class="symbol"><div class="description"><pre><code>public ref <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/node/Node.html#opIndex">opIndex</a>(T)(T index) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Get the element at specified index.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If the node is a sequence, index must be integral.
|
||||
</p>
|
||||
<p> If the node is a mapping, return the value corresponding to the first
|
||||
key equal to index. containsKey() can be used to determine if a mapping
|
||||
has a specific key.
|
||||
</p>
|
||||
<p> To get element at a null index, use YAMLNull for index.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">index</td><td class="paramDoc"><p>Index to use.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> Value corresponding to the index.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the index could not be found,
|
||||
non-integral index is used with a sequence or the node is
|
||||
not a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section "><h2>Example</h2>
|
||||
<pre><code>writeln("D:YAML <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/node/Node.html#opIndex">opIndex</a> unittest");
|
||||
alias <a href="dyaml/node/Node.html">Node</a>.Value Value;
|
||||
alias <a href="dyaml/node/Node.html">Node</a>.Pair Pair;
|
||||
|
||||
<a href="dyaml/node/Node.html">Node</a> narray = <a href="dyaml/node/Node.html">Node</a>([11, 12, 13, 14]);
|
||||
<a href="dyaml/node/Node.html">Node</a> nmap = <a href="dyaml/node/Node.html">Node</a>(["11", "12", "13", "14"], [11, 12, 13, 14]);
|
||||
|
||||
assert(narray[0].<a href="dyaml/node/Node.html#as">as</a>!int == 11);
|
||||
assert(null !is collectException(narray[42]));
|
||||
assert(nmap["11"].<a href="dyaml/node/Node.html#as">as</a>!int == 11);
|
||||
assert(nmap["14"].<a href="dyaml/node/Node.html#as">as</a>!int == 14);
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="contains"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#contains">contains</a>(T)(T rhs) const @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Determine if a collection contains specified value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If the node is a sequence, check if it contains the specified value.
|
||||
If it's a mapping, check if it has a value that matches specified value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">rhs</td><td class="paramDoc"><p>Item to look for. Use YAMLNull to check for a null value.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> true if rhs was found, false otherwise.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="containsKey"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">bool</a> <a href="dyaml/node/Node.html#containsKey">containsKey</a>(T)(T rhs) const @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Determine if a mapping contains specified key.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">rhs</td><td class="paramDoc"><p>Key to look for. Use YAMLNull to check for a null key.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> true if rhs was found, false otherwise.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opAssign"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#opAssign">opAssign</a>(<a href="dyaml/node/Node.html">Node</a> rhs) @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Assignment (shallow copy) by value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opAssign"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#opAssign">opAssign</a>(ref <a href="dyaml/node/Node.html">Node</a> rhs) @trusted nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Assignment (shallow copy) by reference.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opIndexAssign"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#opIndexAssign">opIndexAssign</a>(K, V)(
|
||||
V value,
|
||||
K index) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Set element at specified index in a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on collection nodes.
|
||||
</p>
|
||||
<p> If the node is a sequence, index must be integral.
|
||||
</p>
|
||||
<p> If the node is a mapping, sets the _value corresponding to the first
|
||||
key matching index (including conversion, so e.g. "42" matches 42).
|
||||
</p>
|
||||
<p> If the node is a mapping and no key matches index, a new key-value
|
||||
pair is added to the mapping. In sequences the index must be in
|
||||
range. This ensures behavior siilar to D arrays and associative
|
||||
arrays.
|
||||
</p>
|
||||
<p> To set element at a null index, use YAMLNull for index.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">index</td><td class="paramDoc"><p>Index of the value to set.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a collection, index is out
|
||||
of range or if a non-integral index is used on a sequence node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opApply"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">int</a> <a href="dyaml/node/Node.html#opApply">opApply</a>(T)(<a href="http://dlang.org/type.html#basic-data-types">int</a> delegate(ref T) dg) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Foreach over a sequence, getting each element as T.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If T is Node, simply iterate over the nodes in the sequence.
|
||||
Otherwise, convert each node to T during iteration.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a sequence or an
|
||||
element could not be converted to specified type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opApply"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">int</a> <a href="dyaml/node/Node.html#opApply">opApply</a>(K, V)(<a href="http://dlang.org/type.html#basic-data-types">int</a> delegate(
|
||||
ref K,
|
||||
ref V) dg) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Foreach over a mapping, getting each key/value as K/V.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If the K and/or V is Node, simply iterate over the nodes in the mapping.
|
||||
Otherwise, convert each key/value to T during iteration.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a mapping or an
|
||||
element could not be converted to specified type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="add"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#add">add</a>(T)(T value) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Add an element to a sequence.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on sequence nodes.
|
||||
</p>
|
||||
<p> If value is a node, it is copied to the sequence directly. Otherwise
|
||||
value is converted to a node and then stored in the sequence.
|
||||
</p>
|
||||
<p> <p>When emitting, all values in the sequence will be emitted. When
|
||||
using the !!set tag, the user needs to ensure that all elements in
|
||||
the sequence are unique, otherwise <b>invalid</b> YAML code will be
|
||||
emitted.</p>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">value</td><td class="paramDoc"><p>Value to _add to the sequence.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="add"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#add">add</a>(K, V)(
|
||||
K key,
|
||||
V value) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Add a key-value pair to a mapping.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on mapping nodes.
|
||||
</p>
|
||||
<p> If key and/or value is a node, it is copied to the mapping directly.
|
||||
Otherwise it is converted to a node and then stored in the mapping.
|
||||
</p>
|
||||
<p> <p>It is possible for the same key to be present more than once in a
|
||||
mapping. When emitting, all key-value pairs will be emitted.
|
||||
This is useful with the "!!pairs" tag, but will result in
|
||||
<b>invalid</b> YAML with "!!map" and "!!omap" tags.</p>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">key</td><td class="paramDoc"><p>Key to _add.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">value</td><td class="paramDoc"><p>Value to _add.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opBinaryRight"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>* <a href="dyaml/node/Node.html#opBinaryRight">opBinaryRight</a>(string op, K)(K key) @system
|
||||
if(op == "in")
|
||||
</code></pre>
|
||||
<div class="section "><p>Determine whether a key is in a mapping, and access its value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on mapping nodes.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">key</td><td class="paramDoc"><p>Key to search for.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> A pointer to the value (as a Node) corresponding to key,
|
||||
or null if not found.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section note"><h2>Note:</h2>
|
||||
<div class="note-content">
|
||||
<pre class="prettyprint"><code> Any modification to the node can invalidate the returned
|
||||
pointer.
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section seealso">
|
||||
<h2>See Also:</h2>
|
||||
<div class="seealso-content">
|
||||
<p> contains
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="remove"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#remove">remove</a>(T)(T rhs) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Remove first (if any) occurence of a value in a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on collection nodes.
|
||||
</p>
|
||||
<p> If the node is a sequence, the first node matching value is removed.
|
||||
If the node is a mapping, the first key-value pair where _value
|
||||
matches specified value is removed.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">rhs</td><td class="paramDoc"><p>Value to _remove.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="removeAt"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/node/Node.html#removeAt">removeAt</a>(T)(T index) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Remove element at the specified index of a collection.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This method can only be called on collection nodes.
|
||||
</p>
|
||||
<p> If the node is a sequence, index must be integral.
|
||||
</p>
|
||||
<p> If the node is a mapping, remove the first key-value pair where
|
||||
key matches index.
|
||||
</p>
|
||||
<p> If the node is a mapping and no key matches index, nothing is removed
|
||||
and no exception is thrown. This ensures behavior siilar to D arrays
|
||||
and associative arrays.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">index</td><td class="paramDoc"><p>Index to remove at.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> NodeException if the node is not a collection, index is out
|
||||
of range or if a non-integral index is used on a sequence node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="opCmp"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">int</a> <a href="dyaml/node/Node.html#opCmp">opCmp</a>(ref const <a href="dyaml/node/Node.html">Node</a> node) const @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Compare with another _node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Aliases</h2><table><tr><td><a href="dyaml/node/Node.html#as">as</a></td><td><pre><code><a href="dyaml/node/Node.html#get">get</a>
|
||||
</code></pre>
|
||||
</td><td><p>Shortcut for get().
|
||||
</p>
|
||||
</td></tr></table><h2>Functions</h2><table><tr><td><a href="dyaml/node/Node.html#this">this</a></td><td></td><td><p>Construct a Node from a value.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#this">this</a></td><td></td><td><p>Ditto.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#this">this</a></td><td></td><td><p>Construct a node from an _array.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#this">this</a></td><td></td><td><p>Construct a node from an associative _array.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#this">this</a></td><td></td><td><p>Construct a node from arrays of _keys and _values.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isValid">isValid</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-pure">pure</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node valid (initialized)?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isScalar">isScalar</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node a scalar value?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isSequence">isSequence</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node a sequence?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isMapping">isMapping</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node a mapping?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isUserType">isUserType</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node a user defined type?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#isNull">isNull</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Is this node null?
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#tag">tag</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Return tag of the node.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opEquals">opEquals</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Equality test.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#get">get</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Get the value of the node as specified type.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#get">get</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Ditto.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/node/Node.html#length">length</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>If this is a collection, return its _length.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-ref">ref</span></span></span><a href="dyaml/node/Node.html#opIndex">opIndex</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Get the element at specified index.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#contains">contains</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Determine if a collection contains specified value.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#containsKey">containsKey</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Determine if a mapping contains specified key.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opAssign">opAssign</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Assignment (shallow copy) by value.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opAssign">opAssign</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Assignment (shallow copy) by reference.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opIndexAssign">opIndexAssign</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Set element at specified index in a collection.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opApply">opApply</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Foreach over a sequence, getting each element as T.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opApply">opApply</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Foreach over a mapping, getting each key/value as K/V.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#add">add</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Add an element to a sequence.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#add">add</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Add a key-value pair to a mapping.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opBinaryRight">opBinaryRight</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Determine whether a key is in a mapping, and access its value.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#remove">remove</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Remove first (if any) occurence of a value in a collection.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#removeAt">removeAt</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Remove element at the specified index of a collection.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/node/Node.html#opCmp">opCmp</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Compare with another _node.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
57
doc/html/api/dyaml/node/NodeException.html
Normal file
57
doc/html/api/dyaml/node/NodeException.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>NodeException</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/node.html>node</a>.</small><span class="highlight">NodeException</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/node.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/node.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/node.html">node</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public class NodeException : <a href="dyaml/exception/YAMLException.html">YAMLException</a>
|
||||
</code></pre>
|
||||
<div class="section "><p>Exception thrown at node related errors.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
68
doc/html/api/dyaml/node/YAMLNull.html
Normal file
68
doc/html/api/dyaml/node/YAMLNull.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>YAMLNull</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/node.html>node</a>.</small><span class="highlight">YAMLNull</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/node.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/node.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/node.html">node</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public struct YAMLNull
|
||||
</code></pre>
|
||||
<div class="section "><p>Null YAML type. Used in nodes with _null values.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="toString"></a><div class="symbol"><div class="description"><pre><code>public string <a href="dyaml/node/YAMLNull.html#toString">toString</a>() const pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Used for string conversion.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/node/YAMLNull.html#toString">toString</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Used for string conversion.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
179
doc/html/api/dyaml/representer.html
Normal file
179
doc/html/api/dyaml/representer.html
Normal file
|
@ -0,0 +1,179 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.representer</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.representer</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/representer.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/representer.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/representer.html">representer</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><a class="anchor" id="representNull"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representNull">representNull</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a _null _node as a _null YAML value.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representString"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representString">representString</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a string _node as a string scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representBytes"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representBytes">representBytes</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @system
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a bytes _node as a binary scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representBool"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representBool">representBool</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a bool _node as a bool scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representLong"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representLong">representLong</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @system
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a long _node as an integer scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representReal"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representReal">representReal</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @system
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a real _node as a floating point scalar.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representSysTime"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representSysTime">representSysTime</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @system
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a SysTime _node as a timestamp.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representNodes"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representNodes">representNodes</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a sequence _node as sequence/set.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="representNodes.pairs"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a>.Pair[] pairs
|
||||
</code></pre>
|
||||
<div class="section "><p>YAML sets are mapping with null values.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Variables</h2><table><tr><td><a href="dyaml/representer.html#representNodes.pairs">pairs</a></td><td><pre><code><a href="dyaml/node/Node.html">Node</a>.Pair[]
|
||||
</code></pre>
|
||||
</td><td><p>YAML sets are mapping with null values.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><a class="anchor" id="representPairs"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer.html#representPairs">representPairs</a>(
|
||||
ref <a href="dyaml/node/Node.html">Node</a> node,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a> representer) @system
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a mapping _node as map/ordered map/pairs.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="description"><div class="section "><p>YAML node _representer. Prepares YAML nodes for output. A tutorial can be
|
||||
found <a href="../tutorials/custom_types.html">here</a>. <br/>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Code based on <a href="http://www.pyyaml.org">PyYAML</a>.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/representer.html#representNull">representNull</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Represent a _null _node as a _null YAML value.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representString">representString</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Represent a string _node as a string scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representBytes">representBytes</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Represent a bytes _node as a binary scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representBool">representBool</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Represent a bool _node as a bool scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representLong">representLong</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Represent a long _node as an integer scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representReal">representReal</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Represent a real _node as a floating point scalar.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representSysTime">representSysTime</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Represent a SysTime _node as a timestamp.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representNodes">representNodes</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Represent a sequence _node as sequence/set.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer.html#representPairs">representPairs</a><span class="extrainfo"><span class="method-attribs"><span class="attr-system">@system</span></span></span></td><td></td><td><p>Represent a mapping _node as map/ordered map/pairs.
|
||||
</p>
|
||||
</td></tr></table><h2>Classes</h2><table><tr><td><a href="dyaml/representer/RepresenterException.html">RepresenterException</a></td><td></td><td><p>Exception thrown on Representer errors.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer/Representer.html">Representer</a></td><td></td><td><p>Represents YAML nodes as scalar, sequence and mapping nodes ready for output.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
433
doc/html/api/dyaml/representer/Representer.html
Normal file
433
doc/html/api/dyaml/representer/Representer.html
Normal file
|
@ -0,0 +1,433 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Representer</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/representer.html>representer</a>.</small><span class="highlight">Representer</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/representer.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/representer.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/representer.html">representer</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public final class Representer
|
||||
</code></pre>
|
||||
<div class="section "><p>Represents YAML nodes as scalar, sequence and mapping nodes ready for output.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This class is used to add support for dumping of custom data types.
|
||||
</p>
|
||||
<p>It can also override default node formatting styles for output.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(const Flag!"useDefaultRepresenters" useDefaultRepresenters = Yes.useDefaultRepresenters) @safe pure
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Representer.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">useDefaultRepresenters</td><td class="paramDoc"><p>Use default representer functions for default YAML types? This can be disabled to use custom representer functions for default types.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="defaultScalarStyle"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/representer/Representer.html#defaultScalarStyle">defaultScalarStyle</a>(<a href="dyaml/style/ScalarStyle.html">ScalarStyle</a> style) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set default _style for scalars. If style is <code class="d_inlinecode">ScalarStyle.Invalid</code>, the _style is chosen automatically.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="defaultCollectionStyle"></a><div class="symbol"><div class="description"><pre><code>public @property <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/representer/Representer.html#defaultCollectionStyle">defaultCollectionStyle</a>(<a href="dyaml/style/CollectionStyle.html">CollectionStyle</a> style) pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Set default _style for collections. If style is <code class="d_inlinecode">CollectionStyle.Invalid</code>, the _style is chosen automatically.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="addRepresenter"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/representer/Representer.html#addRepresenter">addRepresenter</a>(T)(<a href="dyaml/node/Node.html">Node</a> function(
|
||||
ref <a href="dyaml/node/Node.html">Node</a>,
|
||||
<a href="dyaml/representer/Representer.html">Representer</a>) representer) @trusted pure
|
||||
</code></pre>
|
||||
<div class="section "><p>Add a function to represent nodes with a specific data type.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>The representer function takes references to a <code class="d_inlinecode">Node</code> storing the data
|
||||
type and to the <code class="d_inlinecode">Representer</code>. It returns the represented node and may
|
||||
throw a <code class="d_inlinecode">RepresenterException</code>. See the example for more information.
|
||||
</p>
|
||||
<p>Only one function may be specified for one data type. Default data
|
||||
types already have representer functions unless disabled in the
|
||||
<code class="d_inlinecode">Representer</code> constructor.
|
||||
</p>
|
||||
<p>Structs and classes must implement the <code class="d_inlinecode">opCmp()</code> operator for D:YAML
|
||||
support. The signature of the operator that must be implemented
|
||||
is <code class="d_inlinecode">const int opCmp(ref const MyStruct s)</code> for structs where
|
||||
<i>MyStruct</i> is the struct type, and <code class="d_inlinecode">int opCmp(Object o)</code> for
|
||||
classes. Note that the class <code class="d_inlinecode">opCmp()</code> should not alter the compared
|
||||
values - it is not const for compatibility reasons.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">representer</td><td class="paramDoc"><p>Representer function to add.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
|
||||
Representing a simple struct:
|
||||
<pre><code>import std.string;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
<a href="dyaml/node/Node.html">Node</a> representMyStruct(ref <a href="dyaml/node/Node.html">Node</a> node, <a href="dyaml/representer/Representer.html">Representer</a> representer)
|
||||
{
|
||||
//The node is guaranteed to be MyStruct as we add representer for MyStruct.
|
||||
auto value = node.as!MyStruct;
|
||||
//Using custom scalar format, x:y:z.
|
||||
auto scalar = format("%s:%s:%s", value.x, value.y, value.z);
|
||||
//Representing as a scalar, with custom tag to specify <a href="dyaml/representer/Representer.html#this">this</a> data type.
|
||||
return representer.<a href="dyaml/representer/Representer.html#representScalar">representScalar</a>("!mystruct.tag", scalar);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
auto dumper = <a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml");
|
||||
auto representer = new <a href="dyaml/representer/Representer.html">Representer</a>;
|
||||
representer.<a href="dyaml/representer/Representer.html#addRepresenter">addRepresenter</a>!MyStruct(&representMyStruct);
|
||||
dumper.representer = representer;
|
||||
dumper.dump(<a href="dyaml/node/Node.html">Node</a>(MyStruct(1,2,3)));
|
||||
}</code></pre>
|
||||
|
||||
Representing a class:
|
||||
<pre><code>import std.string;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
class MyClass
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
<a href="dyaml/representer/Representer.html#this">this</a>(int x, int y, int z)
|
||||
{
|
||||
<a href="dyaml/representer/Representer.html#this">this</a>.x = x;
|
||||
<a href="dyaml/representer/Representer.html#this">this</a>.y = y;
|
||||
<a href="dyaml/representer/Representer.html#this">this</a>.z = z;
|
||||
}
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
override int opCmp(Object o)
|
||||
{
|
||||
MyClass s = cast(MyClass)o;
|
||||
if(s is null){return -1;}
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///Useful for <a href="dyaml/node/Node.html#as">Node.as</a>!string .
|
||||
override string toString()
|
||||
{
|
||||
return format("MyClass(%s, %s, %s)", x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
//Same as representMyStruct.
|
||||
<a href="dyaml/node/Node.html">Node</a> representMyClass(ref <a href="dyaml/node/Node.html">Node</a> node, <a href="dyaml/representer/Representer.html">Representer</a> representer)
|
||||
{
|
||||
//The node is guaranteed to be MyClass as we add representer for MyClass.
|
||||
auto value = node.as!MyClass;
|
||||
//Using custom scalar format, x:y:z.
|
||||
auto scalar = format("%s:%s:%s", value.x, value.y, value.z);
|
||||
//Representing as a scalar, with custom tag to specify <a href="dyaml/representer/Representer.html#this">this</a> data type.
|
||||
return representer.<a href="dyaml/representer/Representer.html#representScalar">representScalar</a>("!myclass.tag", scalar);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
auto dumper = <a href="dyaml/dumper/Dumper.html">Dumper</a>("file.yaml");
|
||||
auto representer = new <a href="dyaml/representer/Representer.html">Representer</a>;
|
||||
representer.<a href="dyaml/representer/Representer.html#addRepresenter">addRepresenter</a>!MyClass(&representMyClass);
|
||||
dumper.representer = representer;
|
||||
dumper.dump(<a href="dyaml/node/Node.html">Node</a>(new MyClass(1,2,3)));
|
||||
}</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representScalar"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer/Representer.html#representScalar">representScalar</a>(
|
||||
string tag,
|
||||
string scalar,
|
||||
<a href="dyaml/style/ScalarStyle.html">ScalarStyle</a> style = <a href="dyaml/style/ScalarStyle.html">ScalarStyle</a>.Invalid) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a _scalar with specified _tag.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is used by representer functions that produce scalars.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Tag of the _scalar.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">scalar</td><td class="paramDoc"><p>Scalar value.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">style</td><td class="paramDoc"><p>Style of the _scalar. If invalid, default _style will be used. If the node was loaded before, previous _style will always be used.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> The represented node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
<pre><code>struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
<a href="dyaml/node/Node.html">Node</a> representMyStruct(ref <a href="dyaml/node/Node.html">Node</a> node, <a href="dyaml/representer/Representer.html">Representer</a> representer)
|
||||
{
|
||||
auto value = node.as!MyStruct;
|
||||
auto scalar = format("%s:%s:%s", value.x, value.y, value.z);
|
||||
return representer.<a href="dyaml/representer/Representer.html#representScalar">representScalar</a>("!mystruct.tag", scalar);
|
||||
}</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representSequence"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer/Representer.html#representSequence">representSequence</a>(
|
||||
string tag,
|
||||
<a href="dyaml/node/Node.html">Node</a>[] sequence,
|
||||
<a href="dyaml/style/CollectionStyle.html">CollectionStyle</a> style = <a href="dyaml/style/CollectionStyle.html">CollectionStyle</a>.Invalid) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a _sequence with specified _tag, representing children first.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is used by representer functions that produce sequences.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Tag of the _sequence.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">sequence</td><td class="paramDoc"><p>Sequence of nodes.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">style</td><td class="paramDoc"><p>Style of the _sequence. If invalid, default _style will be used. If the node was loaded before, previous _style will always be used.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> The represented node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> <code class="d_inlinecode">RepresenterException</code> if a child could not be represented.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
<pre><code>struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
<a href="dyaml/node/Node.html">Node</a> representMyStruct(ref <a href="dyaml/node/Node.html">Node</a> node, <a href="dyaml/representer/Representer.html">Representer</a> representer)
|
||||
{
|
||||
auto value = node.as!MyStruct;
|
||||
auto nodes = [<a href="dyaml/node/Node.html">Node</a>(value.x), <a href="dyaml/node/Node.html">Node</a>(value.y), <a href="dyaml/node/Node.html">Node</a>(value.z)];
|
||||
//use flow style
|
||||
return representer.<a href="dyaml/representer/Representer.html#representSequence">representSequence</a>("!mystruct.tag", nodes,
|
||||
<a href="dyaml/style/CollectionStyle.html#Flow">CollectionStyle.Flow</a>);
|
||||
}</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="representMapping"></a><div class="symbol"><div class="description"><pre><code>public <a href="dyaml/node/Node.html">Node</a> <a href="dyaml/representer/Representer.html#representMapping">representMapping</a>(
|
||||
string tag,
|
||||
<a href="dyaml/node/Node.html">Node</a>.Pair[] pairs,
|
||||
<a href="dyaml/style/CollectionStyle.html">CollectionStyle</a> style = <a href="dyaml/style/CollectionStyle.html">CollectionStyle</a>.Invalid) @trusted
|
||||
</code></pre>
|
||||
<div class="section "><p>Represent a mapping with specified _tag, representing children first.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>This is used by representer functions that produce mappings.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Tag of the mapping.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">pairs</td><td class="paramDoc"><p>Key-value _pairs of the mapping.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">style</td><td class="paramDoc"><p>Style of the mapping. If invalid, default _style will be used. If the node was loaded before, previous _style will always be used.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Returns</h2>
|
||||
<p> The represented node.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Throws</h2>
|
||||
<p> <code class="d_inlinecode">RepresenterException</code> if a child could not be represented.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Example</h2>
|
||||
|
||||
<pre><code>struct MyStruct
|
||||
{
|
||||
int x, y, z;
|
||||
|
||||
//Any D:YAML type must have a custom opCmp operator.
|
||||
//This is used for ordering in mappings.
|
||||
const int opCmp(ref const MyStruct s)
|
||||
{
|
||||
if(x != s.x){return x - s.x;}
|
||||
if(y != s.y){return y - s.y;}
|
||||
if(z != s.z){return z - s.z;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
<a href="dyaml/node/Node.html">Node</a> representMyStruct(ref <a href="dyaml/node/Node.html">Node</a> node, <a href="dyaml/representer/Representer.html">Representer</a> representer)
|
||||
{
|
||||
auto value = node.as!MyStruct;
|
||||
auto pairs = [<a href="dyaml/node/Node.html">Node</a>.Pair("x", value.x),
|
||||
<a href="dyaml/node/Node.html">Node</a>.Pair("y", value.y),
|
||||
<a href="dyaml/node/Node.html">Node</a>.Pair("z", value.z)];
|
||||
return representer.<a href="dyaml/representer/Representer.html#representMapping">representMapping</a>("!mystruct.tag", pairs);
|
||||
}</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/representer/Representer.html#this">this</a></td><td></td><td><p>Construct a Representer.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/representer/Representer.html#defaultScalarStyle">defaultScalarStyle</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set default _style for scalars. If style is <code class="d_inlinecode">ScalarStyle.Invalid</code>, the _style is chosen automatically.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/representer/Representer.html#defaultCollectionStyle">defaultCollectionStyle</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Set default _style for collections. If style is <code class="d_inlinecode">CollectionStyle.Invalid</code>, the _style is chosen automatically.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer/Representer.html#addRepresenter">addRepresenter</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span>, <span class="attr-pure">pure</span></span></span></td><td></td><td><p>Add a function to represent nodes with a specific data type.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer/Representer.html#representScalar">representScalar</a><span class="extrainfo"><span class="method-attribs"><span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Represent a _scalar with specified _tag.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer/Representer.html#representSequence">representSequence</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Represent a _sequence with specified _tag, representing children first.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/representer/Representer.html#representMapping">representMapping</a><span class="extrainfo"><span class="method-attribs"><span class="attr-trusted">@trusted</span></span></span></td><td></td><td><p>Represent a mapping with specified _tag, representing children first.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
57
doc/html/api/dyaml/representer/RepresenterException.html
Normal file
57
doc/html/api/dyaml/representer/RepresenterException.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>RepresenterException</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/representer.html>representer</a>.</small><span class="highlight">RepresenterException</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/representer.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/representer.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/representer.html">representer</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public class RepresenterException : <a href="dyaml/exception/YAMLException.html">YAMLException</a>
|
||||
</code></pre>
|
||||
<div class="section "><p>Exception thrown on Representer errors.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
67
doc/html/api/dyaml/resolver.html
Normal file
67
doc/html/api/dyaml/resolver.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.resolver</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.resolver</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/resolver.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/resolver.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/resolver.html">resolver</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>Implements a class that resolves YAML tags. This can be used to implicitly
|
||||
resolve tags for custom data types, removing the need to explicitly
|
||||
specify tags in YAML. A tutorial can be found
|
||||
<a href="../tutorials/custom_types.html">here</a>. <br/>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Code based on <a href="http://www.pyyaml.org">PyYAML</a>.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Classes</h2><table><tr><td><a href="dyaml/resolver/Resolver.html">Resolver</a></td><td></td><td><p>Resolves YAML tags (data types).
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
173
doc/html/api/dyaml/resolver/Resolver.html
Normal file
173
doc/html/api/dyaml/resolver/Resolver.html
Normal file
|
@ -0,0 +1,173 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>Resolver</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/resolver.html>resolver</a>.</small><span class="highlight">Resolver</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/resolver.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/resolver.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/resolver.html">resolver</a></span>
|
||||
</li>
|
||||
<li>dyaml.<a href="dyaml/style.html">style</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public final class Resolver
|
||||
</code></pre>
|
||||
<div class="section "><p>Resolves YAML tags (data types).
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>Can be used to implicitly resolve custom data types of scalar values.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><a class="anchor" id="this"></a><div class="symbol"><div class="description"><pre><code>public this(Flag!"useDefaultImplicitResolvers" defaultImplicitResolvers = Yes.useDefaultImplicitResolvers) @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Construct a Resolver.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If you don't want to implicitly resolve default YAML tags/data types,
|
||||
you can use defaultImplicitResolvers to disable default resolvers.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">defaultImplicitResolvers</td><td class="paramDoc"><p>Use default YAML implicit resolvers?
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div></div><a class="anchor" id="addImplicitResolver"></a><div class="symbol"><div class="description"><pre><code>public <a href="http://dlang.org/type.html#basic-data-types">void</a> <a href="dyaml/resolver/Resolver.html#addImplicitResolver">addImplicitResolver</a>(
|
||||
string tag,
|
||||
Regex!char regexp,
|
||||
string first) pure @safe
|
||||
</code></pre>
|
||||
<div class="section "><p>Add an implicit scalar resolver.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><p>If a scalar matches regexp and starts with any character in first,
|
||||
its _tag is set to tag. If it matches more than one resolver _regexp
|
||||
resolvers added _first override ones added later. Default resolvers
|
||||
override any user specified resolvers, but they can be disabled in
|
||||
Resolver constructor.
|
||||
</p>
|
||||
<p>If a scalar is not resolved to anything, it is assigned the default
|
||||
YAML _tag for strings.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="section"><h2>Parameters</h2>
|
||||
<table class="params">
|
||||
<tr class="param"><td class="paramName">tag</td><td class="paramDoc"><p>Tag to resolve to.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">regexp</td><td class="paramDoc"><p>Regular expression the scalar must match to have this _tag.
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr class="param"><td class="paramName">first</td><td class="paramDoc"><p>String of possible starting characters of the scalar.
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section"><h2>Examples</h2>
|
||||
|
||||
|
||||
Resolve scalars starting with 'A' to !_tag :
|
||||
<pre><code>import std.regex;
|
||||
|
||||
import dyaml.all;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto loader = <a href="dyaml/loader/Loader.html">Loader</a>("file.txt");
|
||||
auto resolver = new <a href="dyaml/resolver/Resolver.html">Resolver</a>();
|
||||
resolver.<a href="dyaml/resolver/Resolver.html#addImplicitResolver">addImplicitResolver</a>("!tag", std.regex.regex("A.*"), "A");
|
||||
loader.resolver = resolver;
|
||||
|
||||
//Note that we have no constructor from tag "!tag", so we can't
|
||||
//actually load anything that resolves to <a href="dyaml/resolver/Resolver.html#this">this</a> tag.
|
||||
//See <a href="dyaml/constructor/Constructor.html">Constructor</a> API documentation and tutorial for more information.
|
||||
|
||||
auto node = loader.load();
|
||||
}</code></pre>
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="defaultScalarTag"></a><div class="symbol"><div class="description"><pre><code>package @property Tag <a href="dyaml/resolver/Resolver.html#defaultScalarTag">defaultScalarTag</a>() const pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Return default scalar tag.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="defaultSequenceTag"></a><div class="symbol"><div class="description"><pre><code>package @property Tag <a href="dyaml/resolver/Resolver.html#defaultSequenceTag">defaultSequenceTag</a>() const pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Return default sequence tag.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><a class="anchor" id="defaultMappingTag"></a><div class="symbol"><div class="description"><pre><code>package @property Tag <a href="dyaml/resolver/Resolver.html#defaultMappingTag">defaultMappingTag</a>() const pure @safe nothrow
|
||||
</code></pre>
|
||||
<div class="section "><p>Return default mapping tag.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div></div><div class="section members"><h2>Functions</h2><table><tr><td><a href="dyaml/resolver/Resolver.html#this">this</a></td><td></td><td><p>Construct a Resolver.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/resolver/Resolver.html#addImplicitResolver">addImplicitResolver</a><span class="extrainfo"><span class="method-attribs"><span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span></span></span></td><td></td><td><p>Add an implicit scalar resolver.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/resolver/Resolver.html#defaultScalarTag">defaultScalarTag</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Return default scalar tag.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/resolver/Resolver.html#defaultSequenceTag">defaultSequenceTag</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Return default sequence tag.
|
||||
</p>
|
||||
</td></tr><tr><td><span class="extrainfo"><span class="attribs"><span class="attr-property">@property</span></span></span><a href="dyaml/resolver/Resolver.html#defaultMappingTag">defaultMappingTag</a><span class="extrainfo"><span class="method-attribs"><span class="attr-const">const</span>, <span class="attr-pure">pure</span>, <span class="attr-safe">@safe</span>, <span class="attr-nothrow">nothrow</span></span></span></td><td></td><td><p>Return default mapping tag.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
61
doc/html/api/dyaml/style.html
Normal file
61
doc/html/api/dyaml/style.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css"/>
|
||||
<script src="../highlight.pack.js"></script>
|
||||
<title>dyaml.style</title>
|
||||
<base href="../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.style</small>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/style.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/style.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/style.html">style</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><div class="section "><p>YAML node formatting styles.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Enums</h2><table><tr><td><a href="dyaml/style/ScalarStyle.html">ScalarStyle</a></td><td></td><td><p>Scalar styles.
|
||||
</p>
|
||||
</td></tr><tr><td><a href="dyaml/style/CollectionStyle.html">CollectionStyle</a></td><td></td><td><p>Collection styles.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
65
doc/html/api/dyaml/style/CollectionStyle.html
Normal file
65
doc/html/api/dyaml/style/CollectionStyle.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>CollectionStyle</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/style.html>style</a>.</small><span class="highlight">CollectionStyle</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/style.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/style.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/style.html">style</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public enum CollectionStyle : <a href="http://dlang.org/type.html#basic-data-types">ubyte</a>
|
||||
</code></pre>
|
||||
<div class="section "><p>Collection styles.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Values</h2><table><tr><td>Invalid</td><td></td><td><p>Invalid (uninitialized) style
|
||||
</p>
|
||||
</td></tr><tr><td>Block</td><td></td><td><p>Block style.
|
||||
</p>
|
||||
</td></tr><tr><td>Flow</td><td></td><td><p>Flow style.
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
doc/html/api/dyaml/style/ScalarStyle.html
Normal file
71
doc/html/api/dyaml/style/ScalarStyle.html
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css"/>
|
||||
<script src="../../highlight.pack.js"></script>
|
||||
<title>ScalarStyle</title>
|
||||
<base href="../../"/>
|
||||
<script src="search.js"></script>
|
||||
<script src="show_hide.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="breadcrumbs">
|
||||
<table id="results"></table>
|
||||
<a href="index.html" class="home">⌂</a><input type="search" id="search" placeholder="Search" onkeyup="searchSubmit(this.value, event)"/>
|
||||
<small>dyaml.<a href=dyaml/style.html>style</a>.</small><span class="highlight">ScalarStyle</span>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href="dyaml/style.html#hide-toc" class="hide" id="hide-toc">«</a>
|
||||
<a href="dyaml/style.html#show-toc" class="show" id="show-toc">»</a>
|
||||
<div id="toc-id" class="toc">
|
||||
<ul><li><span class="package" onclick="show_hide('dyaml');">dyaml</span>
|
||||
<ul id="dyaml" style='display:block'>
|
||||
<li>dyaml.<a href="dyaml/constructor.html">constructor</a></li>
|
||||
<li>dyaml.<a href="dyaml/dumper.html">dumper</a></li>
|
||||
<li>dyaml.<a href="dyaml/exception.html">exception</a></li>
|
||||
<li>dyaml.<a href="dyaml/hacks.html">hacks</a></li>
|
||||
<li>dyaml.<a href="dyaml/linebreak.html">linebreak</a></li>
|
||||
<li>dyaml.<a href="dyaml/loader.html">loader</a></li>
|
||||
<li>dyaml.<a href="dyaml/node.html">node</a></li>
|
||||
<li>dyaml.<a href="dyaml/representer.html">representer</a></li>
|
||||
<li>dyaml.<a href="dyaml/resolver.html">resolver</a></li>
|
||||
<li><span class=" selected">dyaml.<a href="dyaml/style.html">style</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="content">
|
||||
<div class="aggregate-symbol"><div class="description"><pre><code>public enum ScalarStyle : <a href="http://dlang.org/type.html#basic-data-types">ubyte</a>
|
||||
</code></pre>
|
||||
<div class="section "><p>Scalar styles.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div><div class="section members"><h2>Values</h2><table><tr><td>Invalid</td><td></td><td><p>Invalid (uninitialized) style
|
||||
</p>
|
||||
</td></tr><tr><td>Literal</td><td></td><td><p><code class="prettyprint">|</code> (Literal block style)
|
||||
</p>
|
||||
</td></tr><tr><td>Folded</td><td></td><td><p><code class="prettyprint">></code> (Folded block style)
|
||||
</p>
|
||||
</td></tr><tr><td>Plain</td><td></td><td><p>Plain scalar
|
||||
</p>
|
||||
</td></tr><tr><td>SingleQuoted</td><td></td><td><p>Single quoted scalar
|
||||
</p>
|
||||
</td></tr><tr><td>DoubleQuoted</td><td></td><td><p>Double quoted scalar
|
||||
</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div><script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
Generated with <a href="https://github.com/kiith-sa/harbored-mod">harbored-mod</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue