diff --git a/_byte_buffer_8cpp_source.html b/_byte_buffer_8cpp_source.html index 1a467446..5cceede4 100644 --- a/_byte_buffer_8cpp_source.html +++ b/_byte_buffer_8cpp_source.html @@ -81,7 +81,7 @@ $(function() {
2
3ByteBuffer::ByteBuffer(bufsize_t v_size, bufsize_t v_padding)
4 : content(NULL), contentSize(v_size), padding(v_padding),
-
5 m_isResized(false)
+
5 originalSize(v_size)
6{
7 if (v_size == 0) throw BufferException("Zero size requested");
8
@@ -91,18 +91,18 @@ $(function() {
12
13ByteBuffer::ByteBuffer(BYTE *v_content, bufsize_t v_size, bufsize_t v_padding)
14 : content(NULL), contentSize(v_size), padding(v_padding),
-
15 m_isResized(false)
+
15 originalSize(v_size)
16{
17 if (v_size == 0) throw BufferException("Zero size requested");
18
19 this->content = allocContent(v_size, v_padding);
20 this->contentSize = v_size;
-
21 memcpy(this->content, v_content, v_size);
+
21 ::memcpy(this->content, v_content, v_size);
22}
23
24ByteBuffer::ByteBuffer(AbstractByteBuffer *v_parent, offset_t v_offset, bufsize_t v_size, bufsize_t v_padding)
25 : content(NULL), contentSize(0), padding(0),
-
26 m_isResized(false)
+
26 originalSize(0)
27{
28 if (v_parent == NULL) throw BufferException("Cannot make subBuffer for NULL buffer!");
29 if (v_size == 0) throw BufferException("Cannot make 0 size buffer!");
@@ -115,10 +115,10 @@ $(function() {
36 BYTE *bContent = v_parent->getContentAt(v_offset, copySize);
37 if (bContent == NULL) throw BufferException("Cannot make Buffer for NULL content!");
38
-
39 this->content = allocContent(allocSize, v_padding);
+
39 this->content = allocContent(allocSize, v_padding);
40 this->contentSize = allocSize;
-
41
-
42 memcpy(this->content, bContent, copySize);
+
41 this->originalSize = this->contentSize;
+
42 ::memcpy(this->content, bContent, copySize);
43}
44
45BYTE* ByteBuffer::allocContent(bufsize_t v_size, bufsize_t v_padding)
@@ -129,7 +129,7 @@ $(function() {
50 if (content == NULL) {
51 throw BufferException("Cannot allocate buffer of size: 0x" + QString::number(allocSize, 16));
52 }
-
53 memset(content, 0, allocSize);
+
53 ::memset(content, 0, allocSize);
54 return content;
55}
56
@@ -143,30 +143,29 @@ $(function() {
64 } catch(BufferException &e) {
65 newContent = NULL;
66 }
-
67 if (newContent == NULL) return false;
+
67 if (!newContent) return false;
68
69 BYTE *oldContent = this->content;
70 bufsize_t oldSize = this->contentSize;
71 bufsize_t copySize = newSize < oldSize ? newSize : oldSize;
72
-
73 memcpy(newContent, oldContent, copySize);
+
73 ::memcpy(newContent, oldContent, copySize);
74
75 this->content = newContent;
76 this->contentSize = newSize;
77
78 delete []oldContent;
79
-
80 m_isResized = true;
-
81 return true;
-
82}
-
83
-
84ByteBuffer::~ByteBuffer()
-
85{
-
86 delete []this->content;
-
87}
+
80 return true;
+
81}
+
82
+
83ByteBuffer::~ByteBuffer()
+
84{
+
85 delete []this->content;
+
86}
+
87
88
89
-
90
bufsize_t
uint32_t bufsize_t
Definition: AbstractByteBuffer.h:14
offset_t
uint64_t offset_t
Definition: AbstractByteBuffer.h:17
ByteBuffer.h
@@ -174,14 +173,14 @@ $(function() {
AbstractByteBuffer::getContentSize
virtual bufsize_t getContentSize()=0
AbstractByteBuffer::getContentAt
virtual BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
Definition: AbstractByteBuffer.cpp:57
BufferException
Definition: AbstractByteBuffer.h:22
+
ByteBuffer::originalSize
bufsize_t originalSize
Definition: ByteBuffer.h:28
ByteBuffer::content
BYTE * content
Definition: ByteBuffer.h:24
-
ByteBuffer::~ByteBuffer
virtual ~ByteBuffer()
Definition: ByteBuffer.cpp:84
+
ByteBuffer::~ByteBuffer
virtual ~ByteBuffer()
Definition: ByteBuffer.cpp:83
ByteBuffer::contentSize
bufsize_t contentSize
Definition: ByteBuffer.h:25
ByteBuffer::ByteBuffer
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
Definition: ByteBuffer.cpp:3
ByteBuffer::allocContent
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
Definition: ByteBuffer.cpp:45
ByteBuffer::padding
bufsize_t padding
Definition: ByteBuffer.h:26
ByteBuffer::resize
virtual bool resize(bufsize_t newSize)
Definition: ByteBuffer.cpp:57
-
ByteBuffer::m_isResized
bool m_isResized
Definition: ByteBuffer.h:28