#include <memstream.hh>
Public Types | |
| typedef _CharT | char_type |
| Character data type. | |
| typedef _Traits | traits_type |
| Trait data type. | |
| typedef traits_type::int_type | int_type |
| Integer type. | |
| typedef traits_type::pos_type | pos_type |
| Position type. | |
| typedef traits_type::off_type | off_type |
| Offset type. | |
|
typedef std::basic_streambuf < char_type, traits_type > | _streambuf_type |
| Stream buffer type. | |
Public Member Functions | |
| basic_membuf (std::ios_base::openmode __mode=std::ios_base::out) | |
| Default constructor. | |
| basic_membuf (char_type *buf, int_type len, std::ios_base::openmode __mode=std::ios_base::out) | |
| Open constructor. | |
| virtual | ~basic_membuf (void) |
| Destructor. | |
Protected Member Functions | |
| virtual int_type | underflow (void) |
| Buffer underflow handler. | |
| virtual int_type | overflow (void) |
| Buffer overflow handler. | |
| virtual int_type | pbackfail (int_type c) |
| Put-back failure handler. | |
| virtual pos_type | seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode mode) |
| Seek a specified offset. | |
| virtual pos_type | seekpos (pos_type sp, std::ios_base::openmode mode) |
| Seek a specified position. | |
| virtual basic_membuf< _CharT, _Traits > * | setbuf (char_type *buf, int_type len) |
| Set the buffer pointer. | |
| virtual int | sync (void) |
| STL streambuf::sync. | |
An STL stream buffer to read/write data to/from a memory buffer
| basic_membuf< _CharT, _Traits >::basic_membuf | ( | std::ios_base::openmode | __mode = std::ios_base::out |
) | [inline] |
Default constructor.
Construct a closed membuf stream.
| __mode | Input/output mode. |
| basic_membuf< _CharT, _Traits >::basic_membuf | ( | char_type * | buf, | |
| int_type | len, | |||
| std::ios_base::openmode | __mode = std::ios_base::out | |||
| ) | [inline] |
Open constructor.
Construct a membuf stream and open it on a specified buffer.
| __mode | Input/output mode. | |
| buf | Buffer pointer. | |
| len | Buffer data length. |
| virtual basic_membuf< _CharT, _Traits >::~basic_membuf | ( | void | ) | [inline, virtual] |
Destructor.
Destroy the stream buffer.
| basic_membuf< _CharT, _Traits >::int_type basic_membuf< _CharT, _Traits >::underflow | ( | void | ) | [inline, protected, virtual] |
Buffer underflow handler.
Handle a buffer underflow.
| virtual int_type basic_membuf< _CharT, _Traits >::overflow | ( | void | ) | [inline, protected, virtual] |
Buffer overflow handler.
Handle a buffer overflow.
| virtual int_type basic_membuf< _CharT, _Traits >::pbackfail | ( | int_type | c | ) | [inline, protected, virtual] |
Put-back failure handler.
Handle put-back failure.
| basic_membuf< _CharT, _Traits >::pos_type basic_membuf< _CharT, _Traits >::seekoff | ( | off_type | off, | |
| std::ios_base::seekdir | way, | |||
| std::ios_base::openmode | mode | |||
| ) | [inline, protected, virtual] |
Seek a specified offset.
Position read/write pointers to the specified offset.
| basic_membuf< _CharT, _Traits >::pos_type basic_membuf< _CharT, _Traits >::seekpos | ( | pos_type | sp, | |
| std::ios_base::openmode | mode | |||
| ) | [inline, protected, virtual] |
Seek a specified position.
Position read/write pointers to the specified position.
| basic_membuf< _CharT, _Traits > * basic_membuf< _CharT, _Traits >::setbuf | ( | char_type * | buf, | |
| int_type | len | |||
| ) | [inline, protected, virtual] |
Set the buffer pointer.
Set the buffer pointer and length.
| virtual int basic_membuf< _CharT, _Traits >::sync | ( | void | ) | [inline, protected, virtual] |
STL streambuf::sync.
The synch method is supposed to synchronize the memory buffers to an external file. Since there are no external files in this case, the sync command is a no-operation.
1.5.4