cxxtools::BasicTextIStream< CharT, ByteT > Class Template Reference

Converts character sequences using a Codec. More...

#include <cxxtools/textstream.h>

Inheritance diagram for cxxtools::BasicTextIStream< CharT, ByteT >:
basic_istream

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 >

Converts character sequences using a Codec.

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

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<typename CharT, typename ByteT>
cxxtools::BasicTextIStream< CharT, ByteT >::BasicTextIStream ( StreamType is,
CodecType codec 
)
inline

Construct by input stream and 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

template<typename CharT, typename ByteT>
cxxtools::BasicTextIStream< CharT, ByteT >::BasicTextIStream ( CodecType codec)
inlineexplicit
template<typename CharT, typename ByteT>
cxxtools::BasicTextIStream< CharT, ByteT >::~BasicTextIStream ( )
inline

Deletes to codec.

Member Function Documentation

template<typename CharT, typename ByteT>
void cxxtools::BasicTextIStream< CharT, ByteT >::attach ( StreamType is)
inline
template<typename CharT, typename ByteT>
BasicTextBuffer<intern_type, extern_type>& cxxtools::BasicTextIStream< CharT, ByteT >::buffer ( )
inline
template<typename CharT, typename ByteT>
void cxxtools::BasicTextIStream< CharT, ByteT >::detach ( )
inline
template<typename CharT, typename ByteT>
void cxxtools::BasicTextIStream< CharT, ByteT >::terminate ( )
inline

The documentation for this class was generated from the following file: