Minor documentation and API fixes.
This commit is contained in:
parent
fbc962623d
commit
10dbb55ed8
Binary file not shown.
|
@ -92,16 +92,6 @@
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
|
||||||
<dt class="d_decl">package ScalarStyle <a name="scalarStyle"></a><span class="ddoc_psymbol">scalarStyle</span>;
|
|
||||||
</dt>
|
|
||||||
<dd><p>Node scalar style. Used to remember style this node was loaded with.</p>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt class="d_decl">package CollectionStyle <a name="collectionStyle"></a><span class="ddoc_psymbol">collectionStyle</span>;
|
|
||||||
</dt>
|
|
||||||
<dd><p>Node collection style. Used to remember style this node was loaded with.</p>
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="d_decl">this(T)(T <b>value</b>, in string <b>tag</b> = null);
|
<dt class="d_decl">this(T)(T <b>value</b>, in string <b>tag</b> = null);
|
||||||
</dt>
|
</dt>
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>Can be used to implicitly resolve custom data types of scalar values.</p>
|
<p>Can be used to implicitly resolve custom data types of scalar values.</p>
|
||||||
|
|
||||||
<dl><dt class="d_decl">this(in const(bool) <b>defaultImplicitResolvers</b> = true);
|
<dl><dt class="d_decl">this(bool <b>defaultImplicitResolvers</b> = true);
|
||||||
</dt>
|
</dt>
|
||||||
<dd><p>Construct a Resolver.
|
<dd><p>Construct a Resolver.
|
||||||
</p>
|
</p>
|
||||||
|
@ -61,12 +61,12 @@
|
||||||
you can use <b>defaultImplicitResolvers</b> to disable default resolvers.
|
you can use <b>defaultImplicitResolvers</b> to disable default resolvers.
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>const(bool) <b>defaultImplicitResolvers</b></td>
|
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>bool <b>defaultImplicitResolvers</b></td>
|
||||||
<td valign=top>Use default YAML implicit resolvers?</td></tr>
|
<td valign=top>Use default YAML implicit resolvers?</td></tr>
|
||||||
</table></div>
|
</table></div>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="d_decl">void <a name="addImplicitResolver"></a><span class="ddoc_psymbol">addImplicitResolver</span>(string <b>tag</b>, Regex!(char) <b>regexp</b>, in string <b>first</b>);
|
<dt class="d_decl">void <a name="addImplicitResolver"></a><span class="ddoc_psymbol">addImplicitResolver</span>(string <b>tag</b>, Regex!(char) <b>regexp</b>, string <b>first</b>);
|
||||||
</dt>
|
</dt>
|
||||||
<dd><p>Add an implicit scalar resolver.
|
<dd><p>Add an implicit scalar resolver.
|
||||||
</p>
|
</p>
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
{
|
{
|
||||||
<span class="d_keyword">auto</span> loader = Loader(<span class="d_string">"file.txt"</span>);
|
<span class="d_keyword">auto</span> loader = Loader(<span class="d_string">"file.txt"</span>);
|
||||||
<span class="d_keyword">auto</span> resolver = <span class="d_keyword">new</span> Resolver();
|
<span class="d_keyword">auto</span> resolver = <span class="d_keyword">new</span> Resolver();
|
||||||
resolver.<span class="d_psymbol">addImplicitResolver</span>(<span class="d_string">"!tag"</span>, std.regex.regex(<span class="d_string">"A*"</span>), <span class="d_string">"A"</span>);
|
resolver.<span class="d_psymbol">addImplicitResolver</span>(<span class="d_string">"!tag"</span>, std.regex.regex(<span class="d_string">"A.*"</span>), <span class="d_string">"A"</span>);
|
||||||
loader.resolver = resolver;
|
loader.resolver = resolver;
|
||||||
|
|
||||||
<span class="d_comment">//Note that we have no constructor from tag "!tag", so we can't
|
<span class="d_comment">//Note that we have no constructor from tag "!tag", so we can't
|
||||||
|
|
|
@ -138,7 +138,7 @@ struct appears in Phobos.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -364,7 +364,7 @@ directory of the D:YAML package.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -237,7 +237,7 @@ example in the <tt class="docutils literal"><span class="pre">example/getting_st
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -330,7 +330,7 @@ Some of these might change in the future (especially !!map and !!set).</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
© Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
|
||||||
Last updated on Nov 17, 2011.
|
Last updated on Nov 18, 2011.
|
||||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -180,9 +180,9 @@ struct Node
|
||||||
package:
|
package:
|
||||||
//Tag of the node.
|
//Tag of the node.
|
||||||
Tag tag_;
|
Tag tag_;
|
||||||
///Node scalar style. Used to remember style this node was loaded with.
|
//Node scalar style. Used to remember style this node was loaded with.
|
||||||
ScalarStyle scalarStyle = ScalarStyle.Invalid;
|
ScalarStyle scalarStyle = ScalarStyle.Invalid;
|
||||||
///Node collection style. Used to remember style this node was loaded with.
|
//Node collection style. Used to remember style this node was loaded with.
|
||||||
CollectionStyle collectionStyle = CollectionStyle.Invalid;
|
CollectionStyle collectionStyle = CollectionStyle.Invalid;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -61,7 +61,7 @@ final class Resolver
|
||||||
*
|
*
|
||||||
* Params: defaultImplicitResolvers = Use default YAML implicit resolvers?
|
* Params: defaultImplicitResolvers = Use default YAML implicit resolvers?
|
||||||
*/
|
*/
|
||||||
this(in bool defaultImplicitResolvers = true)
|
this(bool defaultImplicitResolvers = true)
|
||||||
{
|
{
|
||||||
defaultScalarTag_ = Tag("tag:yaml.org,2002:str");
|
defaultScalarTag_ = Tag("tag:yaml.org,2002:str");
|
||||||
defaultSequenceTag_ = Tag("tag:yaml.org,2002:seq");
|
defaultSequenceTag_ = Tag("tag:yaml.org,2002:seq");
|
||||||
|
@ -104,7 +104,7 @@ final class Resolver
|
||||||
* {
|
* {
|
||||||
* auto loader = Loader("file.txt");
|
* auto loader = Loader("file.txt");
|
||||||
* auto resolver = new Resolver();
|
* auto resolver = new Resolver();
|
||||||
* resolver.addImplicitResolver("!tag", std.regex.regex("A*"), "A");
|
* resolver.addImplicitResolver("!tag", std.regex.regex("A.*"), "A");
|
||||||
* loader.resolver = resolver;
|
* loader.resolver = resolver;
|
||||||
*
|
*
|
||||||
* //Note that we have no constructor from tag "!tag", so we can't
|
* //Note that we have no constructor from tag "!tag", so we can't
|
||||||
|
@ -115,7 +115,7 @@ final class Resolver
|
||||||
* }
|
* }
|
||||||
* --------------------
|
* --------------------
|
||||||
*/
|
*/
|
||||||
void addImplicitResolver(string tag, Regex!char regexp, in string first)
|
void addImplicitResolver(string tag, Regex!char regexp, string first)
|
||||||
{
|
{
|
||||||
foreach(const dchar c; first)
|
foreach(const dchar c; first)
|
||||||
{
|
{
|
||||||
|
@ -141,7 +141,7 @@ final class Resolver
|
||||||
*
|
*
|
||||||
* Returns: Resolved tag.
|
* Returns: Resolved tag.
|
||||||
*/
|
*/
|
||||||
Tag resolve(in NodeID kind, Tag tag, string value, in bool implicit)
|
Tag resolve(NodeID kind, Tag tag, string value, bool implicit)
|
||||||
{
|
{
|
||||||
if(!tag.isNull() && tag.get() != "!"){return tag;}
|
if(!tag.isNull() && tag.get() != "!"){return tag;}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue