Doc fixes

This commit is contained in:
Ferdinand Majerech 2015-02-21 14:31:55 +01:00
parent 7f6b7cc2c3
commit 05270e5f60
8 changed files with 55 additions and 54 deletions

View file

@ -66,11 +66,11 @@ private alias ConstructorException Error;
final class Constructor
{
private:
/// Constructor functions from scalars.
// Constructor functions from scalars.
Node.Value delegate(ref Node)[Tag] fromScalar_;
/// Constructor functions from sequences.
// Constructor functions from sequences.
Node.Value delegate(ref Node)[Tag] fromSequence_;
/// Constructor functions from mappings.
// Constructor functions from mappings.
Node.Value delegate(ref Node)[Tag] fromMapping_;
public:

View file

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
/**
* YAML _dumper.
* YAML dumper.
*
* Code based on $(LINK2 http://www.pyyaml.org, PyYAML).
*/
@ -113,34 +113,34 @@ struct Dumper
}
private:
///Resolver to resolve tags.
//Resolver to resolve tags.
Resolver resolver_;
///Representer to represent data types.
//Representer to represent data types.
Representer representer_;
///Stream to write to.
//Stream to write to.
Stream stream_;
///Write scalars in canonical form?
//Write scalars in canonical form?
bool canonical_;
///Indentation width.
//Indentation width.
int indent_ = 2;
///Preferred text width.
//Preferred text width.
uint textWidth_ = 80;
///Line break to use.
//Line break to use.
LineBreak lineBreak_ = LineBreak.Unix;
///Character encoding to use.
//Character encoding to use.
Encoding encoding_ = Encoding.UTF_8;
///YAML version string.
//YAML version string.
string YAMLVersion_ = "1.1";
///Tag directives to use.
//Tag directives to use.
TagDirective[] tags_ = null;
///Always write document start?
//Always write document start?
Flag!"explicitStart" explicitStart_ = No.explicitStart;
///Always write document end?
//Always write document end?
Flag!"explicitEnd" explicitEnd_ = No.explicitEnd;
///Name of the output file or stream, used in error messages.
//Name of the output file or stream, used in error messages.
string name_ = "<unknown>";
public:

View file

@ -46,11 +46,12 @@ unittest
assert(node.scalarStyleHack() == ScalarStyle.Invalid);
}
/// Get the collection style a YAML node had in the file it was loaded from.
///
/// May only be called on collection nodes (nodes where node.isScalar() != true).
///
/// See_Also: scalarStyleHack
/** Get the collection style a YAML node had in the file it was loaded from.
*
* May only be called on collection nodes (nodes where node.isScalar() != true).
*
* See_Also: scalarStyleHack
*/
CollectionStyle collectionStyleHack(ref const(Node) node) @safe nothrow
{
assert(!node.isScalar, "Trying to get collection style of a scalar node");
@ -64,12 +65,12 @@ unittest
}
/// Set the scalar style node should have when written to a file.
///
/// Setting the style might be useful when generating YAML or reformatting existing
/// files.
///
/// May only be called on scalar nodes (nodes where node.isScalar() == true).
/** Set the scalar style node should have when written to a file.
*
* Setting the style might be useful when generating YAML or reformatting existing files.
*
* May only be called on scalar nodes (nodes where node.isScalar() == true).
*/
void scalarStyleHack(ref Node node, const ScalarStyle rhs) @safe nothrow
{
assert(node.isScalar, "Trying to set scalar style of a non-scalar node");
@ -84,12 +85,12 @@ unittest
assert(node.scalarStyleHack() == ScalarStyle.DoubleQuoted);
}
/// Set the collection style node should have when written to a file.
///
/// Setting the style might be useful when generating YAML or reformatting existing
/// files.
///
/// May only be called on collection nodes (nodes where node.isScalar() != true).
/** Set the collection style node should have when written to a file.
*
* Setting the style might be useful when generating YAML or reformatting existing files.
*
* May only be called on collection nodes (nodes where node.isScalar() != true).
*/
void collectionStyleHack(ref Node node, const CollectionStyle rhs) @safe nothrow
{
assert(!node.isScalar, "Trying to set collection style of a scalar node");

View file

@ -100,19 +100,19 @@ import dyaml.token;
struct Loader
{
private:
/// Reads character data from a stream.
// Reads character data from a stream.
Reader reader_;
/// Processes character data to YAML tokens.
// Processes character data to YAML tokens.
Scanner scanner_;
/// Processes tokens to YAML events.
// Processes tokens to YAML events.
Parser parser_;
/// Resolves tags (data types).
// Resolves tags (data types).
Resolver resolver_;
/// Constructs YAML data types.
// Constructs YAML data types.
Constructor constructor_;
/// Name of the input file or stream, used in error messages.
// Name of the input file or stream, used in error messages.
string name_ = "<unknown>";
/// Are we done loading?
// Are we done loading?
bool done_ = false;
public:

View file

@ -118,7 +118,7 @@ package class YAMLContainer(T) if (!Node.allowed!T): YAMLObject
}
/// Key-value pair of YAML nodes, used in mappings.
// Key-value pair of YAML nodes, used in mappings.
private struct Pair
{
public:
@ -204,9 +204,9 @@ struct Node
}
private:
/// Stored value.
// Stored value.
Value value_;
/// Start position of the node.
// Start position of the node.
Mark startMark_;
package:

View file

@ -48,11 +48,11 @@ class RepresenterException : YAMLException
final class Representer
{
private:
///Representer functions indexed by types.
// Representer functions indexed by types.
Node function(ref Node, Representer)[TypeInfo] representers_;
///Default style for scalar nodes.
// Default style for scalar nodes.
ScalarStyle defaultScalarStyle_ = ScalarStyle.Invalid;
///Default style for collection nodes.
// Default style for collection nodes.
CollectionStyle defaultCollectionStyle_ = CollectionStyle.Invalid;
public:

View file

@ -34,14 +34,14 @@ import dyaml.tag;
final class Resolver
{
private:
///Default tag to use for scalars.
// Default tag to use for scalars.
Tag defaultScalarTag_;
///Default tag to use for sequences.
// Default tag to use for sequences.
Tag defaultSequenceTag_;
///Default tag to use for mappings.
// Default tag to use for mappings.
Tag defaultMappingTag_;
/**
/*
* Arrays of scalar resolver tuples indexed by starting character of a scalar.
*
* Each tuple stores regular expression the scalar must match,
@ -222,7 +222,7 @@ final class Resolver
@property Tag defaultMappingTag() const pure @safe nothrow {return defaultMappingTag_;}
private:
///Add default implicit resolvers.
// Add default implicit resolvers.
void addImplicitResolvers() @safe
{
addImplicitResolver("tag:yaml.org,2002:bool",

View file

@ -12,8 +12,8 @@ module dyaml.style;
enum ScalarStyle : ubyte
{
Invalid = 0, /// Invalid (uninitialized) style
Literal, /// | (Literal block style)
Folded, /// > (Folded block style)
Literal, /// `|` (Literal block style)
Folded, /// `>` (Folded block style)
Plain, /// Plain scalar
SingleQuoted, /// Single quoted scalar
DoubleQuoted /// Double quoted scalar