114 *numBytesRead = numBytes;
124 if (buffer ==
nullptr)
129 if (requiredSize >
size)
148 *numBytesWritten = numBytes;
224 char* newMemory =
nullptr;
228 newMemory = (
char*)realloc (
memory, (
size_t)newMemorySize);
229 if (newMemory ==
nullptr && newMemorySize > 0)
231 newMemory = (
char*)
malloc ((
size_t)newMemorySize);
240 newMemory = (
char*)
malloc ((
size_t)newMemorySize);
242 if (newMemory ==
nullptr)
244 if (newMemorySize > 0)
#define nullptr
Definition DistrhoDefines.h:75
static const FUID iid
Definition ibstream.h:62
@ kIBSeekCur
set seek position relative to current position
Definition ibstream.h:35
@ kIBSeekEnd
set seek position relative to stream end
Definition ibstream.h:36
@ kIBSeekSet
set absolute seek position
Definition ibstream.h:34
Definition memorystream.h:48
bool ownMemory
Definition memorystream.h:75
char * detachData()
returns the memory pointer and give up ownership
Definition memorystream.cpp:267
char * getData() const
returns the memory pointer
Definition memorystream.cpp:261
tresult PLUGIN_API read(void *buffer, int32 numBytes, int32 *numBytesRead) SMTG_OVERRIDE
Definition memorystream.cpp:81
bool truncateToCursor()
truncate memory at current cursor position
Definition memorystream.cpp:313
tresult PLUGIN_API write(void *buffer, int32 numBytes, int32 *numBytesWritten) SMTG_OVERRIDE
Definition memorystream.cpp:120
tresult PLUGIN_API seek(int64 pos, int32 mode, int64 *result) SMTG_OVERRIDE
Definition memorystream.cpp:154
void setSize(TSize size)
set the memory size, a realloc will occur if memory already used
Definition memorystream.cpp:196
TSize size
Definition memorystream.h:73
int64 cursor
Definition memorystream.h:74
TSize getSize() const
returns the current memory size
Definition memorystream.cpp:190
bool truncate()
realloc to the current use memory size if needed
Definition memorystream.cpp:282
char * memory
Definition memorystream.h:71
TSize memorySize
Definition memorystream.h:72
MemoryStream()
Definition memorystream.cpp:60
tresult PLUGIN_API tell(int64 *pos) SMTG_OVERRIDE
Definition memorystream.cpp:180
bool allocationError
Definition memorystream.h:76
virtual ~MemoryStream()
Definition memorystream.cpp:72
unsigned s
Definition inflate.c:1555
#define FUNKNOWN_CTOR
Definition funknown.h:122
#define IMPLEMENT_FUNKNOWN_METHODS(ClassName, InterfaceName, ClassIID)
Definition funknown.h:150
#define FUNKNOWN_DTOR
Definition funknown.h:127
JSAMPIMAGE data
Definition jpeglib.h:945
Definition baseiids.cpp:43
const T & Max(const T &a, const T &b)
Definition futils.h:31
int int32
Definition ftypes.h:50
int64 TSize
Definition ftypes.h:75
@ kInvalidArgument
Definition funknown.h:196
@ kOutOfMemory
Definition funknown.h:200
@ kResultTrue
Definition funknown.h:194
static const TSize kMemGrowAmount
Definition memorystream.cpp:45
long long int64
Definition ftypes.h:66
const T & Min(const T &a, const T &b)
Definition futils.h:25
int32 tresult
Definition ftypes.h:76
#define true
Definition ordinals.h:82
#define false
Definition ordinals.h:83
png_uint_32 length
Definition png.c:2247
png_structrp int mode
Definition png.h:1139
memcpy(hh, h, RAND_HEAD_LEN)
int result
Definition process.c:1455
#define const
Definition zconf.h:137