29#ifndef Pt_TextStream_h
30#define Pt_TextStream_h
34#include <Pt/TextBuffer.h>
35#include <Pt/IOStream.h>
78template <
typename CharT,
typename ByteT>
95 typedef typename traits_type::int_type
int_type;
98 typedef typename traits_type::pos_type
pos_type;
119 , _tbuffer( is,
codec )
145 return _tbuffer.codec();
155 _tbuffer.setCodec(
codec);
234template <
typename CharT,
typename ByteT>
275 , _tbuffer( os ,
codec )
301 return _tbuffer.codec();
311 _tbuffer.setCodec(
codec);
373template <
typename CharT,
typename ByteT>
414 , _tbuffer( ios,
codec)
440 return _tbuffer.codec();
450 _tbuffer.setCodec(
codec);
457 _tbuffer.attach(ios);
543typedef BasicTextStream<Char, char>
TextStream;
BasicIOStream(BasicStreamBuffer< CharT > *sb=0)
Constructor.
Definition IOStream.h:274
void setBuffer(BasicStreamBuffer< Char > *sb)
Definition IOStream.h:213
void setBuffer(BasicStreamBuffer< Char > *sb)
Definition IOStream.h:100
BasicIStream(BasicStreamBuffer< CharT > *sb=0)
Constructor.
Definition IOStream.h:225
BasicOStream(BasicStreamBuffer< CharT > *sb=0)
Constructor.
Definition IOStream.h:249
void setBuffer(BasicStreamBuffer< Char > *sb)
Definition IOStream.h:152
Converts character sequences with different encodings.
Definition TextBuffer.h:52
traits_type::off_type off_type
Stream offset type.
Definition TextStream.h:101
void setCodec(CodecType *codec)
Sets the text codec.
Definition TextStream.h:153
~BasicTextIStream()
Destructor.
Definition TextStream.h:138
BasicTextIStream(CodecType *codec)
Construct with codec.
Definition TextStream.h:129
std::basic_istream< extern_type > StreamType
External stream type.
Definition TextStream.h:104
void discard()
Discards the buffer.
Definition TextStream.h:174
BasicTextIStream(StreamType &is, CodecType *codec)
Construct with input stream and codec.
Definition TextStream.h:117
CharT intern_type
Internal character type.
Definition TextStream.h:86
traits_type::pos_type pos_type
Stream position type.
Definition TextStream.h:98
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition TextStream.h:107
traits_type::int_type int_type
Integer type.
Definition TextStream.h:95
void attach(StreamType &is)
Attach to external target.
Definition TextStream.h:160
std::char_traits< CharT > traits_type
Internal character traits.
Definition TextStream.h:92
CodecType * codec()
Definition TextStream.h:143
void detach()
Detach from external target.
Definition TextStream.h:167
CharT char_type
Internal character type.
Definition TextStream.h:89
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition TextStream.h:201
void reset()
Resets the buffer and target.
Definition TextStream.h:184
void reset(StreamType &is)
Resets the buffer and target.
Definition TextStream.h:194
ByteT extern_type
External character type.
Definition TextStream.h:83
traits_type::off_type off_type
Stream offset type.
Definition TextStream.h:257
std::basic_ostream< extern_type > StreamType
External stream type.
Definition TextStream.h:260
void setCodec(CodecType *codec)
Sets the text codec.
Definition TextStream.h:309
~BasicTextOStream()
Destructor.
Definition TextStream.h:294
void discard()
Discards the buffer.
Definition TextStream.h:330
CharT intern_type
Internal character type.
Definition TextStream.h:242
traits_type::pos_type pos_type
Stream position type.
Definition TextStream.h:254
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition TextStream.h:263
traits_type::int_type int_type
Integer type.
Definition TextStream.h:251
void reset(StreamType &os)
Resets the buffer and target.
Definition TextStream.h:350
std::char_traits< CharT > traits_type
Internal character traits.
Definition TextStream.h:248
void attach(StreamType &os)
Attach to external target.
Definition TextStream.h:316
CodecType * codec()
Definition TextStream.h:299
void detach()
Detach from external target.
Definition TextStream.h:323
CharT char_type
Internal character type.
Definition TextStream.h:245
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition TextStream.h:357
void reset()
Resets the buffer and target.
Definition TextStream.h:340
BasicTextOStream(CodecType *codec)
Construct with codec.
Definition TextStream.h:285
BasicTextOStream(StreamType &os, CodecType *codec)
Construct with output stream and codec.
Definition TextStream.h:273
ByteT extern_type
External character type.
Definition TextStream.h:239
traits_type::off_type off_type
Stream offset type.
Definition TextStream.h:396
void setCodec(CodecType *codec)
Sets the text codec.
Definition TextStream.h:448
void discard()
Discards the buffer.
Definition TextStream.h:469
CharT intern_type
Internal character type.
Definition TextStream.h:381
void attach(StreamType &ios)
Attach to external target.
Definition TextStream.h:455
traits_type::pos_type pos_type
Stream position type.
Definition TextStream.h:393
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition TextStream.h:402
traits_type::int_type int_type
Integer type.
Definition TextStream.h:390
BasicTextStream(StreamType &ios, CodecType *codec)
Construct by stream and codec.
Definition TextStream.h:412
void reset(StreamType &ios)
Resets the buffer and target.
Definition TextStream.h:489
std::char_traits< CharT > traits_type
Internal character traits.
Definition TextStream.h:387
BasicTextStream(CodecType *codec)
Construct with codec.
Definition TextStream.h:424
CodecType * codec()
Definition TextStream.h:438
void detach()
Detach from external target.
Definition TextStream.h:462
CharT char_type
Internal character type.
Definition TextStream.h:384
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition TextStream.h:496
void reset()
Resets the buffer and target.
Definition TextStream.h:479
~BasicTextStream()
Destructor.
Definition TextStream.h:433
ByteT extern_type
External character type.
Definition TextStream.h:378
std::basic_iostream< extern_type > StreamType
External stream type.
Definition TextStream.h:399
Converts between character encodings.
Definition Api-TextCodec.h:44
Text input stream for unicode character conversion.
Text output stream for unicode character conversion.
Text stream for unicode character conversion.
Core module.
Definition Allocator.h:33