std.base64.base64_impl.encoder - multiple declarations
- Function Base64Impl.encoder
- Struct Base64Impl.Encoder
- Struct Base64Impl.Encoder
Function Base64Impl.encoder
Construct an that iterates over the EncoderBase64 encoding of the
given input range.
Prototype
Base64Impl.Encoder!Range encoder(Range)( Range range ) if (isInputRange!Range);
Parameters
| Name | Description |
|---|---|
| range | An input
range over the data to be encoded. |
Returns
If range is a range of bytes, an that iterates
over the bytes of the corresponding EncoderBase64 encoding.
If range is a range of ranges of bytes, an that
iterates over the EncoderBase64 encoded strings of each element of the range.
In both cases, the returned will be a
forward Encoderrange if the
given is at least a forward rangerange, otherwise it will be only
an input range.
Example
This example encodes the input one line at a time.
File f = File("text.txt", "r");
scope(exit) f.close();
uint line = 0;
foreach (encoded; Base64.encoder(f.byLine()))
{
writeln(++line, ". ", encoded);
}
Example
This example encodes the input data one byte at a time.
ubyte[] data = cast(ubyte[]) "0123456789";
// The ElementType of data is not aggregation type
foreach (encoded; Base64.encoder(data))
{
writeln(encoded);
}
Struct Base64Impl.Encoder
An input range that
iterates over the respective Base64 encodings of a range of data items.
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]
|
char[] |
Methods
| Name | Description |
|---|---|
popFront
|
Advance the range to the next chunk of encoded data. |
Note
This struct is not intended to be created in user code directly;
use the encoder function instead.
Struct Base64Impl.Encoder
An input range that iterates over the encoded bytes of the given source data.
It 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 encoded character. |
Note
This struct is not intended to be created in user code directly;
use the encoder function instead.
Authors
Masahiro Nakagawa, Daniel Murphy (Single value Encoder and Decoder)