io 0.1.1

Core I/O functionality.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

io Build Status Build Status codecov

Documentation std.io

IOs are thin, OS-independent abstractions I/O devices.

size_t write(const scope ubyte[] buffer);
size_t read(scope ubyte[] buffer);

IOs support scatter/gather read/write.

size_t write(const scope ubyte[][] buffers...);
size_t read(scope ubyte[][] buffers...);

IOs are @safe and @nogc.

void read() @safe @nogc
{
    auto f = File(chainPath("tmp", "file.txt"));
    ubyte[128] buf;
    f.read(buf[]);
    // ...
}

IOs use exceptions for error handling.

try
    File("");
catch (IOException e)
{}

IOs use unique ownership and are moveable but not copyable (Use refCounted for shared ownership).

io2 = io.move;
assert(!io2.isClosed);
assert(io.isClosed);

auto rc = refCounted(io2.move);
auto rc2 = rc;

IOs can be converted to polymorphic interfaces if necessary.

Input input = ioObject(io.move);
Authors:
  • Martin Nowak
Dependencies:
none
Versions:
0.2.2 2018-Aug-19
0.2.1 2018-May-11
0.2.0 2018-May-03
0.1.1 2018-Jan-17
0.1.0 2017-Dec-30
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 24 downloads this week

  • 248 downloads this month

  • 476 downloads total

Score:
2.3
Short URL:
io.dub.pm