A basic_iostream class that holds a character vector specified by CharVector template parameter as its formatting buffer. More...
#include <vectorstream.hpp>
Public Types | |
typedef CharVector | vector_type |
typedef std::basic_ios < typename CharVector::value_type, CharTraits >::char_type | char_type |
typedef std::basic_ios < char_type, CharTraits > ::int_type | int_type |
typedef std::basic_ios < char_type, CharTraits > ::pos_type | pos_type |
typedef std::basic_ios < char_type, CharTraits > ::off_type | off_type |
typedef std::basic_ios < char_type, CharTraits > ::traits_type | traits_type |
Public Member Functions | |
basic_vectorstream (std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) | |
Constructor. More... | |
template<class VectorParameter > | |
basic_vectorstream (const VectorParameter ¶m, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) | |
Constructor. More... | |
basic_vectorbuf< CharVector, CharTraits > * | rdbuf () const |
void | swap_vector (vector_type &vect) |
Swaps the underlying vector with the passed vector. More... | |
const vector_type & | vector () const |
Returns a const reference to the internal vector. More... | |
void | reserve (typename vector_type::size_type size) |
Calls reserve() method of the internal vector. More... | |
void | clear () |
Calls clear() method of the internal vector. More... | |
Private Member Functions | |
virtual int_type | underflow () |
virtual int_type | pbackfail (int_type c=CharTraits::eof()) |
virtual int_type | overflow (int_type c=CharTraits::eof()) |
virtual pos_type | seekoff (off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
virtual pos_type | seekpos (pos_type pos, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
A basic_iostream class that holds a character vector specified by CharVector template parameter as its formatting buffer.
The vector must have contiguous storage, like std::vector, boost::interprocess::vector or boost::interprocess::basic_string
typedef std::basic_ios<typename CharVector::value_type, CharTraits>::char_type boost::interprocess::basic_vectorstream< CharVector, CharTraits >::char_type |
typedef std::basic_ios<char_type, CharTraits>::int_type boost::interprocess::basic_vectorstream< CharVector, CharTraits >::int_type |
typedef std::basic_ios<char_type, CharTraits>::off_type boost::interprocess::basic_vectorstream< CharVector, CharTraits >::off_type |
typedef std::basic_ios<char_type, CharTraits>::pos_type boost::interprocess::basic_vectorstream< CharVector, CharTraits >::pos_type |
typedef std::basic_ios<char_type, CharTraits>::traits_type boost::interprocess::basic_vectorstream< CharVector, CharTraits >::traits_type |
typedef CharVector boost::interprocess::basic_vectorstream< CharVector, CharTraits >::vector_type |
|
inline |
Constructor.
Throws if vector_type default constructor throws.
|
inline |
Constructor.
Throws if vector_type(const VectorParameter ¶m) throws.
|
inline |
Calls clear() method of the internal vector.
Resets the stream to the first position.
References boost::interprocess::basic_vectorbuf< CharVector, CharTraits >::clear().
|
inline |
|
inline |
Calls reserve() method of the internal vector.
Resets the stream to the first position. Throws if the internals vector's reserve throws.
References boost::interprocess::basic_vectorbuf< CharVector, CharTraits >::reserve().
|
inline |
Swaps the underlying vector with the passed vector.
This function resets the read/write position in the stream. Does not throw.
References boost::interprocess::basic_vectorbuf< CharVector, CharTraits >::swap_vector().
|
inline |
Returns a const reference to the internal vector.
Does not throw.
References boost::interprocess::basic_vectorbuf< CharVector, CharTraits >::vector().