std.base64.base64_impl.decoder
- multiple declarations
- Function Base64Impl.decoder
- Struct Base64Impl.Decoder
- Struct Base64Impl.Decoder
Function Base64Impl.decoder
Construct a
that iterates over the decoding of the given
Decoder
Base64
encoded data.
Prototype
Base64Impl.Decoder!Range decoder(Range)( Range range ) if (isInputRange!Range);
Parameters
Name | Description |
---|---|
range | An input
range over the data to be decoded. |
Returns
If range
is a range
of characters, a
that
iterates over the bytes of the corresponding Decoder
Base64
decoding.
If range
is a range
of ranges of characters, a
that iterates over the decoded strings corresponding to each element of
the Decoder
range
. In this case, the length of each subrange must be a multiple
of 4; the returned decoder does not keep track of Base64
decoding
state across subrange boundaries.
In both cases, the returned
will be a
forward Decoder
range
if the
given
is at least a forward range
range
, otherwise it will be only
an input range
.
If the input data contains characters not found in the base alphabet of
the current Base64
encoding scheme, the returned range
may throw a
.
Base64Exception
Example
This example shows decoding over a range
of input data lines.
foreach (decoded; Base64.decoder(stdin.byLine())) { writeln(decoded); }
Example
This example shows decoding one byte at a time.
auto encoded = Base64.encoder(cast(ubyte[])"0123456789"); foreach (n; map!q{a - '0'}(Base64.decoder(encoded))) { writeln(n); }
Struct Base64Impl.Decoder
An input range that
iterates over the decoded data of a range of Base64
encodings.
This range will be a forward range if the underlying data source is at least a forward range.
Properties
Name | Type | Description |
---|---|---|
empty
[get]
|
bool |
|
front
[get]
|
ubyte[] |
Methods
Name | Description |
---|---|
popFront
|
Advance to the next element in the input to be decoded. |
Note
This struct is not intended to be created in user code directly;
use the decoder
function instead.
Struct Base64Impl.Decoder
An input range that
iterates over the bytes of data decoded from a Base64
encoded string.
This range will be a forward range if the underlying data source is at least a forward range.
Properties
Name | Type | Description |
---|---|---|
empty
[get]
|
bool |
|
front
[get]
|
ubyte |
Methods
Name | Description |
---|---|
popFront
|
Advance to the next decoded byte. |
Note
This struct is not intended to be created in user code directly;
use the decoder
function instead.
Authors
Masahiro Nakagawa, Daniel Murphy (Single value Encoder and Decoder)