30 #if !defined(_Blob_h_) 49 Blob(
const uint8_t *data,
unsigned length);
59 void setData(
const uint8_t *data,
unsigned length);
66 void append(
const uint8_t *newData,
unsigned newDataLength);
77 uint8_t *getData() {
return m_data; }
78 const uint8_t *getData()
const {
return m_data; }
79 unsigned getLength()
const {
return m_length; }
84 operator uint8_t *() {
return m_data; }
85 operator const uint8_t *()
const {
return m_data; }
Blob()
Default constructor.
Definition: apps/elftosb/common/Blob.cpp:13
unsigned m_length
Number of bytes pointed to by m_data.
Definition: apps/elftosb/common/Blob.h:66
uint8_t * m_data
The binary data held by this object.
Definition: apps/elftosb/common/Blob.h:65
virtual ~Blob()
Destructor.
Definition: apps/elftosb/common/Blob.cpp:40
void setData(const uint8_t *data, unsigned length)
Replaces the blob's data.
Definition: apps/elftosb/common/Blob.cpp:54
void relinquish()
Tell the blob that it no longer owns its data.
Definition: apps/elftosb/common/Blob.cpp:118
void setLength(unsigned length)
Change the size of the blob's data.
Definition: apps/elftosb/common/Blob.cpp:66
void append(const uint8_t *newData, unsigned newDataLength)
Adds data to the end of the blob.
Definition: apps/elftosb/common/Blob.cpp:98
void clear()
Disposes of the data.
Definition: apps/elftosb/common/Blob.cpp:107
Manages a binary object of arbitrary length.
Definition: apps/elftosb/common/Blob.h:18