45 bool initialiseToZero =
false);
55 MemoryBlock (
const void* dataToInitialiseFrom,
size_t sizeInBytes);
75 bool operator== (
const MemoryBlock& other)
const noexcept;
80 bool operator!= (
const MemoryBlock& other)
const noexcept;
83 bool matches (
const void* data,
size_t dataSize)
const noexcept;
98 const void*
getData() const noexcept {
return data; }
103 template <
typename Type>
104 char& operator[] (
const Type offset) noexcept {
return data [offset]; }
107 template <
typename Type>
108 const char& operator[] (
const Type offset)
const noexcept {
return data [offset]; }
111 char*
begin() noexcept {
return data; }
114 const char*
begin() const noexcept {
return data; }
117 char*
end() noexcept {
return begin() + getSize(); }
120 const char*
end() const noexcept {
return begin() + getSize(); }
124 size_t getSize() const noexcept {
return size; }
138 void setSize (
const size_t newSize,
139 bool initialiseNewSpaceToZero =
false);
150 void ensureSize (
const size_t minimumSize,
151 bool initialiseNewSpaceToZero =
false);
160 void fillWith (uint8 valueToUse) noexcept;
165 void append (
const void* data,
size_t numBytes);
170 void replaceWith (
const void* data,
size_t numBytes);
177 void insert (
const void* dataToInsert,
size_t numBytesToInsert,
size_t insertPosition);
186 void removeSection (
size_t startByte,
size_t numBytesToRemove);
196 void copyFrom (
const void* srcData,
197 int destinationOffset,
198 size_t numBytes) noexcept;
207 void copyTo (
void* destData,
209 size_t numBytes)
const noexcept;
229 void loadFromHexString (
StringRef sourceHexString);
233 void setBitRange (
size_t bitRangeStart,
235 int binaryNumberToApply) noexcept;
238 int getBitRange (
size_t bitRangeStart,
239 size_t numBitsToRead)
const noexcept;
253 String toBase64Encoding()
const;
266 bool fromBase64Encoding (
StringRef encodedString);
size_t getSize() const noexcept
const char * begin() const noexcept
const char * end() const noexcept
const void * getData() const noexcept
void * getData() noexcept