Mapped

Map a file onto a D type. Experimental.

Constructors

this
this(string fn)
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Alias This

__mapped_data

Members

Properties

__mapped_data
T __mapped_data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

__mapped_file
typeof(__mapped_makeFile(null)) __mapped_file;
Undocumented in source.

Examples

static struct S
{
	ubyte value;
}

enum fn = "test.bin";
scope(success) remove(fn);
auto m = Mapped!S(fn);

m.value = 1;
assert(read(fn) == [ubyte(1)]);
version (Posix)
{
	write(fn, [ubyte(2)]);
	assert(m.value == 2);
}

Meta