Inheritance diagram for TextReader:
Public Types | |
typedef Reader get | get |
Public Member Functions | |
this (IBuffer buffer, ITokenizer tokenizer=Tokenizers.line) | |
this (IConduit conduit, ITokenizer tokenizer=Tokenizers.line) | |
uint | read (void *src, uint bytes, uint type) |
IReader | get (inout char[] x, uint elements=uint.max) |
IReader | get (inout wchar[] x, uint elements=uint.max) |
IReader | get (inout dchar[] x, uint elements=uint.max) |
Private Member Functions | |
final Token | nextToken () |
final Token | next () |
this (IBuffer buffer) | |
this (IConduit conduit) | |
IBuffer | getBuffer () |
IArrayAllocator | getAllocator () |
void | setAllocator (IArrayAllocator memory) |
void | setDecoder (IDecoder d) |
void | wait () |
IReader | get (IReadable x) |
IReader | get (inout bool x) |
IReader | get (inout ubyte x) |
IReader | get (inout byte x) |
IReader | get (inout ushort x) |
IReader | get (inout short x) |
IReader | get (inout uint x) |
IReader | get (inout int x) |
IReader | get (inout ulong x) |
IReader | get (inout long x) |
IReader | get (inout float x) |
IReader | get (inout double x) |
IReader | get (inout real x) |
IReader | get (inout char x) |
IReader | get (inout wchar x) |
IReader | get (inout dchar x) |
IReader | get (inout ubyte[] x, uint elements=uint.max) |
IReader | get (inout byte[] x, uint elements=uint.max) |
IReader | get (inout ushort[] x, uint elements=uint.max) |
IReader | get (inout short[] x, uint elements=uint.max) |
IReader | get (inout uint[] x, uint elements=uint.max) |
IReader | get (inout int[] x, uint elements=uint.max) |
IReader | get (inout ulong[] x, uint elements=uint.max) |
IReader | get (inout long[] x, uint elements=uint.max) |
IReader | get (inout float[] x, uint elements=uint.max) |
IReader | get (inout double[] x, uint elements=uint.max) |
IReader | get (inout real[] x, uint elements=uint.max) |
Static Private Member Functions | |
static void | error (char[] msg=EOI) |
Private Attributes | |
Token | token |
ITokenizer | tokenizer |
IBuffer | buffer |
Decoder | decode |
Static Private Attributes | |
static final char[] | EOI = "unexpected end of input" |
Definition at line 57 of file TextReader.d.
|
Definition at line 59 of file TextReader.d. |
|
Construct a TextReader on the provided buffer, using the specified Tokenizer instead of the default one. Definition at line 76 of file TextReader.d. References tokenizer. |
|
Construct a TextReader upon the buffer associated with the given conduit. Definition at line 90 of file TextReader.d. References tokenizer. |
|
Reimplemented from Reader. Definition at line 99 of file TextReader.d. References error(), next(), Token::toInt(), Token::toLong(), Token::toReal(), and Token::toString(). |
|
Reimplemented from Reader. Definition at line 163 of file TextReader.d. References nextToken(), and Token::toString(). |
|
Reimplemented from Reader. Definition at line 177 of file TextReader.d. References assert(). |
|
Reimplemented from Reader. Definition at line 190 of file TextReader.d. References assert(). |
|
Throw an exception if the input requested is not available. Reader instances expect the input to be available, so you might think of them as being applied to a fixed-format file. Tokenizers, on the other hand, are more flexible in that they return true until no more tokens are available. Readers take care of assignment to user-space variables, whereas Tokenizers just make the raw content available. Definition at line 209 of file TextReader.d. Referenced by next(), nextToken(), and read(). |
|
Internal method to capture the next token. Definition at line 220 of file TextReader.d. References error(), ITokenizer::next(), token, and tokenizer. |
|
Internal method to isolate the next token, and check its length. This is used when converting to non-char types, such as integers ~ an empty token is illegal, since we don't support default values.
Definition at line 238 of file TextReader.d. References error(), Token::getLength(), nextToken(), and token. Referenced by read(). |
|
Construct a Reader upon the provided buffer Reimplemented in HttpReader, and EndianReader. Definition at line 164 of file Reader.d. References Reader::buffer, Reader::Decoder::char16, Reader::Decoder::char32, Reader::Decoder::char8, Reader::decode, Reader::read(), and Reader::setAllocator(). |
|
Construct a Reader upon the buffer associated with the given conduit. |
|
Return the buffer associated with this reader Reimplemented from IReader. Definition at line 193 of file Reader.d. References Reader::buffer. |
|
Return the allocator associated with this reader. See ArrayAllocator for more information. Reimplemented from IReader. Definition at line 205 of file Reader.d. References Reader::memory. |
|
Set the allocator to use for array management. Arrays are always allocated by the IReader. That is, you cannot read data into an array slice (for example). Instead, a number of IArrayAllocator classes are available to manage memory allocation when reading array content. By default, an IReader will allocate each array from the heap. You can change that behavior by calling this method with an IArrayAllocator of choice. For instance, there is a BufferAllocator which will slice an array directly from the buffer where possible. Also available is the record-oriented SliceAllocator, which slices memory from within a pre-allocated heap area, and should be reset by the client code after each record has been read (to avoid unnecessary growth). See ArrayAllocator for more information. Reimplemented from IReader. Definition at line 232 of file Reader.d. References IArrayAllocator::bind(). Referenced by Reader::this(). |
|
Bind an IDecoder to the writer. Decoders are intended to be used as a conversion mechanism between various character representations (encodings), or the translation of any data type from one representation to another. Each data type may be configured with a distinct decoder, covering all native types (15 in total). An appropriate decoder set should be attached to each IReader, and thus be available for subsequent use. A raw binary implementation is attached by default (no encoding). See module mango.icu.UMango for an example of decoder implementation -- those classes bind the ICU converters to this IO package. Reimplemented from IReader. Definition at line 257 of file Reader.d. References IDecoder::bind(), Reader::decode, Reader::Decoder::decoders, and IDecoder::type(). |
|
Wait for something to arrive in the buffer. This may stall the current thread forever, although usage of SocketConduit will take advantage of the timeout facilities provided there. Reimplemented from IReader. Definition at line 284 of file Reader.d. References Reader::buffer, and IBuffer::get(). |
|
Extract a readable class from the current read-position Reimplemented from IReader. Definition at line 325 of file Reader.d. References assert(), and IReadable::read(). Referenced by Reader::count(), and testBuffer(). |
|
Extract a boolean value from the current read-position Reimplemented from IReader. Definition at line 338 of file Reader.d. References Reader::read(). |
|
Extract an unsigned byte value from the current read-position Reimplemented from IReader. Definition at line 350 of file Reader.d. References Reader::read(). |
|
Extract a byte value from the current read-position Reimplemented from IReader. Definition at line 362 of file Reader.d. References Reader::read(). |
|
Extract an unsigned short value from the current read-position Reimplemented from IReader. Definition at line 374 of file Reader.d. References Reader::read(). |
|
Extract a short value from the current read-position Reimplemented from IReader. Definition at line 386 of file Reader.d. References Reader::read(). |
|
Extract a unsigned int value from the current read-position Reimplemented from IReader. Definition at line 398 of file Reader.d. References Reader::read(). |
|
Extract an int value from the current read-position Reimplemented from IReader. Definition at line 410 of file Reader.d. References Reader::read(). |
|
Extract an unsigned long value from the current read-position Reimplemented from IReader. Definition at line 422 of file Reader.d. References Reader::read(). |
|
Extract a long value from the current read-position Reimplemented from IReader. Definition at line 434 of file Reader.d. References Reader::read(). |
|
Extract a float value from the current read-position Reimplemented from IReader. Definition at line 446 of file Reader.d. References Reader::read(). |
|
Extract a double value from the current read-position Reimplemented from IReader. Definition at line 458 of file Reader.d. References Reader::read(). |
|
Extract a real value from the current read-position Reimplemented from IReader. Definition at line 470 of file Reader.d. References Reader::read(). |
|
Extract a char value from the current read-position Reimplemented from IReader. Definition at line 482 of file Reader.d. References Reader::Decoder::char8, and Reader::decode. |
|
Extract a wide char value from the current read-position Reimplemented from IReader. Definition at line 494 of file Reader.d. References Reader::Decoder::char16, and Reader::decode. |
|
Extract a double char value from the current read-position Reimplemented from IReader. Definition at line 506 of file Reader.d. References Reader::Decoder::char32, and Reader::decode. |
|
Extract an unsigned byte array from the current read-position Reimplemented from IReader. Definition at line 518 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a byte array from the current read-position Reimplemented from IReader. Definition at line 531 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract an unsigned short array from the current read-position Reimplemented from IReader. Definition at line 544 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a short array from the current read-position Reimplemented from IReader. Definition at line 557 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a unsigned int array from the current read-position Reimplemented from IReader. Definition at line 570 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract an int array from the current read-position Reimplemented from IReader. Definition at line 583 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract an unsigned long array from the current read-position Reimplemented from IReader. Definition at line 596 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a long array from the current read-position Reimplemented from IReader. Definition at line 609 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a float array from the current read-position Reimplemented from IReader. Definition at line 622 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a double array from the current read-position Reimplemented from IReader. Definition at line 635 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Extract a real array from the current read-position Reimplemented from IReader. Definition at line 648 of file Reader.d. References IArrayAllocator::allocate(), Reader::count(), Reader::memory, and Reader::read(). |
|
Definition at line 62 of file TextReader.d. Referenced by next(), and nextToken(). |
|
Definition at line 65 of file TextReader.d. Referenced by nextToken(), and this(). |
|
Definition at line 67 of file TextReader.d. |
|
Definition at line 150 of file Reader.d. Referenced by Reader::getBuffer(), Reader::read(), Reader::this(), and Reader::wait(). |
|
Definition at line 153 of file Reader.d. Referenced by Reader::get(), Reader::setDecoder(), and Reader::this(). |