|
JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins
« « « Anklang Documentation |
#include "fbuffer.h"
Public Types | |
| enum | swapSize { kSwap16 , kSwap32 , kSwap64 } |
Public Member Functions | |
| Buffer () | |
| Default constructor, allocates no memory at all. | |
| Buffer (const void *b, uint32 size) | |
| Constructor - creates a new Buffer with a given size and copies contents from optional memory pointer. | |
| Buffer (uint32 size, uint8 initVal) | |
| Constructor - creates a new Buffer with a given size and fills it all with a given value. | |
| Buffer (uint32 size) | |
| Constructor - creates a new Buffer with a given size. | |
| Buffer (const Buffer &buff) | |
| Copy constructor - creates a new Buffer from a given Buffer. | |
| virtual | ~Buffer () |
| Destructor - deallocates the internal memory. | |
| void | operator= (const Buffer &buff) |
| Assignment operator - copies contents from a given Buffer and increases the size if necessary. | |
| bool | operator== (const Buffer &buff) const |
| Comparison operator - copies contents from a given Buffer and increases the size if necessary. | |
| uint32 | getSize () const |
| bool | setSize (uint32 newSize) |
| Sets a new size for this Buffer, keeping as much content as possible. | |
| bool | grow (uint32 memSize) |
| Increases the Buffer to the next block, block size given by delta. | |
| bool | setMaxSize (uint32 size) |
| see grow() | |
| void | fillup (uint8 initVal=0) |
| set from fillSize to end | |
| uint32 | getFillSize () const |
| bool | setFillSize (uint32 c) |
| sets a new fill size, does not change any memory | |
| void | flush () |
| sets fill size to zero | |
| bool | truncateToFillSize () |
| bool | isFull () const |
| uint32 | getFree () const |
| void | shiftStart (int32 amount) |
| moves all memory by given amount, grows the Buffer if necessary | |
| void | shiftAt (uint32 position, int32 amount) |
| moves memory starting at the given position | |
| void | move (int32 amount, uint8 initVal=0) |
| shifts memory at start without growing the buffer, so data is lost and initialized with init val | |
| bool | copy (uint32 from, uint32 to, uint32 bytes) |
| copies a number of bytes from one position to another, the size may be adapted | |
| uint32 | get (void *b, uint32 size) |
| copy to buffer from fillSize, and shift fillSize | |
| void | setDelta (uint32 d) |
| define the block size by which the Buffer grows, see grow() | |
| bool | put (uint8) |
| append value at end, grows Buffer if necessary | |
| bool | put (char16 c) |
| append value at end, grows Buffer if necessary | |
| bool | put (char c) |
| append value at end, grows Buffer if necessary | |
| bool | put (const void *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (void *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (uint8 *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (char8 *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (const uint8 *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (const char8 *, uint32 size) |
| append bytes from a given buffer, grows Buffer if necessary | |
| bool | put (const String &) |
| append String at end, grows Buffer if necessary | |
| void | set (uint8 value) |
| fills complete Buffer with given value | |
| bool | appendString (const tchar *s) |
| bool | appendString (tchar *s) |
| bool | appendString (tchar c) |
| bool | appendString8 (const char8 *s) |
| bool | appendString16 (const char16 *s) |
| bool | appendString8 (char8 *s) |
| bool | appendString8 (unsigned char *s) |
| bool | appendString8 (const unsigned char *s) |
| bool | appendString8 (char8 c) |
| bool | appendString8 (unsigned char c) |
| bool | appendString16 (char16 c) |
| bool | appendString16 (char16 *s) |
| bool | prependString (const tchar *s) |
| bool | prependString (tchar *s) |
| bool | prependString (tchar c) |
| bool | prependString8 (const char8 *s) |
| bool | prependString16 (const char16 *s) |
| bool | prependString8 (char8 c) |
| bool | prependString8 (unsigned char c) |
| bool | prependString8 (char8 *s) |
| bool | prependString8 (unsigned char *s) |
| bool | prependString8 (const unsigned char *s) |
| bool | prependString16 (char16 c) |
| bool | prependString16 (char16 *s) |
| bool | operator+= (const char *s) |
| bool | operator+= (char c) |
| bool | operator+= (const char16 *s) |
| bool | operator+= (char16 c) |
| bool | operator= (const char *s) |
| bool | operator= (const char16 *s) |
| bool | operator= (char8 c) |
| bool | operator= (char16 c) |
| void | endString () |
| void | endString8 () |
| void | endString16 () |
| bool | makeHexString (String &result) |
| bool | fromHexString (const char8 *string) |
| operator void * () const | |
| conversion | |
| tchar * | str () const |
| conversion | |
| char8 * | str8 () const |
| conversion | |
| char16 * | str16 () const |
| conversion | |
| int8 * | int8Ptr () const |
| conversion | |
| uint8 * | uint8Ptr () const |
| conversion | |
| int16 * | int16Ptr () const |
| conversion | |
| uint16 * | uint16Ptr () const |
| conversion | |
| int32 * | int32Ptr () const |
| conversion | |
| uint32 * | uint32Ptr () const |
| conversion | |
| float * | floatPtr () const |
| conversion | |
| double * | doublePtr () const |
| conversion | |
| char16 * | wcharPtr () const |
| conversion | |
| int8 * | operator+ (uint32 i) |
| int32 | operator! () |
| bool | swap (int16 swapSize) |
| swap all bytes of this Buffer by the given swapSize | |
| void | take (Buffer &from) |
| takes another Buffer's memory, frees the current Buffer's memory | |
| int8 * | pass () |
| pass the current Buffer's memory | |
| virtual bool | toWideString (int32 sourceCodePage) |
| Converts a Buffer's content to UTF-16 from a given multi-byte code page, Buffer must contain char8 of given encoding. | |
| virtual bool | toMultibyteString (int32 destCodePage) |
| Converts a Buffer's content from UTF-16 to a given multi-byte code page, Buffer must contain UTF-16 encoded characters. | |
Static Public Member Functions | |
| static bool | swap (void *buffer, uint32 bufferSize, int16 swapSize) |
| utility, swap given number of bytes in given buffer by the given swapSize | |
Protected Attributes | |
| int8 * | buffer |
| uint32 | memSize |
| uint32 | fillSize |
| uint32 | delta |
Static Protected Attributes | |
| static const uint32 | defaultDelta |
A Buffer is an object-oriented wrapper for a piece of memory. It adds several utility functions, e.g. for managing the size of the Buffer, appending or prepending values or strings to it. Internally it uses the standard memory functions malloc(), free(), etc.
| Steinberg::Buffer::Buffer | ( | ) |
Default constructor, allocates no memory at all.
Definition at line 45 of file fbuffer.cpp.
| Steinberg::Buffer::Buffer | ( | const void * | b, |
| uint32 | size | ||
| ) |
Constructor - creates a new Buffer with a given size and copies contents from optional memory pointer.
| [in] | b | : optional memory pointer with the size of at least the given size |
| [in] | size | : the size of the new Buffer to be allocated, in bytes. |
Definition at line 83 of file fbuffer.cpp.
| Steinberg::Buffer::Buffer | ( | uint32 | size, |
| uint8 | initVal | ||
| ) |
Constructor - creates a new Buffer with a given size and fills it all with a given value.
| [in] | size | : the size of the new Buffer to be allocated, in bytes. |
| [in] | initVal | : the initial value the Buffer will be completely filled with |
Definition at line 53 of file fbuffer.cpp.
| Steinberg::Buffer::Buffer | ( | uint32 | size | ) |
Constructor - creates a new Buffer with a given size.
| [in] | size | : the size of the new Buffer to be allocated, in bytes. |
Definition at line 69 of file fbuffer.cpp.
| Steinberg::Buffer::Buffer | ( | const Buffer & | buff | ) |
Copy constructor - creates a new Buffer from a given Buffer.
| [in] | buff | : the Buffer from which all memory will be copied to the new one |
Definition at line 102 of file fbuffer.cpp.
|
virtual |
Destructor - deallocates the internal memory.
Definition at line 119 of file fbuffer.cpp.
| bool Steinberg::Buffer::appendString16 | ( | const char16 * | s | ) |
Definition at line 218 of file fbuffer.cpp.
| bool Steinberg::Buffer::appendString8 | ( | const char8 * | s | ) |
Definition at line 208 of file fbuffer.cpp.
| bool Steinberg::Buffer::copy | ( | uint32 | from, |
| uint32 | to, | ||
| uint32 | bytes | ||
| ) |
copies a number of bytes from one position to another, the size may be adapted
Definition at line 280 of file fbuffer.cpp.
| double * Steinberg::Buffer::doublePtr | ( | ) | const |
| void Steinberg::Buffer::fillup | ( | uint8 | initVal = 0 | ) |
set from fillSize to end
Definition at line 521 of file fbuffer.cpp.
| bool Steinberg::Buffer::fromHexString | ( | const char8 * | string | ) |
Definition at line 337 of file fbuffer.cpp.
| uint32 Steinberg::Buffer::get | ( | void * | b, |
| uint32 | size | ||
| ) |
copy to buffer from fillSize, and shift fillSize
Definition at line 150 of file fbuffer.cpp.
| uint32 Steinberg::Buffer::getFillSize | ( | ) | const |
| uint32 Steinberg::Buffer::getFree | ( | ) | const |
| uint32 Steinberg::Buffer::getSize | ( | ) | const |
| bool Steinberg::Buffer::grow | ( | uint32 | memSize | ) |
Increases the Buffer to the next block, block size given by delta.
| [in] | memSize | : the new minimum size of the Buffer, newSize maybe zero |
Definition at line 402 of file fbuffer.cpp.
| bool Steinberg::Buffer::isFull | ( | ) | const |
Definition at line 299 of file fbuffer.cpp.
| void Steinberg::Buffer::move | ( | int32 | amount, |
| uint8 | initVal = 0 |
||
| ) |
shifts memory at start without growing the buffer, so data is lost and initialized with init val
Definition at line 441 of file fbuffer.cpp.
| int8 * Steinberg::Buffer::operator+ | ( | uint32 | i | ) |
Definition at line 528 of file fbuffer.cpp.
| void Steinberg::Buffer::operator= | ( | const Buffer & | buff | ) |
Assignment operator - copies contents from a given Buffer and increases the size if necessary.
| [in] | buff | : the Buffer from which all memory will be copied |
Definition at line 127 of file fbuffer.cpp.
Comparison operator - copies contents from a given Buffer and increases the size if necessary.
| [in] | buff | : the Buffer to be compared to |
Definition at line 140 of file fbuffer.cpp.
| int8 * Steinberg::Buffer::pass | ( | ) |
pass the current Buffer's memory
Definition at line 588 of file fbuffer.cpp.
| bool Steinberg::Buffer::prependString16 | ( | char16 | c | ) |
Definition at line 271 of file fbuffer.cpp.
| bool Steinberg::Buffer::prependString16 | ( | const char16 * | s | ) |
Definition at line 244 of file fbuffer.cpp.
| bool Steinberg::Buffer::prependString8 | ( | char8 | c | ) |
Definition at line 262 of file fbuffer.cpp.
| bool Steinberg::Buffer::prependString8 | ( | const char8 * | s | ) |
Definition at line 228 of file fbuffer.cpp.
append value at end, grows Buffer if necessary
Definition at line 178 of file fbuffer.cpp.
| bool Steinberg::Buffer::put | ( | char16 | c | ) |
append value at end, grows Buffer if necessary
Definition at line 162 of file fbuffer.cpp.
| bool Steinberg::Buffer::put | ( | char8 * | p, |
| uint32 | size | ||
| ) |
| bool Steinberg::Buffer::put | ( | const char8 * | p, |
| uint32 | size | ||
| ) |
append String at end, grows Buffer if necessary
Definition at line 202 of file fbuffer.cpp.
| bool Steinberg::Buffer::put | ( | const uint8 * | p, |
| uint32 | size | ||
| ) |
| bool Steinberg::Buffer::put | ( | const void * | toPut, |
| uint32 | size | ||
| ) |
append bytes from a given buffer, grows Buffer if necessary
Definition at line 188 of file fbuffer.cpp.
| bool Steinberg::Buffer::put | ( | uint8 * | p, |
| uint32 | size | ||
| ) |
| bool Steinberg::Buffer::put | ( | uint8 | byte | ) |
append value at end, grows Buffer if necessary
Definition at line 168 of file fbuffer.cpp.
| bool Steinberg::Buffer::put | ( | void * | p, |
| uint32 | size | ||
| ) |
| void Steinberg::Buffer::set | ( | uint8 | value | ) |
fills complete Buffer with given value
Definition at line 375 of file fbuffer.cpp.
| void Steinberg::Buffer::setDelta | ( | uint32 | d | ) |
| bool Steinberg::Buffer::setFillSize | ( | uint32 | c | ) |
sets a new fill size, does not change any memory
Definition at line 382 of file fbuffer.cpp.
| bool Steinberg::Buffer::setMaxSize | ( | uint32 | size | ) |
| bool Steinberg::Buffer::setSize | ( | uint32 | newSize | ) |
Sets a new size for this Buffer, keeping as much content as possible.
| [in] | newSize | : the new size for the Buffer, in bytes, newSize maybe zero |
Definition at line 470 of file fbuffer.cpp.
| void Steinberg::Buffer::shiftAt | ( | uint32 | position, |
| int32 | amount | ||
| ) |
moves memory starting at the given position
Definition at line 415 of file fbuffer.cpp.
| void Steinberg::Buffer::shiftStart | ( | int32 | amount | ) |
| bool Steinberg::Buffer::swap | ( | int16 | swapSize | ) |
swap all bytes of this Buffer by the given swapSize
Definition at line 539 of file fbuffer.cpp.
|
static |
utility, swap given number of bytes in given buffer by the given swapSize
Definition at line 545 of file fbuffer.cpp.
| void Steinberg::Buffer::take | ( | Buffer & | from | ) |
takes another Buffer's memory, frees the current Buffer's memory
Definition at line 576 of file fbuffer.cpp.
|
virtual |
Converts a Buffer's content from UTF-16 to a given multi-byte code page, Buffer must contain UTF-16 encoded characters.
| [in] | destCodePage | : the desired code page to convert the Buffer's content to |
Definition at line 619 of file fbuffer.cpp.
|
virtual |
Converts a Buffer's content to UTF-16 from a given multi-byte code page, Buffer must contain char8 of given encoding.
| [in] | sourceCodePage | : the actual code page of the Buffer's content |
Definition at line 598 of file fbuffer.cpp.
| bool Steinberg::Buffer::truncateToFillSize | ( | ) |
Definition at line 393 of file fbuffer.cpp.
| uint16 * Steinberg::Buffer::uint16Ptr | ( | ) | const |
| uint32 * Steinberg::Buffer::uint32Ptr | ( | ) | const |
|
staticprotected |