57 buf1.
skip<
short int>();
62 buf1 = buf.
after<
short int>();
const NetBuffer after(size_t ofs) const
Return another NetBuffer starting ofs bytes from the beginning of this one.
Definition: netbuffer.h:111
Test skipBytes()
Definition: netbuffer.test.h:27
const T * cast(size_t ofs=0) const
Access the buffer contents as a structure T at the given offset.
Definition: netbuffer.h:93
void Test
Definition: test.h:178
void skip()
Move the starting point of this buffer sizeof(T) bytes from the beginning.
Definition: netbuffer.h:144
Definition: netbuffer.test.h:12
Definition: buffer.cpp:28
bool fits(size_t ofs=0) const
Check if the buffer is long enough to contain a structure T at the given offset.
Definition: netbuffer.h:84
#define assert_eq(x, y)
Definition: test.h:33
#define assert(x)
Definition: test.h:30
size_t size() const
Return the buffer size.
Definition: netbuffer.h:77
const void * data(size_t ofs=0) const
Return a pointer to the buffer.
Definition: netbuffer.h:71
Test startAtBeginning()
Definition: netbuffer.test.h:15
Buffer whose starting can be moved back and forth, useful to decapsulate stacked network packets...
Definition: netbuffer.h:35