#include <binarystream.h>
Public Member Functions | |
basic_binstreambuf (std::streamsize sz) | |
basic_binstreambuf (const _Ch *p) | |
virtual | ~basic_binstreambuf () |
_Ch * | givebuf () |
size_t | outbufsize () const |
Static Public Member Functions | |
static size_t | computesize (size_t s) |
Private Attributes | |
_Ch * | _outbuf |
_Ch * | _inbuf |
Definition at line 26 of file binarystream.h.
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf | ( | std::streamsize | sz | ) | [inline] |
Definition at line 29 of file binarystream.h.
References basic_binstreambuf< _Ch, _Tr >::_outbuf.
00029 : _outbuf(new _Ch[sz + sizeof(std::streamsize)/sizeof(_Ch)]), _inbuf(0) { 00030 memcpy(_outbuf, &sz, sizeof(std::streamsize)); 00031 setp (_outbuf + sizeof(std::streamsize), _outbuf + sz*sizeof(_Ch) + sizeof(unsigned int)); 00032 }
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf | ( | const _Ch * | p | ) | [inline] |
Definition at line 33 of file binarystream.h.
References basic_binstreambuf< _Ch, _Tr >::_inbuf.
00033 : _outbuf(0), _inbuf(0) { 00034 std::streamsize sz = *((const std::streamsize*)p); 00035 _inbuf = new _Ch[sz]; 00036 memcpy (_inbuf, p + sizeof(std::streamsize), sz); 00037 setg (_inbuf, _inbuf, _inbuf + sz * sizeof(_Ch)); 00038 }
virtual basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf | ( | ) | [inline, virtual] |
Definition at line 39 of file binarystream.h.
References basic_binstreambuf< _Ch, _Tr >::_inbuf, and basic_binstreambuf< _Ch, _Tr >::_outbuf.
static size_t basic_binstreambuf< _Ch, _Tr >::computesize | ( | size_t | s | ) | [inline, static] |
Definition at line 56 of file binarystream.h.
Referenced by basic_binostream< _Ch, _Tr >::computesize().
00056 { 00057 return s + sizeof(std::streamsize); 00058 }
_Ch* basic_binstreambuf< _Ch, _Tr >::givebuf | ( | ) | [inline] |
size_t basic_binstreambuf< _Ch, _Tr >::outbufsize | ( | ) | const [inline] |
Definition at line 50 of file binarystream.h.
References basic_binstreambuf< _Ch, _Tr >::_outbuf.
00050 { 00051 return (_outbuf) ? (sizeof(_Ch) * (*(std::streamsize*)_outbuf) + sizeof(std::streamsize)) : 0; 00052 }
_Ch* basic_binstreambuf< _Ch, _Tr >::_inbuf [private] |
Definition at line 62 of file binarystream.h.
Referenced by basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf(), and basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf().
_Ch* basic_binstreambuf< _Ch, _Tr >::_outbuf [private] |
Definition at line 61 of file binarystream.h.
Referenced by basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf(), basic_binstreambuf< _Ch, _Tr >::givebuf(), basic_binstreambuf< _Ch, _Tr >::outbufsize(), and basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf().