From e2565676be653172c8bbab322a71579f54db69d0 Mon Sep 17 00:00:00 2001 From: hasherezade Date: Mon, 13 Feb 2023 02:33:32 +0000 Subject: [PATCH] deploy: 437bf2ffae6b83dfa0cd94885bfc5a3690104d62 --- _byte_buffer_8cpp_source.html | 41 ++++++++-------- _byte_buffer_8h_source.html | 10 ++-- class_byte_buffer-members.html | 4 +- class_byte_buffer.html | 12 ++--- functions_m.html | 1 - functions_o.html | 1 + functions_vars.html | 2 +- search/all_b.js | 87 +++++++++++++++++----------------- search/all_d.js | 9 ++-- search/variables_8.js | 21 ++++---- search/variables_a.js | 3 +- 11 files changed, 95 insertions(+), 96 deletions(-) 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
uint32_t bufsize_t
uint64_t offset_t
@@ -174,14 +173,14 @@ $(function() {
virtual bufsize_t getContentSize()=0
virtual BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
+
bufsize_t originalSize
Definition: ByteBuffer.h:28
BYTE * content
Definition: ByteBuffer.h:24
-
virtual ~ByteBuffer()
Definition: ByteBuffer.cpp:84
+
virtual ~ByteBuffer()
Definition: ByteBuffer.cpp:83
bufsize_t contentSize
Definition: ByteBuffer.h:25
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
Definition: ByteBuffer.cpp:3
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
Definition: ByteBuffer.cpp:45
bufsize_t padding
Definition: ByteBuffer.h:26
virtual bool resize(bufsize_t newSize)
Definition: ByteBuffer.cpp:57
-
bool m_isResized
Definition: ByteBuffer.h:28