15 #ifndef BOOST_SK_ALT_SSTREAM_HPP 16 #define BOOST_SK_ALT_SSTREAM_HPP 28 template<
class Ch,
class Tr=::std::
char_traits<Ch>,
29 class Alloc=::std::allocator<Ch> >
32 template<
class Ch,
class Tr =::std::
char_traits<Ch>,
33 class Alloc=::std::allocator<Ch> >
37 template<
class Ch,
class Tr,
class Alloc>
39 :
public ::std::basic_streambuf<Ch, Tr>
47 typedef typename compat_traits_type::int_type
int_type;
48 typedef typename compat_traits_type::pos_type
pos_type;
49 typedef typename compat_traits_type::off_type
off_type;
62 ::std::ios_base::openmode
mode 68 using streambuf_t::pbase;
69 using streambuf_t::pptr;
70 using streambuf_t::epptr;
71 using streambuf_t::eback;
72 using streambuf_t::gptr;
73 using streambuf_t::egptr;
76 void str(
const string_type&
s);
80 size_type
size()
const;
85 {
return static_cast<size_type
>( pptr() - pbase()) ;}
88 string_type
str()
const 94 ::std::ios_base::openmode
mode 99 virtual pos_type
seekoff(off_type off, ::std::ios_base::seekdir way,
100 ::std::ios_base::openmode which
103 ::std::ios_base::openmode which
106 virtual int_type
pbackfail(int_type meta = compat_traits_type::eof());
107 virtual int_type
overflow(int_type meta = compat_traits_type::eof());
120 template <
class Ch,
class Tr,
class Alloc>
122 :
private base_from_member< std::shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
123 public ::std::basic_ostream<Ch, Tr>
141 :
pbase_type(new stringbuf_t), stream_t(rdbuf())
150 {
return pbase_type::member.get(); }
152 { rdbuf()->clear_buffer(); }
156 {
return rdbuf()->begin(); }
158 {
return rdbuf()->size(); }
160 {
return rdbuf()->cur_size(); }
164 {
return rdbuf()->str(); }
166 {
return rdbuf()->cur_str(); }
176 #endif // include guard basic_altstringbuf< Ch, Tr, Alloc > stringbuf_t
::std::basic_streambuf< Ch, Tr > streambuf_t
::std::streamsize streamsize
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
virtual ~basic_altstringbuf()
::std::ios_base::openmode mode_
compat_traits_type::pos_type pos_type
compat_allocator_type alloc_
virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which=::std::ios_base::in|::std::ios_base::out)
boost::base_from_member< std::shared_ptr< basic_altstringbuf< Ch, Tr, Alloc > > > pbase_type
string_type::size_type size_type
string_type::size_type size_type
compat_traits_type::off_type off_type
basic_altstringbuf(const string_type &s, ::std::ios_base::openmode mode=::std::ios_base::in|::std::ios_base::out)
virtual int_type overflow(int_type meta=compat_traits_type::eof())
string_type cur_str() const
GLenum GLuint GLenum GLsizei const GLchar * buf
compat_traits_type::int_type int_type
size_type cur_size() const
virtual int_type pbackfail(int_type meta=compat_traits_type::eof())
basic_altstringbuf(basic_altstringbuf *s, ::std::ios_base::openmode mode=::std::ios_base::in|::std::ios_base::out)
CompatTraits< Tr >::compatible_type compat_traits_type
basic_oaltstringstream(stringbuf_t *buf)
::std::basic_string< Ch, Tr, Alloc > string_type
virtual int_type underflow()
basic_altstringbuf(std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
void str(const string_type &s)
string_type cur_str() const
size_type cur_size() const
stringbuf_t * rdbuf() const
basic_oaltstringstream(::std::shared_ptr< stringbuf_t > buf)
virtual pos_type seekpos(pos_type pos, ::std::ios_base::openmode which=::std::ios_base::in|::std::ios_base::out)
::std::basic_ostream< Ch, Tr > stream_t
::std::basic_string< Ch, Tr, Alloc > string_type
CompatAlloc< Alloc >::compatible_type compat_allocator_type
const T & operator()(const T &arg)