From e835f1a1912f059531309a11adf151de83699011 Mon Sep 17 00:00:00 2001
From: Ferdinand Majerech
Date: Sat, 29 Oct 2011 20:43:30 +0200
Subject: [PATCH] Updated Representer API doc, minor documentation changes.
---
autoddoc.cfg | 2 +-
doc/doctrees/environment.pickle | Bin 12705 -> 12705 bytes
doc/doctrees/tutorials/custom_types.doctree | Bin 46981 -> 47085 bytes
doc/html/_sources/tutorials/custom_types.txt | 55 +++++++++----------
doc/html/api/dyaml.constructor.html | 6 +-
doc/html/api/dyaml.dumper.html | 2 +
doc/html/api/dyaml.encoding.html | 2 +
doc/html/api/dyaml.exception.html | 4 +-
doc/html/api/dyaml.linebreak.html | 2 +
doc/html/api/dyaml.loader.html | 6 +-
doc/html/api/dyaml.node.html | 12 ++--
doc/html/api/dyaml.representer.html | 20 +++++--
doc/html/api/dyaml.resolver.html | 6 +-
doc/html/api/index.html | 2 +
doc/html/articles/spec_differences.html | 2 +-
doc/html/index.html | 2 +-
doc/html/search.html | 2 +-
doc/html/searchindex.js | 2 +-
doc/html/tutorials/custom_types.html | 55 +++++++++----------
doc/html/tutorials/getting_started.html | 2 +-
doc/html/tutorials/yaml_syntax.html | 2 +-
docsrc/tutorials/custom_types.rst | 55 +++++++++----------
dyaml/representer.d | 18 ++++--
23 files changed, 144 insertions(+), 115 deletions(-)
diff --git a/autoddoc.cfg b/autoddoc.cfg
index 741fd31..15aea1f 100644
--- a/autoddoc.cfg
+++ b/autoddoc.cfg
@@ -29,7 +29,7 @@ links = ../index.html Documentation home
# Source files or patterns to ignore. Supports regexp syntax.
# E.g; To ignore main.d and all source files in the test/ directory,
# you would use: "main.d test/*"
-ignore = test/*, examples/*, docsrc/*, autoddoc/*, yaml.d, unittest.d, cdc.d, dyaml/composer.d, dyaml/event.d, dyaml/parser.d, dyaml/reader.d, dyaml/scanner.d, dyaml/token.d, dyaml/util.d, dyaml/anchor.d, dyaml/emitter.d, dyaml/flags.d, dyaml/serializer.d, dyaml/sharedobject.d, dyaml/tag.d, dyaml/tagdirectives.d, dyaml/queue.d, dyaml/escapes.d, dyaml/fastcharsearch.d, dyaml/style.d
+ignore = test/*, examples/*, docsrc/*, autoddoc/*, yaml.d, unittest.d, cdc.d, dyaml/composer.d, dyaml/event.d, dyaml/parser.d, dyaml/reader.d, dyaml/scanner.d, dyaml/token.d, dyaml/util.d, dyaml/anchor.d, dyaml/emitter.d, dyaml/flags.d, dyaml/serializer.d, dyaml/sharedobject.d, dyaml/tag.d, dyaml/tagdirectives.d, dyaml/queue.d, dyaml/escapes.d, dyaml/fastcharsearch.d
[DDOC]
# Command to use to generate the documentation.
diff --git a/doc/doctrees/environment.pickle b/doc/doctrees/environment.pickle
index 2c074b70c6f55ccd41e8bdc8d4e253cb349f7902..ecdd68cb6a49845c64463a882c8cdb1f920f4738 100644
GIT binary patch
delta 63
zcmZ3OyfAq~tG>}{A>9MVR%9r~yBH0;{%QKYS9WMi!-AQjVbRf*Bg)1^lA3vd+Il~wDnku(w-jeZEz62D<24Z=aPg#;K37$Oj07!Vj`)HBmkw=^?7yzY?@
zu`J2Ki7}2bx_}+WAH*m8KVkqUwv&xRY{#)N4K*n1VviOPL$d6L
z&r)t}UZaVAO*9l$w~*bZMFM^?qRV19AgLiSr1>#IkN6Z((#4<@4y&PdUF=p3Mf3$E
zT^Ie5A&Egb=#`o75|?P*a+l01EijZ~&op|%7|p@pPo5!IU{~_8f;ayO)Vz`+{!{39
zBlR3+Wouduw$G(a7HZ&f+8?Y7XRn{Xe3|HzLZTGVVJNFUT9%jAez
zMOOBW{L!JTNrEs9Udk?qkF%#_h)mYCK$mQR@z(iPiODg8-(`U=>)dgop^1{;FRHVq
zD2blS-6{N4DGdO5h1Ywc&*$aj=O4u!HEG>g(vrbT9kU3RrVVQ}v^mqZ`u=TL)Q`=Nr@h?^1E-VD=Oebty
znURePJLbU!tJY4B24^~w1P|oaIB$mSqgj5qVb{*R4>cx0@2YOuMiZ%=G
zeN2}tdC^eyLPS!jr!TK`F^upm0rdMH^~99=4(O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1ON{;Bhx+Zp(>eeYL%9?W~lR8X4k)~swAzT`dsnc+r&r&1p7-B`w6pVsmteu!(&lfW-_LWv
zPA?$$w6bp#pGEbu?@+~#X)tq&zYF)BExqk!&Tg9;o!h4daHo6^joq$%YPi)P-d@q$
z76(G};AO9%7ZWI*Nds})_f4CPuXB8xzY5lKSLeP)z64hyy@xMgJ<5InOV7EAUgz~6
xVu{~Kwe-Sz1M5{vSvS0PJRe>>XA^&fhHmy_EL|xy+sN<}Y(&{lv5fRM{}1-}oYVjS
diff --git a/doc/html/_sources/tutorials/custom_types.txt b/doc/html/_sources/tutorials/custom_types.txt
index 35d48e0..9b3eaf5 100644
--- a/doc/html/_sources/tutorials/custom_types.txt
+++ b/doc/html/_sources/tutorials/custom_types.txt
@@ -2,15 +2,15 @@
Custom YAML data types
======================
-Often you might want to serialize complex data types such as classes. You can
-use functions to process nodes such as a mapping containing class data members
-indexed by name. Alternatively, YAML supports custom data types using
-identifiers called *tags*. That is the topic of this tutorial.
+Sometimes you need to serialize complex data types such as classes. To do this
+you could use plain nodes such as mappings with class data members. However,
+YAML supports custom types with identifiers called *tags*. That is the topic of
+this tutorial.
Each YAML node has a tag specifying its type. For instance: strings use the tag
``tag:yaml.org,2002:str``. Tags of most default types are *implicitly resolved*
during parsing, so you don't need to specify tag for each float, integer, etc.
-It is also possible to implicitly resolve custom tags, as we will show later.
+D:YAML can also implicitly resolve custom tags, as we will show later.
-----------
@@ -18,16 +18,16 @@ Constructor
-----------
D:YAML uses the `Constructor <../api/dyaml.constructor.html>`_ class to process
-each node to hold data type corresponding to its tag. *Constructor* stores a
-function for each supported tag to process it. These functions are supplied by
-the user using the *addConstructorXXX()* methods, where *XXX* is *Scalar*,
-*Sequence* or *Mapping*. *Constructor* is then passed to *Loader*, which parses
-YAML input.
+each node to hold data type corresponding to its tag. *Constructor* stores
+functions to process each supported tag. These are supplied by the user using
+the *addConstructorXXX()* methods, where *XXX* is *Scalar*, *Sequence* or
+*Mapping*. *Constructor* is then passed to *Loader*, which parses YAML input.
Struct types have no specific requirements for YAML support. Class types should
define the *opEquals()* operator, as this is used in equality comparisons of
nodes. Default class *opEquals()* compares references, which means two identical
-objects might be considered unequal.
+objects might be considered unequal. (Default struct *opEquals()* compares
+byte-by-byte, sometimes you might want to override that as well.)
We will implement support for an RGB color type. It is implemented as the
following struct:
@@ -173,10 +173,10 @@ You can find the source code for what we've done so far in the
Resolver
--------
-Specifying tag for every color value can be tedious. D:YAML can implicitly
-resolve scalar tags using regular expressions. This is how default types such as
-int are resolved. We will use the `Resolver <../api/dyaml.resolver.html>`_ class
-to add implicit tag resolution for the Color data type (in its scalar form).
+Specifying tag for every color can be tedious. D:YAML can implicitly resolve
+scalar tags using regular expressions. This is how default types are resolved.
+We will use the `Resolver <../api/dyaml.resolver.html>`_ class to add implicit
+tag resolution for the Color data type (in its scalar form).
We use the *addImplicitResolver()* method of *Resolver*, passing the tag,
regular expression the scalar must match to resolve to this tag, and a string of
@@ -228,9 +228,9 @@ D:YAML package.
Representer
-----------
-Now that you know how to load custom data types, it might also be useful to know
-how to dump them. D:YAML uses the `Representer <../api/dyaml.representer.html>`_
-class for this purpose.
+Now that you can load custom data types, it might be good to know how to dump
+them. D:YAML uses the `Representer <../api/dyaml.representer.html>`_ class for
+this purpose.
*Representer* processes YAML nodes into plain mapping, sequence or scalar nodes
ready for output. Just like with *Constructor*, this is done by user specified
@@ -239,15 +239,14 @@ functions. These functions take references to a node to process and to the
Representer functions can be added with the *addRepresenter()* method. The
*Representer* is then passed to *Dumper*, which dumps YAML documents. Only one
-representer can be added for a type. This is asserted in *addRepresenter()*
-preconditions. By default, the default YAML types already have representer
-functions, but you can disable them by constructing *Representer* with the
+function per type can be specified. This is asserted in *addRepresenter()*
+preconditions. Default YAML types already have representer functions specified,
+but you can disable them by constructing *Representer* with the
*useDefaultRepresenters* parameter set to false.
-By default, tags are explicitly specified for all non-default types. If you
-want the tags to be implicit, you can pass a *Resolver* that will resolve them
-implicitly. Of course, you will then need to use an identical *Resolver* when
-loading the output.
+By default, tags are explicitly output for all non-default types. To make dumped
+tags implicit, you can pass a *Resolver* that will resolve them implicitly. Of
+course, you will need to use an identical *Resolver* when loading the output.
With the following code, we will add support for dumping the our Color type.
@@ -274,10 +273,10 @@ With the following code, we will add support for dumping the our Color type.
First we get the *Color* from the node. Then we convert it to a string with the
CSS-like format we've used before. Finally, we use the *representScalar()*
-method of *Representer* to get a scalar node ready for output.
-There are corresponding *representMapping()* and *representSequence()* methods
+method of *Representer* to get a scalar node ready for output. There are
+corresponding *representMapping()* and *representSequence()* methods
as well, with examples in the
-`Resolver API documentation <../api/dyaml.resolver.html>`_.
+`Resolver API documentation <../api/dyaml.resolver.html>`_.
Since a type can only have one representer function, we don't dump *Color* both
in the scalar and mapping formats we've used before. However, you can decide to
diff --git a/doc/html/api/dyaml.constructor.html b/doc/html/api/dyaml.constructor.html
index 63d0eca..da144bb 100644
--- a/doc/html/api/dyaml.constructor.html
+++ b/doc/html/api/dyaml.constructor.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
@@ -81,7 +83,7 @@
If a tag is detected with no known constructor function, it is considered an error.
-- this(in bool defaultConstructors = true);
+
- this(in const(bool) defaultConstructors = true);
Construct a Constructor.
@@ -89,7 +91,7 @@
defaultConstructors to disable constructor functions for these.
-Parameters:bool defaultConstructors |
+Parameters:const(bool) defaultConstructors |
Use constructors for default YAML tags? |
diff --git a/doc/html/api/dyaml.dumper.html b/doc/html/api/dyaml.dumper.html
index 2ccf744..fad08ae 100644
--- a/doc/html/api/dyaml.dumper.html
+++ b/doc/html/api/dyaml.dumper.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
diff --git a/doc/html/api/dyaml.encoding.html b/doc/html/api/dyaml.encoding.html
index 85aea05..93068b0 100644
--- a/doc/html/api/dyaml.encoding.html
+++ b/doc/html/api/dyaml.encoding.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
diff --git a/doc/html/api/dyaml.exception.html b/doc/html/api/dyaml.exception.html
index c961026..a1c5237 100644
--- a/doc/html/api/dyaml.exception.html
+++ b/doc/html/api/dyaml.exception.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
@@ -56,7 +58,7 @@
Position in a YAML stream, used for error messages.
-- this(in uint line, in uint column);
+
- this(in const(uint) line, in const(uint) column);
Construct a Mark with specified line and column in the file.
diff --git a/doc/html/api/dyaml.linebreak.html b/doc/html/api/dyaml.linebreak.html
index 8e14db5..13e4e4f 100644
--- a/doc/html/api/dyaml.linebreak.html
+++ b/doc/html/api/dyaml.linebreak.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
diff --git a/doc/html/api/dyaml.loader.html b/doc/html/api/dyaml.loader.html
index f3f3e8f..f38dc9c 100644
--- a/doc/html/api/dyaml.loader.html
+++ b/doc/html/api/dyaml.loader.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
@@ -97,11 +99,11 @@
-- this(in string filename);
+
- this(in const(immutable(char)[]) filename);
Construct a Loader to load YAML from a file.
-Parameters:string filename |
+Parameters:const(immutable(char)[]) filename |
Name of the file to load from. |
Throws:YAMLException if the file could not be opened or read.
diff --git a/doc/html/api/dyaml.node.html b/doc/html/api/dyaml.node.html
index 5e58e4d..d4e31f2 100644
--- a/doc/html/api/dyaml.node.html
+++ b/doc/html/api/dyaml.node.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
@@ -74,7 +76,7 @@
Value node.
-- auto this(K, V)(K key, V value);
+
- this(K, V)(K key, V value);
Construct a Pair from two values. Will be converted to Nodes if needed.
@@ -96,7 +98,7 @@
Node collection style. Used to remember style this node was loaded with.
-- auto this(T)(T value, in string tag = null);
+
- this(T)(T value, in string tag = null);
Construct a Node from a value.
@@ -124,7 +126,7 @@
-- auto this(T)(T[] array, in string tag = null);
+
- this(T)(T[] array, in string tag = null);
Construct a node from an array.
@@ -154,7 +156,7 @@
-- auto this(K, V)(V[K] array, in string tag = null);
+
- this(K, V)(V[K] array, in string tag = null);
Construct a node from an associative array.
@@ -186,7 +188,7 @@
-- auto this(K, V)(K[] keys, V[] values, in string tag = null);
+
- this(K, V)(K[] keys, V[] values, in string tag = null);
Construct a node from arrays of keys and values.
diff --git a/doc/html/api/dyaml.representer.html b/doc/html/api/dyaml.representer.html
index 8f8f002..a97ceb6 100644
--- a/doc/html/api/dyaml.representer.html
+++ b/doc/html/api/dyaml.representer.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
@@ -72,12 +74,12 @@
- @property void defaultScalarStyle(ScalarStyle style);
-Set default style for scalars. Invalid means the style is chosen automatically.
+Set default style for scalars. Invalid means the style is chosen automatically.
- @property void defaultCollectionStyle(CollectionStyle style);
-Set default style for collections. Invalid means the style is chosen automatically.
+Set default style for collections. Invalid means the style is chosen automatically.
- void addRepresenter(T)(Node function(ref Node, Representer) representer);
@@ -193,7 +195,8 @@
string scalar |
Scalar value. |
ScalarStyle style |
-Style of the scalar (will be default if invalid). |
+Style of the scalar. If invalid, default style will be used.
+ If the node was loaded before, previous style will always be used. |
Returns:The represented node.
@@ -209,6 +212,7 @@
auto value = node.as!MyStruct;
auto scalar = format(value.x, ":", value.y, ":", value.z);
return representer.representScalar("!mystruct.tag", scalar);
+
}
@@ -226,7 +230,8 @@
Node[] sequence |
Sequence of nodes. |
CollectionStyle style |
-Style of the sequence (will be default if invalid). |
+Style of the sequence. If invalid, default style will be used.
+ If the node was loaded before, previous style will always be used. |
Returns:The represented node.
@@ -244,7 +249,9 @@
{
auto value = node.as!MyStruct;
auto nodes = [Node(value.x), Node(value.y), Node(value.z)];
- return representer.representSequence("!mystruct.tag", nodes);
+ return representer.representSequence("!mystruct.tag", nodes,
+ CollectionStyle.Flow);
}
@@ -262,7 +269,8 @@
Pair[] pairs |
Key-value pairs of the mapping. |
CollectionStyle style |
-Style of the mapping (will be default if invalid). |
+Style of the mapping. If invalid, default style will be used.
+ If the node was loaded before, previous style will always be used. |
Returns:
@@ -52,7 +54,7 @@
Can be used to implicitly resolve custom data types of scalar values.
-- this(in bool defaultImplicitResolvers = true);
+
- this(in const(bool) defaultImplicitResolvers = true);
Construct a Resolver.
@@ -60,7 +62,7 @@
you can use defaultImplicitResolvers to disable default resolvers.
-Parameters:bool defaultImplicitResolvers |
+Parameters:const(bool) defaultImplicitResolvers |
Use default YAML implicit resolvers? |
diff --git a/doc/html/api/index.html b/doc/html/api/index.html
index 2bcfa00..304962a 100644
--- a/doc/html/api/index.html
+++ b/doc/html/api/index.html
@@ -32,6 +32,8 @@
- dyaml.node
- dyaml.representer
- dyaml.resolver
+- dyaml.std.variant
+- dyaml.style
diff --git a/doc/html/articles/spec_differences.html b/doc/html/articles/spec_differences.html
index aa571a2..5d4970b 100644
--- a/doc/html/articles/spec_differences.html
+++ b/doc/html/articles/spec_differences.html
@@ -138,7 +138,7 @@ struct appears in Phobos.