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();
494 typedef BasicTextStream<Char, char>
TextStream;
573 #endif // Pt_TextStream_h
Core module.
Definition: Allocator.h:33
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:87
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:353
Converts character sequences using a codec.
Definition: TextStream.h:326
void attach(StreamType &is)
Attach to external target.
Definition: TextStream.h:128
void reset(StreamType &ios)
Resets the buffer and target.
Definition: TextStream.h:440
~BasicTextStream()
Destructor.
Definition: TextStream.h:384
CharT char_type
Internal character type.
Definition: TextStream.h:196
void detach()
Detach from external target.
Definition: TextStream.h:135
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:208
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:447
BasicTextIStream(StreamType &is, CodecType *codec)
Construct with input stream and codec.
Definition: TextStream.h:85
void attach(StreamType &ios)
Attach to external target.
Definition: TextStream.h:406
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:127
Converts character sequences using a codec.
Definition: TextStream.h:187
CharT intern_type
Internal character type.
Definition: TextStream.h:332
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:389
std::basic_ostream< extern_type > StreamType
External stream type.
Definition: TextStream.h:211
CharT intern_type
Internal character type.
Definition: TextStream.h:193
Text input stream for unicode character conversion.
Input/Output stream.
Definition: IOStream.h:142
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:338
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:75
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:169
void detach()
Detach from external target.
Definition: TextStream.h:413
Unicode character type.
Definition: String.h:67
void reset()
Resets the buffer and target.
Definition: TextStream.h:291
void reset(StreamType &os)
Resets the buffer and target.
Definition: TextStream.h:301
void detach()
Detach from external target.
Definition: TextBuffer.h:160
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:399
BasicTextStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:375
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextBuffer.h:140
~BasicTextIStream()
Destructor.
Definition: TextStream.h:106
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:111
Converts character sequences using a codec.
Definition: TextStream.h:48
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:60
void reset()
Resets the buffer and target.
Definition: TextStream.h:430
CharT char_type
Internal character type.
Definition: TextStream.h:57
TextCodec< char_type, extern_type > CodecType
Codec type.
Definition: TextStream.h:214
Converts between character encodings.
Definition: Api-TextCodec.h:40
void detach()
Detach from external target.
Definition: TextStream.h:274
ByteT extern_type
External character type.
Definition: TextStream.h:51
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:260
ByteT extern_type
External character type.
Definition: TextStream.h:329
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:63
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:66
void setBuffer(BasicStreamBuffer< CharT > *sb)
Sets the buffer.
Definition: IOStream.h:175
Text output stream for unicode character conversion.
Input stream.
Definition: IOStream.h:58
CodecType * codec()
Returns the used code or a nullptr.
Definition: TextStream.h:250
std::basic_iostream< extern_type > StreamType
External stream type.
Definition: TextStream.h:350
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:202
void setCodec(CodecType *codec)
Sets the text codec.
Definition: TextStream.h:121
ByteT extern_type
External character type.
Definition: TextStream.h:190
BasicTextOStream(StreamType &os, CodecType *codec)
Construct with output stream and codec.
Definition: TextStream.h:224
traits_type::int_type int_type
Integer type.
Definition: TextStream.h:341
void discard()
Discards the buffer.
Definition: TextStream.h:142
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:347
std::char_traits< CharT > traits_type
Internal character traits.
Definition: TextStream.h:199
BasicTextStream(StreamType &ios, CodecType *codec)
Construct by stream and codec.
Definition: TextStream.h:363
CharT intern_type
Internal character type.
Definition: TextStream.h:54
BasicTextOStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:236
~BasicTextOStream()
Destructor.
Definition: TextStream.h:245
traits_type::off_type off_type
Stream offset type.
Definition: TextStream.h:69
void attach(StreamType &os)
Attach to external target.
Definition: TextStream.h:267
Output stream.
Definition: IOStream.h:102
void reset(StreamType &is)
Resets the buffer and target.
Definition: TextStream.h:162
std::basic_istream< extern_type > StreamType
External stream type.
Definition: TextStream.h:72
void reset()
Resets the buffer and target.
Definition: TextBuffer.h:170
Text stream for unicode character conversion.
CodecType * codec()
Returns the used codec or a nullptr.
Definition: TextBuffer.h:132
void discard()
Discards the buffer.
Definition: TextBuffer.h:189
void discard()
Discards the buffer.
Definition: TextStream.h:281
BasicTextIStream(CodecType *codec)
Construct with codec.
Definition: TextStream.h:97
CharT char_type
Internal character type.
Definition: TextStream.h:335
void discard()
Discards the buffer.
Definition: TextStream.h:420
void reset()
Resets the buffer and target.
Definition: TextStream.h:152
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:205
BasicTextBuffer< intern_type, extern_type > & textBuffer()
Returns the stream buffer.
Definition: TextStream.h:308
void attach(std::basic_ios< extern_type > &target)
Attach to external target.
Definition: TextBuffer.h:153
traits_type::pos_type pos_type
Stream position type.
Definition: TextStream.h:344