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

BasicTextStream Class Template Reference

Converts character sequences using a Codec. More...

#include <cxxtools/textstream.h>

Inheritance diagram for BasicTextStream:

TextStream

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_iostream
< extern_type > 
StreamType
typedef TextCodec< char_type,
extern_type > 
CodecType

Public Member Functions

 BasicTextStream (StreamType &ios, CodecType *codec)
 Construct by stream and codec.
 BasicTextStream (CodecType *codec)
 ~BasicTextStream ()
 Deletes the codec.
void attach (StreamType &ios)
void detach ()
void terminate ()
BasicTextBuffer< intern_type,
extern_type > & 
buffer ()


Detailed Description

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

This generic stream, which only supports input and output, 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

BasicTextStream ( StreamType &  ios,
CodecType codec 
)

The stream ios is used to read a character sequences and convert is using the codec codec and write character sequences which have been converted using the codec codec. The codec object which is passed as pointer will afterwards be managed by this class and be deleted on destruction

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6