1 #define MEMBUF_THRASH_SIZE 25 6 inline void MemBuffer::
8 if (_BufferLocal ==
true) {
9 if (_Buffer !=
nullptr) {
20 inline void MemBuffer::
21 AllocBuffer(
size_t len) {
22 _Buffer =
new char[len];
68 if (_BufferLocal ==
true) {
84 if (new_len >= _BufferLen) {
85 size_t len = new_len + MEMBUF_THRASH_SIZE;
88 char *tmp =
new char[len];
90 if (_Buffer !=
nullptr) {
91 memcpy(tmp,_Buffer,_BufferLen);
126 inline bool MemBuffer::
127 InBufferRange(
char *inpos) {
128 return (inpos >= _Buffer && inpos <= (_Buffer + _BufferLen));
void GrowBuffer(size_t len)
Grow a buffer is needed to get to a sertion size No care is made here to preserve convtent unlike a v...
char * GetBuffer(void)
Access to the actual BUffer.
size_t GetBufferSize(void) const
Access to the BUffer Size Information.
virtual ~MemBuffer()
CLean UP a mess on Deletion.
MemBuffer(void)
default constructor
void SetBuffer(char *data, size_t len)
Assigns a buffer.