Audacity 3.2.0
|
#include <memorystream.h>
Public Member Functions | |
MemoryStream () | |
MemoryStream (void *memory, TSize memorySize) | |
reuse a given memory without getting ownership More... | |
virtual | ~MemoryStream () |
tresult PLUGIN_API | read (void *buffer, int32 numBytes, int32 *numBytesRead) SMTG_OVERRIDE |
tresult PLUGIN_API | write (void *buffer, int32 numBytes, int32 *numBytesWritten) SMTG_OVERRIDE |
tresult PLUGIN_API | seek (int64 pos, int32 mode, int64 *result) SMTG_OVERRIDE |
tresult PLUGIN_API | tell (int64 *pos) SMTG_OVERRIDE |
TSize | getSize () const |
returns the current memory size More... | |
void | setSize (TSize size) |
set the memory size, a realloc will occur if memory already used More... | |
char * | getData () const |
returns the memory pointer More... | |
char * | detachData () |
returns the memory pointer and give up ownership More... | |
bool | truncate () |
realloc to the current use memory size if needed More... | |
bool | truncateToCursor () |
truncate memory at current cursor position More... | |
Protected Attributes | |
char * | memory |
TSize | memorySize |
TSize | size |
int64 | cursor |
bool | ownMemory |
bool | allocationError |
Memory based Stream for IBStream implementation (using malloc).
Definition at line 47 of file lib-vst3/memorystream.h.
MemoryStream::MemoryStream | ( | ) |
Definition at line 60 of file lib-vst3/memorystream.cpp.
MemoryStream::MemoryStream | ( | void * | memory, |
TSize | memorySize | ||
) |
reuse a given memory without getting ownership
Definition at line 48 of file lib-vst3/memorystream.cpp.
|
virtual |
Definition at line 72 of file lib-vst3/memorystream.cpp.
References staffpad::vo::free(), memory, and ownMemory.
char * MemoryStream::detachData | ( | ) |
returns the memory pointer and give up ownership
Definition at line 267 of file lib-vst3/memorystream.cpp.
References cursor, memory, memorySize, ownMemory, and size.
char * MemoryStream::getData | ( | ) | const |
returns the memory pointer
Definition at line 261 of file lib-vst3/memorystream.cpp.
References memory.
TSize MemoryStream::getSize | ( | ) | const |
returns the current memory size
Definition at line 190 of file lib-vst3/memorystream.cpp.
References size.
tresult PLUGIN_API MemoryStream::read | ( | void * | buffer, |
int32 | numBytes, | ||
int32 * | numBytesRead | ||
) |
Definition at line 81 of file lib-vst3/memorystream.cpp.
References allocationError, cursor, memory, and size.
tresult PLUGIN_API MemoryStream::seek | ( | int64 | pos, |
int32 | mode, | ||
int64 * | result | ||
) |
Definition at line 154 of file lib-vst3/memorystream.cpp.
References cursor, memorySize, ownMemory, and size.
Referenced by VST3Wrapper::InitializeComponents().
void MemoryStream::setSize | ( | TSize | size | ) |
set the memory size, a realloc will occur if memory already used
Definition at line 196 of file lib-vst3/memorystream.cpp.
References allocationError, cursor, staffpad::vo::free(), Steinberg::kMemGrowAmount, memory, memorySize, ownMemory, and size.
Referenced by write().
tresult PLUGIN_API MemoryStream::tell | ( | int64 * | pos | ) |
Definition at line 180 of file lib-vst3/memorystream.cpp.
References cursor.
bool MemoryStream::truncate | ( | ) |
realloc to the current use memory size if needed
Definition at line 282 of file lib-vst3/memorystream.cpp.
References staffpad::vo::free(), memory, memorySize, ownMemory, and size.
Referenced by truncateToCursor().
bool MemoryStream::truncateToCursor | ( | ) |
truncate memory at current cursor position
Definition at line 313 of file lib-vst3/memorystream.cpp.
References cursor, size, and truncate().
tresult PLUGIN_API MemoryStream::write | ( | void * | buffer, |
int32 | numBytes, | ||
int32 * | numBytesWritten | ||
) |
Definition at line 120 of file lib-vst3/memorystream.cpp.
References allocationError, cursor, memory, memorySize, setSize(), and size.
|
protected |
Definition at line 76 of file lib-vst3/memorystream.h.
|
protected |
Definition at line 74 of file lib-vst3/memorystream.h.
Referenced by detachData(), read(), seek(), setSize(), tell(), truncateToCursor(), and write().
|
protected |
Definition at line 71 of file lib-vst3/memorystream.h.
Referenced by detachData(), getData(), read(), setSize(), truncate(), write(), and ~MemoryStream().
|
protected |
Definition at line 72 of file lib-vst3/memorystream.h.
Referenced by detachData(), seek(), setSize(), truncate(), and write().
|
protected |
Definition at line 75 of file lib-vst3/memorystream.h.
Referenced by detachData(), seek(), setSize(), truncate(), and ~MemoryStream().
|
protected |
Definition at line 73 of file lib-vst3/memorystream.h.
Referenced by detachData(), getSize(), read(), seek(), setSize(), truncate(), truncateToCursor(), and write().