vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function readLine

Reads and returns a single line from the stream.

ubyte[] readLine(InputStream) (
  InputStream stream,
  size_t max_bytes = size_t.max,
  string linesep = "\r\n"
)
if (isInputStream!InputStream);

ubyte[] readLine(InputStream, Allocator) (
  InputStream stream,
  size_t max_bytes,
  string linesep,
  Allocator alloc
)
if (isInputStream!InputStream);

void readLine(InputStream, OutputStream) (
  InputStream stream,
  OutputStream dst,
  size_t max_bytes = size_t.max,
  string linesep = "\r\n"
)
if (isInputStream!InputStream && isOutputStream!OutputStream);

void readLine(R, InputStream) (
  InputStream stream,
  ref R dst,
  size_t max_bytes = size_t.max,
  string linesep = "\r\n"
)
if (isOutputRange!(R, ubyte));

Throws

An exception if either the stream end was hit without hitting a newline first, or if more than max_bytes have been read from the stream.

Authors

Sönke Ludwig

Copyright

© 2012-2016 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.