Chrono::Engine C++ API
Public Member Functions
chrono::ChStreamVectorWrapper Class Reference

#include <ChStream.h>

Inheritance diagram for chrono::ChStreamVectorWrapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ChStreamVectorWrapper (std::vector< char > *mchars)
virtual ~ChStreamVectorWrapper ()
virtual void Read (char *data, int n)
virtual void Write (const char *data, int n)
virtual bool End_of_stream ()
std::vector< char > * GetVector ()
void Seek (int position)

Detailed Description

This is a wrapper for a std::vector<char> (buffer of chars)


Constructor & Destructor Documentation

chrono::ChStreamVectorWrapper::ChStreamVectorWrapper ( std::vector< char > *  mchars)

Creates a wrapper for an already existing std::vector<char>, given the pointer to that vector.

chrono::ChStreamVectorWrapper::~ChStreamVectorWrapper ( ) [virtual]

Deleting this wrapper does not delete nor closes the wrapped buffer!


Member Function Documentation

void chrono::ChStreamVectorWrapper::Read ( char *  data,
int  n 
) [virtual]

Reads from vector, up to n chars. If does not succeed, throws exception.

void chrono::ChStreamVectorWrapper::Seek ( int  position)

Rewind read position to char number (0= beginning). Write position is always at the end (append).

void chrono::ChStreamVectorWrapper::Write ( const char *  data,
int  n 
) [virtual]

Writes raw data to vector, up to n chars. If does not succeed, throws exception.