49 bool initialiseToZero =
false);
59 MemoryBlock (
const void* dataToInitialiseFrom,
size_t sizeInBytes);
79 bool operator== (
const MemoryBlock& other)
const noexcept;
84 bool operator!= (
const MemoryBlock& other)
const noexcept;
87 bool matches (
const void* data,
size_t dataSize)
const noexcept;
102 const void*
getData() const noexcept {
return data; }
107 template <
typename Type>
108 char& operator[] (
const Type offset) noexcept {
return data [offset]; }
111 template <
typename Type>
112 const char& operator[] (
const Type offset)
const noexcept {
return data [offset]; }
115 char*
begin() noexcept {
return data; }
118 const char*
begin() const noexcept {
return data; }
121 char*
end() noexcept {
return begin() + getSize(); }
124 const char*
end() const noexcept {
return begin() + getSize(); }
128 size_t getSize() const noexcept {
return size; }
142 void setSize (
const size_t newSize,
143 bool initialiseNewSpaceToZero =
false);
154 void ensureSize (
const size_t minimumSize,
155 bool initialiseNewSpaceToZero =
false);
164 void fillWith (uint8 valueToUse) noexcept;
169 void append (
const void* data,
size_t numBytes);
174 void replaceWith (
const void* data,
size_t numBytes);
181 void insert (
const void* dataToInsert,
size_t numBytesToInsert,
size_t insertPosition);
190 void removeSection (
size_t startByte,
size_t numBytesToRemove);
200 void copyFrom (
const void* srcData,
201 int destinationOffset,
202 size_t numBytes) noexcept;
211 void copyTo (
void* destData,
213 size_t numBytes)
const noexcept;
233 void loadFromHexString (
StringRef sourceHexString);
237 void setBitRange (
size_t bitRangeStart,
239 int binaryNumberToApply) noexcept;
242 int getBitRange (
size_t bitRangeStart,
243 size_t numBitsToRead)
const noexcept;
257 String toBase64Encoding()
const;
270 bool fromBase64Encoding (
StringRef encodedString);
size_t getSize() const noexcept
Returns the block's current allocated size, in bytes.
#define JUCE_API
This macro is added to all JUCE public class declarations.
A simple class for holding temporary references to a string literal or String.
char * end() noexcept
Returns an end-iterator for the data.
const char * begin() const noexcept
Returns an iterator for the data.
const char * end() const noexcept
Returns an end-iterator for the data.
const void * getData() const noexcept
Returns a void pointer to the data.
void * getData() noexcept
Returns a void pointer to the data.
A class to hold a resizable block of raw data.
char * begin() noexcept
Returns an iterator for the data.