29 #ifndef Pt_StreamBuffer_h
30 #define Pt_StreamBuffer_h
33 #include <Pt/String.h>
37 #if defined(_MSC_VER) && defined(_WIN32_WCE)
39 template class PT_EXPORT std::basic_streambuf<char>;
43 template class PT_EXPORT std::basic_streambuf<Pt::Char>;
50 template <
typename CharT,
typename TraitsT = std::
char_traits<CharT> >
54 typedef CharT char_type;
55 typedef TraitsT traits_type;
56 typedef typename TraitsT::int_type int_type;
57 typedef typename TraitsT::pos_type pos_type;
58 typedef typename TraitsT::off_type off_type;
68 std::streamsize
speekn(CharT* buffer, std::streamsize size)
74 if( ! this->gptr() || this->gptr() == this->egptr() )
76 next = this->underflow();
78 if( traits_type::eof() == next)
82 std::size_t avail = this->gptr() ? this->egptr() - this->gptr() : 0;
87 *buffer = traits_type::to_char_type(next);
91 std::size_t n =
static_cast<std::size_t
>(size);
95 traits_type::copy(buffer, this->gptr(), n);
104 return this->pptr() - this->pbase();
Buffer for input and output streams.
Definition: StreamBuffer.h:51
std::streamsize speekn(CharT *buffer, std::streamsize size)
Peek data in stream.
Definition: StreamBuffer.h:68
virtual std::streamsize showfull()
Returns the number of characters buffered for output.
Definition: StreamBuffer.h:117
BasicStreamBuffer()
Default Constructor.
Definition: StreamBuffer.h:112
std::streamsize out_avail()
Returns the number of characters buffered for output.
Definition: StreamBuffer.h:101
~BasicStreamBuffer()
Destructor.
Definition: StreamBuffer.h:63