29 #ifndef Pt_TextStream_h
30 #define Pt_TextStream_h
33 #include <Pt/String.h>
34 #include <Pt/TextBuffer.h>
35 #include <Pt/IOStream.h>
46 template <
typename CharT,
typename ByteT>
63 typedef typename traits_type::int_type
int_type;
66 typedef typename traits_type::pos_type
pos_type;
69 typedef typename traits_type::off_type
off_type;
87 , _tbuffer( is, codec )
113 return _tbuffer.
codec();
185 template <
typename CharT,
typename ByteT>
226 , _tbuffer( os , codec )
252 return _tbuffer.
codec();
324 template <
typename CharT,
typename ByteT>
365 , _tbuffer( ios, codec)
391 return _tbuffer.
codec();
466 typedef BasicTextIStream<Char, char> TextIStream;
480 typedef BasicTextOStream<Char, char> TextOStream;
494 typedef BasicTextStream<Char, char> TextStream;
573 #endif // Pt_TextStream_h
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:127
ByteT extern_type
External character type.
Definition: TextStream.h:329
void reset()
Resets the buffer and target.
Definition: TextStream.h:152
void detach()
Detach from external target.
Definition: TextStream.h:135
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:399
~BasicTextStream()
Destructor.
Definition: TextStream.h:384
void discard()
Discards the buffer.
Definition: TextBuffer.h:189
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:175
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:344
Converts character sequences using a codec.
Definition: TextStream.h:325
BasicTextIStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:97
CharT char_type
Internal character type.
Definition: TextStream.h:196
BasicTextIStream(StreamType &is, CodecType *codec)
Construct with input stream and codec.
Definition: TextStream.h:85
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:199
CharT char_type
Internal character type.
Definition: TextStream.h:335
void discard()
Discards the buffer.
Definition: TextStream.h:420
void discard()
Discards the buffer.
Definition: TextStream.h:142
void reset(StreamType &ios)
Resets the buffer and target.
Definition: TextStream.h:440
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:205
void reset(StreamType &os)
Resets the buffer and target.
Definition: TextStream.h:301
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:353
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:308
CodecType * codec()
Returns the used codec or a nullptr.
Definition: TextBuffer.h:132
void attach(StreamType &is)
Attach to external target.
Definition: TextStream.h:128
void detach()
Detach from external target.
Definition: TextStream.h:274
Input stream.
Definition: IOStream.h:57
Converts between character encodings.
Definition: TextCodec.h:38
void discard()
Discards the buffer.
Definition: TextStream.h:281
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:341
~BasicTextIStream()
Destructor.
Definition: TextStream.h:106
Input/Output stream.
Definition: IOStream.h:141
void reset(StreamType &is)
Resets the buffer and target.
Definition: TextStream.h:162
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:75
BasicTextOStream(StreamType &os, CodecType *codec)
Construct with output stream and codec.
Definition: TextStream.h:224
Converts character sequences using a codec.
Definition: TextStream.h:186
void attach(StreamType &ios)
Attach to external target.
Definition: TextStream.h:406
Unicode character type.
Definition: String.h:66
CharT char_type
Internal character type.
Definition: TextStream.h:57
void reset()
Resets the buffer and target.
Definition: TextStream.h:291
CharT intern_type
Internal character type.
Definition: TextStream.h:193
std::basic_ostream< extern_type > StreamType
External stream type.
Definition: TextStream.h:211
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:69
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:111
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:214
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:347
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:260
BasicTextStream(StreamType &ios, CodecType *codec)
Construct by stream and codec.
Definition: TextStream.h:363
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:338
void reset()
Resets the buffer and target.
Definition: TextBuffer.h:170
void reset()
Resets the buffer and target.
Definition: TextStream.h:430
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:63
void detach()
Detach from external target.
Definition: TextStream.h:413
Output stream.
Definition: IOStream.h:101
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:250
ByteT extern_type
External character type.
Definition: TextStream.h:51
Converts character sequences using a codec.
Definition: TextStream.h:47
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:447
std::basic_istream< extern_type > StreamType
External stream type.
Definition: TextStream.h:72
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:202
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:121
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:169
void attach(StreamType &os)
Attach to external target.
Definition: TextStream.h:267
CharT intern_type
Internal character type.
Definition: TextStream.h:332
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextBuffer.h:140
BasicTextOStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:236
ByteT extern_type
External character type.
Definition: TextStream.h:190
void detach()
Detach from external target.
Definition: TextBuffer.h:160
std::basic_iostream< extern_type > StreamType
External stream type.
Definition: TextStream.h:350
BasicTextStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:375
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:66
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:87
CharT intern_type
Internal character type.
Definition: TextStream.h:54
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:60
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:208
~BasicTextOStream()
Destructor.
Definition: TextStream.h:245
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:389
void attach(std::basic_ios< extern_type > &target)
Attach to external target.
Definition: TextBuffer.h:153