Unpacker

Unpacker range.

Allows to unpack repeated binary encoded entries with range interface.

struct Unpacker (
string format
ByteOrder byteOrder = ByteOrder.Native
R
) if (
(
isInputRange!R &&
is(ElementType!R == ubyte)
)
||
is(R == File)
) {}

Constructors

this
this(R range)

Creates instance of Unpacker.

Members

Aliases

Type
alias Type = formatTypeTupleOf!format

Alias for type tuple

Functions

popFront
void popFront()

Unpacks next element from source range.

Variables

empty
bool empty;

Determines if more data can be unpacked.

front
Tuple!Type front;

Tuple of unpacked elements

source
R source;

Source range/file to read from.

Examples

1 ubyte[] bytes = pack!`<hshs`(1, "one", 2, "two");
2 
3 foreach(num, str; bytes) {
4       writeln(num, " ", str);
5 }

Meta