YamlMap

YAML map representation.

The implementation preserves order and allows duplicated keys.

Constructors

this
this(YamlPair[] pairs)
this
this(K[] keys, V[] values)
this
this(K[V] associativeArray)

Members

Aliases

opBinaryRight
alias opBinaryRight(string op : "in") = _opIn
Undocumented in source.

Functions

_opIn
inout(YamlAlgebraic)* _opIn(char[] key)
inout(YamlAlgebraic)* _opIn(YamlAlgebraic key)
byKeyValue
auto byKeyValue()
length
size_t length()
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(typeof(this) rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(this) rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(YamlAlgebraic) opIndex(char[] key)
inout(YamlAlgebraic) opIndex(YamlAlgebraic key)
opIndex
auto opIndex()
opIndexAssign
YamlAlgebraic opIndexAssign(V value, string key)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
YamlAlgebraic opIndexAssign(V value, const(char)[] key)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
YamlAlgebraic opIndexAssign(V value, YamlAlgebraic key)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

pairs
YamlPair[] pairs;

Examples

YamlMap map = ["a" : 1];
assert(map["a"] == 1);
map[1.YamlAlgebraic] = "a";
map["a"] = 3;
map["a"].get!long++;
map["a"].get!"integer" += 3;
map["a"].integer += 3;
assert(map["a"] == 10);
assert(map[1.YamlAlgebraic] == "a");

// foreach iteration
long sum;
foreach (ref key, ref value; map)
    if (key == "a")
        sum += value.get!long;
assert(sum == 10);

Meta