Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TextReader Class Reference

Inheritance diagram for TextReader:

AbstractReader List of all members.

Public Member Functions

 this (IBuffer buffer, ITokenizer tokenizer)
 this (IBuffer buffer)
 this (IConduit conduit)
char[] toString ()
void int1 (void *src, uint count)
void int8 (void *src, uint count)
void int16 (void *src, uint count)
void int32 (void *src, uint count)
void int64 (void *src, uint count)
void float32 (void *src, uint count)
void float64 (void *src, uint count)
void float80 (void *src, uint count)
IReader get (inout char[] x)
IReader get (inout wchar[] x)
IReader get (inout dchar[] x)

Private Member Functions

final Token next ()
 this (IReader reader)
IBuffer getBuffer ()
IArrayAllocator getAllocator ()
void setAllocator (IArrayAllocator memory)
void setStringDecoder (IStringDecoder s)
IReader push (uint size)
uint length ()
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 int[] x)

Static Private Member Functions

 this ()

Private Attributes

Token token
ITokenizer tokenizer
IBuffer buffer
StringDecoder string
NumericDecoder numeric

Detailed Description

Grok readable input from a stream. All input is tokenized from the associated buffer, and converted as necessary into the destination location. A SpaceTokenizer is used by default, but you can choose an alternative (such as a comma-delimiting tokenizer).

Definition at line 52 of file TextReader.d.


Member Function Documentation

this IBuffer  buffer,
ITokenizer  tokenizer
[inline]
 

Construct a TextReader on the provided buffer, using the specified Tokenizer instead of the default one.

Definition at line 67 of file TextReader.d.

References tokenizer.

this IBuffer  buffer  )  [inline]
 

Construct a TextReader on the given buffer

Reimplemented from AbstractReader.

Definition at line 94 of file TextReader.d.

this IConduit  conduit  )  [inline]
 

Construct a TextReader upon the buffer associated with the given conduit.

Definition at line 106 of file TextReader.d.

char [] toString  )  [inline]
 

Return the name of this reader

Reimplemented from AbstractReader.

Definition at line 115 of file TextReader.d.

final Token next  )  [inline, private]
 

Internal method to isolate the next token.

Definition at line 126 of file TextReader.d.

References Token::getLength(), ITokenizer::next(), and tokenizer.

void int1 void *  src,
uint  count
[inline]
 

Definition at line 137 of file TextReader.d.

References Token::toString().

void int8 void *  src,
uint  count
[inline]
 

Definition at line 151 of file TextReader.d.

References Token::toInt().

void int16 void *  src,
uint  count
[inline]
 

Definition at line 165 of file TextReader.d.

References Token::toInt().

void int32 void *  src,
uint  count
[inline]
 

Definition at line 179 of file TextReader.d.

References Token::toInt().

void int64 void *  src,
uint  count
[inline]
 

Definition at line 193 of file TextReader.d.

References Token::toLong().

void float32 void *  src,
uint  count
[inline]
 

Definition at line 207 of file TextReader.d.

References Token::toReal().

void float64 void *  src,
uint  count
[inline]
 

Definition at line 221 of file TextReader.d.

References Token::toReal().

void float80 void *  src,
uint  count
[inline]
 

Definition at line 235 of file TextReader.d.

References Token::toReal().

IReader get inout char[]  x  )  [inline]
 

Reimplemented from AbstractReader.

Definition at line 249 of file TextReader.d.

References Token::toString().

Referenced by VersionArrayReaderSupport::testToken4().

IReader get inout wchar[]  x  )  [inline]
 

Todo:
  • Tokenizer needs to handle wchar[] before this will operate correctly

Reimplemented from AbstractReader.

Definition at line 263 of file TextReader.d.

IReader get inout dchar[]  x  )  [inline]
 

Todo:
  • Tokenizer needs to handle dchar[] before this will operate correctly

Reimplemented from AbstractReader.

Definition at line 276 of file TextReader.d.

this  )  [inline, static, inherited]
 

Construct a couple of static exception instances.

Definition at line 165 of file AbstractReader.d.

References AbstractReader::eof, and AbstractReader::udf.

this IReader  reader  )  [inline, inherited]
 

Definition at line 57 of file ArrayAllocator.d.

IBuffer getBuffer  )  [inline, inherited]
 

Return the buffer associated with this reader

Reimplemented from IReader.

Definition at line 190 of file AbstractReader.d.

IArrayAllocator getAllocator  )  [inline, inherited]
 

Return the allocator associated with this reader.See ArrayAllocator for more information.

Reimplemented from IReader.

Definition at line 202 of file AbstractReader.d.

References AbstractReader::memory.

void setAllocator IArrayAllocator  memory  )  [inline, inherited]
 

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 229 of file AbstractReader.d.

void setStringDecoder IStringDecoder  s  )  [inline, inherited]
 

Set the configured IStringDecoder. These are intended to be used as a conversion mechanism between various character representations. They are also expected to be used for the process of applying character encodings.

See IStringDecoder.

Reimplemented from IReader.

Definition at line 247 of file AbstractReader.d.

References IStringDecoder::char16(), AbstractReader::StringDecoder::char16, IStringDecoder::char32(), AbstractReader::StringDecoder::char32, IStringDecoder::char8(), AbstractReader::StringDecoder::char8, and AbstractReader::string.

IReader push uint  size  )  [inline, inherited]
 

Push the size (in bytes) to use for the next array-read. By default, array sizes are read from the input stream, so this is the means by which one may specify the size where the stream is not formatted in such a manner.

char[] x; int size; IReader reader; reader.push(size).get(x);

Reimplemented from IReader.

Definition at line 271 of file AbstractReader.d.

References AbstractReader::pushed.

uint length  )  [inline, inherited]
 

Read and return an integer from the input stream. This can be used to extract the length of a subsequent array.

Reimplemented from IReader.

Definition at line 287 of file AbstractReader.d.

References AbstractReader::get(), and AbstractReader::pushed.

void wait  )  [inline, inherited]
 

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 306 of file AbstractReader.d.

References IBuffer::get().

IReader get IReadable  x  )  [inline, inherited]
 

Extract a readable class from the current read-position

Reimplemented from IReader.

Definition at line 317 of file AbstractReader.d.

References IReadable::read().

Referenced by AbstractReader::length(), AbstractReader::VersionUseShiftOperators::opShr(), testBuffer(), testConduitFilters(), testHttpClient(), and testRandomAccess().

IReader get inout bool  x  )  [inline, inherited]
 

Extract a boolean value from the current read-position

Reimplemented from IReader.

Definition at line 330 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int1, and AbstractReader::numeric.

IReader get inout ubyte  x  )  [inline, inherited]
 

Extract an unsigned byte value from the current read-position

Reimplemented from IReader.

Definition at line 342 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int8u, and AbstractReader::numeric.

IReader get inout byte  x  )  [inline, inherited]
 

Extract a byte value from the current read-position

Reimplemented from IReader.

Definition at line 354 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int8, and AbstractReader::numeric.

IReader get inout ushort  x  )  [inline, inherited]
 

Extract an unsigned short value from the current read-position

Reimplemented from IReader.

Definition at line 366 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int16u, and AbstractReader::numeric.

IReader get inout short  x  )  [inline, inherited]
 

Extract a short value from the current read-position

Reimplemented from IReader.

Definition at line 378 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int16, and AbstractReader::numeric.

IReader get inout uint  x  )  [inline, inherited]
 

Extract a unsigned int value from the current read-position

Reimplemented from IReader.

Definition at line 390 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int32u, and AbstractReader::numeric.

IReader get inout int  x  )  [inline, inherited]
 

Extract an int value from the current read-position

Reimplemented from IReader.

Definition at line 402 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int32, and AbstractReader::numeric.

IReader get inout ulong  x  )  [inline, inherited]
 

Extract an unsigned long value from the current read-position

Reimplemented from IReader.

Definition at line 414 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int64u, and AbstractReader::numeric.

IReader get inout long  x  )  [inline, inherited]
 

Extract a long value from the current read-position

Reimplemented from IReader.

Definition at line 426 of file AbstractReader.d.

References AbstractReader::NumericDecoder::int64, and AbstractReader::numeric.

IReader get inout float  x  )  [inline, inherited]
 

Extract a float value from the current read-position

Reimplemented from IReader.

Definition at line 438 of file AbstractReader.d.

References AbstractReader::NumericDecoder::float32, and AbstractReader::numeric.

IReader get inout double  x  )  [inline, inherited]
 

Extract a double value from the current read-position

Reimplemented from IReader.

Definition at line 450 of file AbstractReader.d.

References AbstractReader::NumericDecoder::float64, and AbstractReader::numeric.

IReader get inout real  x  )  [inline, inherited]
 

Extract a real value from the current read-position

Reimplemented from IReader.

Definition at line 462 of file AbstractReader.d.

References AbstractReader::NumericDecoder::float80, and AbstractReader::numeric.

IReader get inout char  x  )  [inline, inherited]
 

Extract a char value from the current read-position

Reimplemented from IReader.

Definition at line 474 of file AbstractReader.d.

References AbstractReader::StringDecoder::char8, and AbstractReader::string.

IReader get inout wchar  x  )  [inline, inherited]
 

Extract a wide char value from the current read-position

Reimplemented from IReader.

Definition at line 486 of file AbstractReader.d.

References AbstractReader::StringDecoder::char16, and AbstractReader::string.

IReader get inout dchar  x  )  [inline, inherited]
 

Extract a double char value from the current read-position

Reimplemented from IReader.

Definition at line 498 of file AbstractReader.d.

References AbstractReader::StringDecoder::char32, and AbstractReader::string.

IReader get inout int[]  x  )  [inline, inherited]
 

Definition at line 508 of file AbstractReader.d.

References IArrayAllocator::allocate(), AbstractReader::StringDecoder::char8, AbstractReader::memory, and AbstractReader::string.


Member Data Documentation

Token token [private]
 

Definition at line 55 of file TextReader.d.

ITokenizer tokenizer [private]
 

Definition at line 58 of file TextReader.d.

Referenced by next(), and this().

IBuffer buffer [protected, inherited]
 

Definition at line 137 of file AbstractReader.d.

StringDecoder string [protected, inherited]
 

Definition at line 140 of file AbstractReader.d.

Referenced by AbstractReader::get(), and AbstractReader::setStringDecoder().

NumericDecoder numeric [protected, inherited]
 

Definition at line 143 of file AbstractReader.d.

Referenced by AbstractReader::get().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:12 2004 for Mango by doxygen 1.3.6