Public Member Functions |
| NetBuffer () throw () |
| NetBuffer (size_t size) |
| NetBuffer (void *buf, size_t size, bool own=true) |
| NetBuffer (const void *buf, size_t size) |
| NetBuffer (const Buffer &buf) throw () |
| NetBuffer (const NetBuffer &buf) throw () |
NetBuffer & | operator= (const Buffer &buf) |
NetBuffer & | operator= (const NetBuffer &buf) |
const void * | data (size_t ofs=0) const throw () |
| Return a pointer to the buffer.
|
void * | data (size_t ofs=0) throw () |
| Return a pointer to the buffer.
|
size_t | size () const throw () |
| Return the buffer size.
|
template<class T > |
bool | fits (size_t ofs=0) const throw () |
| Check if the buffer is long enough to contain a structure T at the given offset.
|
template<class T > |
const T * | cast (size_t ofs=0) const throw (wibble::exception::Consistency) |
| Access the buffer contents as a structure T at the given offset.
|
NetBuffer | operator+ (size_t ofs) throw (wibble::exception::Consistency) |
| Return another NetBuffer starting ofs bytes from the beginning of this one.
|
const NetBuffer | after (size_t ofs) const throw (wibble::exception::Consistency) |
| Return another NetBuffer starting ofs bytes from the beginning of this one.
|
template<class T > |
const NetBuffer | after () const throw (wibble::exception::Consistency) |
| Return another NetBuffer starting just after sizeof(T) from the beginning of this one.
|
NetBuffer & | operator+= (size_t ofs) throw (wibble::exception::Consistency) |
| Move the starting point of this buffer ofs bytes from the beginning.
|
template<class T > |
void | skip () throw (wibble::exception::Consistency) |
| Move the starting point of this buffer sizeof(T) bytes from the beginning.
|
void | skip (size_t t) throw (wibble::exception::Consistency) |
| Move the starting point of this buffer ofs bytes from the beginning.
|
| Buffer () throw () |
| Create a 0-lenght buffer.
|
| Buffer (size_t size) |
| Create a buffer with the specified size.
|
| Buffer (void *buf, size_t size, bool own=true) |
| Create a buffer from existing data.
|
| Buffer (const void *buf, size_t size) |
| Create a buffer with a copy of the given data.
|
| Buffer (const Buffer &buf) throw () |
| ~Buffer () |
void * | data () throw () |
| Return a pointer to the buffer.
|
const void * | data () const throw () |
| Return a pointer to the buffer.
|
void | resize (size_t newSize) |
| Resize the buffer to hold exactly the specified amount of bytes.
|
bool | operator== (const Buffer &buf) const throw () |
| Compare the contents of two buffers.
|
bool | operator!= (const Buffer &buf) const throw () |
bool | operator< (const Buffer &buf) const throw () |
| Compare the contents of two buffers.
|
Buffer whose starting can be moved back and forth, useful to decapsulate stacked network packets.