iopipe.bufpipe

Core functionality for iopipe. Defines the base types for manipulating and processing data.

Members

Aliases

ReleaseOnWrite
alias ReleaseOnWrite = Flag!"releaseOnWrite"
Undocumented in source.

Functions

arrayCastPipe
auto arrayCastPipe(Chain c)

Given a pipe chain whose window is a straight array, create a pipe chain that converts the array to another array type.

asElemRange
auto asElemRange(Chain c)

Convert an io pipe into a range of elements of the pipe. This effectively converts an iopipe range of T into a range of T. Note that auto-decoding does NOT happen still, so converting a string into an input range produces a range of char. The range is extended when no more data is in the window.

asInputRange
auto asInputRange(Chain c)

Convert an io pipe into a range, with each popFront releasing all the current data and extending a specified amount.

bufd
auto bufd(Source dev, Args args)
auto bufd(Args args)

Create a buffer to manage the data from the given source, and wrap into an iopipe.

byteSwapper
auto byteSwapper(Chain c)

Swap the bytes of every element before handing to next processor. The littleEndian compile-time parameter indicates what endianness the data is in. If it matches the platform's endianness, then nothing is done (no byte swap occurs). Otherwise, a byte swap processor is returned wrapping the io pipe.

ensureElems
size_t ensureElems(Chain chain, size_t elems)

Extend a pipe until it has a minimum number of elements. If the minimum elements are already present, does nothing.

lbufd
auto lbufd(Source dev, ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
lbufd
auto lbufd(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
outputPipe
auto outputPipe(Chain c, Sink dev)

An output pipe writes all its data to a given sink stream. Any data in the output pipe's window has been written to the stream.

process
size_t process(Chain c)

Process a given iopipe chain until it has reached EOF. This is accomplished by extending and releasing continuously until extend returns 0.

rbufd
auto rbufd(Source dev)
auto rbufd()

Create a ring buffer to manage the data from the given source, and wrap into an iopipe.

writeBuf
size_t writeBuf(Chain c, Range data, size_t offset)

Write data from a random access range or character array into the given iopipe. If relOnWrite is set to true (ReleaseOnWrite.yes), then all data before the provided offset, and any new data written to the pipe is always released. This is mainly useful for output buffers where you do not wish to allocate extra space in the buffer, and wish to flush the buffer when it's full.

Structs

BufferedInputSource
struct BufferedInputSource(BufferManager, Source, size_t optimalReadSize)
Undocumented in source.
SimplePipe
struct SimplePipe(Chain, size_t extendElementsDefault = 1)

An example processor. This demonstrates the required items for implementing an iopipe.

Templates

iosrc
template iosrc(alias fun, Chain)

Create an input source from a given Chain, and a given translation function/template.

Meta

License

Boost License 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Authors

Steven Schveighoffer