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

TextReader.d File Reference

Go to the source code of this file.

Functions

class TextReaderTemplate (T)
typedef TextReaderTemplate (char) TextReader

Variables

module mango io TextReader
import mango io Reader
import mango io mango io Exception
import mango text Token
import mango convert Type
import mango convert mango
convert 
Atoi
import mango convert mango
convert mango convert 
Double


Detailed Description

Copyright (c) 2004 Kris Bell

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for damages of any kind arising from the use of this software.

Permission is hereby granted to anyone to use this software for any purpose, including commercial applications, and to alter it and/or redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment within documentation of said product would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any distribution of the source.

4. Derivative works are permitted, but they must carry this notice in full and credit the original source.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Version:
Initial version, March 2004
Author:
Kris

Definition in file TextReader.d.


Function Documentation

class TextReaderTemplate  ) 
 

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).

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

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

Is this Reader text oriented?

Intercept single char decoding

Intercept char-array decoding

Internal method to capture the next token.

Todo:
: should the empty-token rule be relaxed?

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.

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.

Refill the token content from our buffer. Returns false upon reaching EOF

Definition at line 59 of file TextReader.d.

References AtoiTemplate(), Buffer, buffer, Reader::count(), Reader::decode(), DoubleTemplate(), Reader::isTextBased(), Reader::read(), TextReaderTemplate(), TokenTemplate(), and type().

Referenced by TextReaderTemplate().

typedef TextReaderTemplate char   ) 
 


Variable Documentation

module mango io TextReader
 

Definition at line 39 of file TextReader.d.

import mango io Reader
 

Definition at line 41 of file TextReader.d.

import mango io mango io Exception
 

Definition at line 41 of file TextReader.d.

import mango text Token
 

Definition at line 44 of file TextReader.d.

import mango convert Type
 

Definition at line 46 of file TextReader.d.

import mango convert mango convert Atoi
 

Definition at line 46 of file TextReader.d.

import mango convert mango convert mango convert Double
 

Definition at line 46 of file TextReader.d.


Generated on Sat Dec 24 17:28:36 2005 for Mango by  doxygen 1.4.0