mirror of
https://github.com/hasherezade/bearparser
synced 2026-06-08 14:32:38 +00:00
31 lines
838 B
C++
31 lines
838 B
C++
#pragma once
|
|
#include "AbstractByteBuffer.h"
|
|
|
|
#define DEFAULT_PADDING 2
|
|
|
|
class ByteBuffer : public AbstractByteBuffer
|
|
{
|
|
public:
|
|
ByteBuffer(bufsize_t v_size, bufsize_t padding = DEFAULT_PADDING);
|
|
ByteBuffer(BYTE *v_content, bufsize_t v_size, bufsize_t padding = DEFAULT_PADDING);
|
|
ByteBuffer(AbstractByteBuffer *sourceBuf, offset_t offset, bufsize_t size, bufsize_t padding = DEFAULT_PADDING);
|
|
|
|
virtual ~ByteBuffer();
|
|
|
|
virtual bufsize_t getContentSize() { return contentSize; }
|
|
virtual BYTE* getContent() { return content; }
|
|
virtual bool resize(bufsize_t newSize);
|
|
|
|
virtual bool isResized() { return originalSize != contentSize; }
|
|
|
|
protected:
|
|
BYTE* allocContent(bufsize_t v_size, bufsize_t padding);
|
|
|
|
BYTE *content;
|
|
bufsize_t contentSize;
|
|
bufsize_t padding;
|
|
|
|
bufsize_t originalSize;
|
|
};
|
|
|