diff --git a/_byte_buffer_8cpp_source.html b/_byte_buffer_8cpp_source.html index e1c18e7e..9fb70dd0 100644 --- a/_byte_buffer_8cpp_source.html +++ b/_byte_buffer_8cpp_source.html @@ -95,50 +95,50 @@ $(function(){ initResizable(false); }); Go to the documentation of this file.
1#include "ByteBuffer.h"
2#include <iostream>
3
-
4
-
-
5ByteBuffer::ByteBuffer(BYTE *v_content, bufsize_t v_size, bufsize_t v_padding)
-
6 : content(nullptr), contentSize(0), padding(v_padding),
- -
8{
-
9 if (v_size == 0) throw BufferException("Zero size requested");
-
10
-
11 this->content = allocContent(v_size, v_padding);
-
12 if (this->content) {
-
13 this->contentSize = v_size;
-
14 this->originalSize = v_size;
-
15 if (v_content) {
-
16 ::memcpy(this->content, v_content, v_size);
-
17 }
-
18 }
-
19}
+
+ +
5 : ByteBuffer()
+
6{
+
7 if (v_size == 0) throw BufferException("Zero size requested");
+
8
+
9 this->content = allocContent(v_size, v_padding);
+
10 if (this->content) {
+
11 this->padding = v_padding;
+
12 this->contentSize = v_size;
+
13 this->originalSize = v_size;
+
14 }
+
15}
-
20
-
- -
22 : ByteBuffer(nullptr, v_size, v_padding)
-
23{
+
16
+
+
17ByteBuffer::ByteBuffer(BYTE* v_content, bufsize_t v_size, bufsize_t v_padding)
+
18 : ByteBuffer(v_size, v_padding)
+
19{
+
20 if (v_size == 0) throw BufferException("Zero size requested");
+
21 if (this->content && v_content) {
+
22 ::memcpy(this->content, v_content, v_size);
+
23 }
24}
25
- -
27 : content(nullptr), contentSize(0), padding(0),
- -
29{
-
30 if (!v_parent) throw BufferException("Cannot make subBuffer for NULL buffer!");
-
31 if (!v_size) throw BufferException("Cannot make 0 size buffer!");
-
32
-
33 bufsize_t parentSize = v_parent->getContentSize();
-
34
-
35 bufsize_t copySize = v_size < parentSize ? v_size : parentSize;
-
36 bufsize_t allocSize = v_size > parentSize ? v_size : parentSize;
-
37
-
38 BYTE *bContent = v_parent->getContentAt(v_offset, copySize);
-
39 if (!bContent) throw BufferException("Cannot make Buffer for NULL content!");
-
40
-
41 this->content = allocContent(allocSize, v_padding);
-
42 if (this->content) {
+ +
27 : ByteBuffer()
+
28{
+
29 if (!v_parent) throw BufferException("Cannot make subBuffer for NULL buffer!");
+
30 if (!v_size) throw BufferException("Cannot make 0 size buffer!");
+
31
+
32 bufsize_t parentSize = v_parent->getContentSize();
+
33
+
34 bufsize_t copySize = v_size < parentSize ? v_size : parentSize;
+
35 bufsize_t allocSize = v_size > parentSize ? v_size : parentSize;
+
36
+
37 BYTE *bContent = v_parent->getContentAt(v_offset, copySize);
+
38 if (!bContent) throw BufferException("Cannot make Buffer for NULL content!");
+
39
+
40 this->content = allocContent(allocSize, v_padding);
+
41 if (this->content) {
+
42 this->padding = v_padding;
43 this->contentSize = allocSize;
44 this->originalSize = this->contentSize;
45 ::memcpy(this->content, bContent, copySize);
@@ -199,14 +199,14 @@ $(function(){ initResizable(false); });
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
+
bufsize_t originalSize
Definition ByteBuffer.h:32
+
BYTE * content
Definition ByteBuffer.h:28
virtual ~ByteBuffer()
-
bufsize_t contentSize
Definition ByteBuffer.h:25
-
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
+
bufsize_t contentSize
Definition ByteBuffer.h:29
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
-
bufsize_t padding
Definition ByteBuffer.h:26
+
bufsize_t padding
Definition ByteBuffer.h:30
virtual bool resize(bufsize_t newSize)
+