MIRA
Public Types | Public Member Functions | List of all members
BufferStream Class Reference

A stream class for input and output of data to/from a wrapped Buffer. More...

#include <stream/BufferStream.h>

Inheritance diagram for BufferStream:
Inheritance graph
[legend]

Public Types

typedef Buffer< char > container_type
 
typedef container_type::value_type char_type
 

Public Member Functions

 BufferStream (Buffer< char > &buffer)
 

Detailed Description

A stream class for input and output of data to/from a wrapped Buffer.

The usage of this BufferStream is similar to std::stringstream, however, the BufferStream is significantly faster than std::stringstream.

The BufferStream can be used as any other STL stream via its implemented << and >> operators.

Example:

// create a buffer for the stream,
Buffer<char> buffer;
// create the stream that operates on 'buffer'
BufferStream stream(buffer);
// write something into the stream
stream << "This is a test: " << 1234 << ", " << 12.34f;
// read from stream
std::string s;
stream >> s;

Member Typedef Documentation

◆ container_type

typedef Buffer<char> container_type

◆ char_type

Constructor & Destructor Documentation

◆ BufferStream()

BufferStream ( Buffer< char > &  buffer)
inline

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