|
CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
|
This class is made to help writing in ostreams with a buffer. More...
#include <buffered_ostream.hpp>
Public Member Functions | |
| buffered_ostream (stream_type &f, unsigned int buffer_size=1024) | |
| Constructor. | |
| ~buffered_ostream () | |
| Destructor. | |
| template<typename T > | |
| void | write (T v) |
| Write somethnig in the buffer. | |
| void | write (const char *p, unsigned int n) |
| Write a range of data in the buffer. | |
| void | flush () |
| Write the data from the buffer in the stream. | |
Private Types | |
| typedef Stream | stream_type |
| The type of the stream we will write. | |
Private Attributes | |
| stream_type & | m_stream |
| The stream we're writing. | |
| char *const | m_begin |
| Pointer to the begining of the buffer. | |
| char *const | m_end |
| Pointer to the first invalid byte after the end of the buffer. | |
| char * | m_current |
| Pointer to the current not already read valid byte. | |
This class is made to help writing in ostreams with a buffer.
Definition at line 40 of file buffered_ostream.hpp.
typedef Stream claw::buffered_ostream< Stream >::stream_type [private] |
The type of the stream we will write.
Definition at line 44 of file buffered_ostream.hpp.
| claw::buffered_ostream< Stream >::buffered_ostream | ( | stream_type & | f, |
| unsigned int | buffer_size = 1024 |
||
| ) |
| claw::buffered_ostream< Stream >::~buffered_ostream | ( | ) |
Destructor.
Definition at line 52 of file buffered_ostream.tpp.
| void claw::buffered_ostream< Stream >::flush | ( | ) |
| void claw::buffered_ostream< Stream >::write | ( | T | v | ) |
Write somethnig in the buffer.
| v | The value to write. |
Definition at line 65 of file buffered_ostream.tpp.
{
write( reinterpret_cast<const char*>(&v), sizeof(v) );
} // buffered_ostream::read_more()
| void claw::buffered_ostream< Stream >::write | ( | const char * | p, |
| unsigned int | n | ||
| ) |
Write a range of data in the buffer.
| p | The begining of the range to write. |
| n | The length of the buffer pointed by p. |
Definition at line 77 of file buffered_ostream.tpp.
char* const claw::buffered_ostream< Stream >::m_begin [private] |
Pointer to the begining of the buffer.
Definition at line 62 of file buffered_ostream.hpp.
char* claw::buffered_ostream< Stream >::m_current [private] |
Pointer to the current not already read valid byte.
Definition at line 69 of file buffered_ostream.hpp.
char* const claw::buffered_ostream< Stream >::m_end [private] |
Pointer to the first invalid byte after the end of the buffer.
Definition at line 66 of file buffered_ostream.hpp.
stream_type& claw::buffered_ostream< Stream >::m_stream [private] |
The stream we're writing.
Definition at line 59 of file buffered_ostream.hpp.
1.7.3