25 ::memcpy(this->
content, v_content, v_size);
33 if (!v_parent)
throw BufferException(
"Cannot make subBuffer for NULL buffer!");
38 bufsize_t copySize = v_size < parentSize ? v_size : parentSize;
39 bufsize_t allocSize = v_size > parentSize ? v_size : parentSize;
41 BYTE *bContent = v_parent->
getContentAt(v_offset, copySize);
42 if (!bContent)
throw BufferException(
"Cannot make Buffer for NULL content!");
48 ::memcpy(this->
content, bContent, copySize);
56 const bufsize_t allocSize = v_size + v_padding;
59 BYTE*
content =
reinterpret_cast<BYTE*
>(::realloc((
void*)this->content, allocSize));
61 throw BufferException(
"Cannot allocate buffer of size: 0x" + QString::number(allocSize, 16));
74 BYTE *newContent =
nullptr;
virtual bufsize_t getContentSize()=0
virtual BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
virtual bool resize(bufsize_t newSize)