Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

BasicTextIStream Class Template Reference

Converts character sequences using a Codec. More...

#include <cxxtools/textstream.h>

Inheritance diagram for BasicTextIStream:

TextIStream List of all members.

Public Types

typedef ByteT extern_type
typedef CharT intern_type
typedef CharT char_type
typedef std::char_traits<
CharT > 
traits_type
typedef traits_type::int_type int_type
typedef traits_type::pos_type pos_type
typedef traits_type::off_type off_type
typedef std::basic_istream<
extern_type > 
StreamType
typedef TextCodec< char_type,
extern_type > 
CodecType

Public Member Functions

 BasicTextIStream (StreamType &is, CodecType *codec)
 Construct by input stream and codec.
 BasicTextIStream (CodecType *codec)
 ~BasicTextIStream ()
 Deletes to codec.
void attach (StreamType &is)
void detach ()
void terminate ()
BasicTextBuffer< intern_type,
extern_type > & 
buffer ()

Detailed Description

template<typename CharT, typename ByteT>
class cxxtools::BasicTextIStream< CharT, ByteT >

This generic stream, which only supports input, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered.

This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device.

The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class.

The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed!

See also:
std::basic_istream


Constructor & Destructor Documentation

BasicTextIStream ( StreamType &  is,
CodecType codec 
)

The input stream is is used ro read a character sequence and convert it using the codec codec. The Codec object which is passed as pointer will afterwards be managed by this class and also be deleted on destruction

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6