CppCMS
Public Member Functions
cppcms::util::steal_buffer< Size > Class Template Reference

This is a special buffer that allows to "steal" some chunk of text from the output stream. More...

#include <cppcms/steal_buf.h>

Inheritance diagram for cppcms::util::steal_buffer< Size >:
cppcms::util::stackbuf< Size > streambuf

List of all members.

Public Member Functions

 steal_buffer (std::ostream &out)
 steal_buffer ()
void steal (std::ostream &out)
void release ()

Detailed Description

template<size_t Size = 128>
class cppcms::util::steal_buffer< Size >

This is a special buffer that allows to "steal" some chunk of text from the output stream.

It does this by replacing stream's streambuf object with temporary stream buffer that records all data written to the stream and then returns the original buffer upon call to release() member function it steal_buffer destruction.

The Size parameter defines the default chunk of memory allocated on the stack before heap is used.


Constructor & Destructor Documentation

template<size_t Size = 128>
cppcms::util::steal_buffer< Size >::steal_buffer ( std::ostream &  out) [inline]

Create the buffer and "Steal" the buffer from out

References cppcms::util::steal_buffer< Size >::steal().

template<size_t Size = 128>
cppcms::util::steal_buffer< Size >::steal_buffer ( ) [inline]

Create an empty buffer


Member Function Documentation

template<size_t Size = 128>
void cppcms::util::steal_buffer< Size >::release ( ) [inline]

Release the "stolen" buffer back, now the buffer contains all the data that was recorded.

Referenced by cppcms::util::steal_buffer< Size >::steal().

template<size_t Size = 128>
void cppcms::util::steal_buffer< Size >::steal ( std::ostream &  out) [inline]

The documentation for this class was generated from the following file: