#include <iobuffer.hpp>
Definition at line 32 of file iobuffer.hpp.
◆ iobuffer()
fc::iobuffer::iobuffer |
( |
size_t | s | ) |
|
|
inline |
◆ close()
virtual void fc::iobuffer::close |
( |
| ) |
|
|
inlinevirtual |
◆ data()
char * fc::iobuffer::data |
( |
| ) |
|
|
inline |
Definition at line 71 of file iobuffer.hpp.
71{ return _data.data(); }
◆ flush()
virtual void fc::iobuffer::flush |
( |
| ) |
|
|
inlinevirtual |
◆ peek()
char fc::iobuffer::peek |
( |
| ) |
const |
|
inline |
This method may block until at least 1 character is available.
Definition at line 57 of file iobuffer.hpp.
58 {
59 if( _pos == _data.size() ) throw fc::eof_exception();
60 return _data[_pos];
61 }
◆ pos()
size_t fc::iobuffer::pos |
( |
| ) |
const |
|
inline |
◆ readsome()
virtual size_t fc::iobuffer::readsome |
( |
char * | buf, |
|
|
size_t | len ) |
|
inlinevirtual |
Definition at line 45 of file iobuffer.hpp.
46 {
47 auto avail = std::min<size_t>( _data.size()-_pos,
len );
48 if( avail == 0 ) throw fc::eof_exception();
50 _pos += avail;
51 return avail;
52 }
memcpy((char *) pInfo->slotDescription, s, l)
◆ seek()
size_t fc::iobuffer::seek |
( |
size_t | pos | ) |
|
|
inline |
Definition at line 40 of file iobuffer.hpp.
41 {
42 return _pos = std::min<size_t>(_data.size(),
pos);
43 }
◆ size()
size_t fc::iobuffer::size |
( |
| ) |
const |
|
inline |
Definition at line 38 of file iobuffer.hpp.
38{ return _data.size(); }
◆ writesome()
virtual size_t fc::iobuffer::writesome |
( |
const char * | buf, |
|
|
size_t | len ) |
|
inlinevirtual |
Definition at line 63 of file iobuffer.hpp.
64 {
65 auto avail = std::max<size_t>( _data.size(), _pos +
len );
66 _data.resize(avail);
68 _pos += avail;
69 return avail;
70 }
The documentation for this class was generated from the following file: