Inheritance diagram for VersionMango::StringDecoder:
Public Member Functions | |
uint | read (IBuffer b, wchar[] dst) |
uint | decoder (void *p, uint capacity) |
ConverterType | type () |
void | setLimit (uint limit) |
void | setConverter (UConverter cvt) |
void | reset (uint limit=uint.max) |
BufferDecoder | bind (IReader reader) |
Protected Member Functions | |
uint | toGo () |
void | read (IReader r) |
Private Member Functions | |
final void | decode (IBuffer buffer, int(*dg)(void[])) |
Private Attributes | |
UConverter | cvt |
bool | done |
IBuffer | bound |
uint | limit = uint.max |
These decoder classes will always attempt to fill their destination (provided) output array, but may terminate early if (a) a defined read 'limit' on the input stream has been reached or (b) a partial surrogate-pair would be left at the output tail. Each decoder returns a count of how many output elements were actually converted.
Definition at line 70 of file UMango.d.
|
Decoders can be used to convert directly into a provided destination. The converter will try to fill the destination, up to the configured input 'limit', and returns the number of elements thus converted. This returned value will be less than the destination capacity when either the 'limit' was reached, or when a partial surrogate would be placed at the tail. Reimplemented in VersionMango::StringDecoder16. |
|
Signature for BufferDecoder handlers. These decoders are intended to be usable as the default handlers within the reader constructs. Use IReader.setDecoder() to set a decoder as the default handler. Reimplemented in VersionMango::StringDecoder16. |
|
Return the type of this decoder Reimplemented from IDecoder. Reimplemented in VersionMango::StringDecoder16. |
|
Set the limit for this decoder. This will cause the decoder to halt after reading the specified number of bytes from its input. The decoder may also halt before that point if the destination becomes full. Use method toGo() to monitor how much content has been read so far. |
|
Change the converter used for this decoder. |
|
Reset the converter and the input limit. The latter defaults to being unlimited, causing the decoder to read until the destination is full. |
|
Return the number of bytes yet to be read |
|
Placeholder for subclasses to do something useful when applied to an IReader. See UString for an example of such usage. Reimplemented from IReadable. |
|
Bind this StringDecoder to the specified IReader. This is invoked by an IReader to install it as the default handler, and thus be used by all subsequent IReader.get() requests for the subclass type. Note that the byte limit will be respected if 'limit' has been set, which can be useful when converting an unknown number of elements (a la HTTP). Reimplemented from IDecoder. Definition at line 191 of file UMango.d. References BufferDecoder, and IReader::getBuffer(). |
|
Decode IBuffer input until the delegate indicates it is finished. Typically, that occurs when either the destination is full, or the input 'limit' has been reached. Definition at line 206 of file UMango.d. References IBuffer::get(), and IBuffer::read(). |
|
|
|
|
|
|
|
|