tango.io.stream.Map

License:

BSD style: see license.txt

Version:

Initial release: Oct 2007

Author:

Kris

Simple serialization for text-based name/value pairs

class MapInput(T) : Lines!(T) #
Provides load facilities for a properties stream. That is, a file or other medium containing lines of text with a name=value layout
this(InputStream stream) #
Propagate ctor to superclass
int opApply(int delegate(ref T[] name, ref T[] value) dg) [final] #
Load properties from the provided stream, via a foreach.
We use an iterator to sweep text lines, and extract lValue and rValue pairs from each one, The expected file format is as follows:

1
2
3
4
5
x = y
abc = 123
x.y.z = this is a single property

# this is a comment line

Note that the provided name and value are actually slices and should be copied if you intend to retain them (using name.dup and value.dup where appropriate)

MapInput load(ref T[][T[]] properties) [final] #
Load the input stream into an AA
class MapOutput(T) : OutputFilter #
Provides write facilities on a properties stream. That is, a file or other medium which will contain lines of text with a name=value layout
this(OutputStream stream, T[] newline = NL) #
Propagate ctor to superclass
MapOutput newline() [final] #
Append a newline to the provided stream
MapOutput comment(T[] text) [final] #
Append a comment to the provided stream
MapOutput append(T[] name, T[] value) [final] #
Append name & value to the provided stream
MapOutput append(T[][T[]] properties) [final] #
Append AA properties to the provided stream