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
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Steinberg::MemoryStream Class Reference

Memory based Stream for IBStream implementation (using malloc). More...

#include "memorystream.h"

Inheritance diagram for Steinberg::MemoryStream:
Steinberg::IBStream Steinberg::FUnknown

Public Member Functions

 MemoryStream (void *memory, TSize memorySize)
 reuse a given memory without getting ownership
 
tresult PLUGIN_API read (void *buffer, int32 numBytes, int32 *numBytesRead) SMTG_OVERRIDE
 Reads binary data from stream.
 
tresult PLUGIN_API write (void *buffer, int32 numBytes, int32 *numBytesWritten) SMTG_OVERRIDE
 Writes binary data to stream.
 
tresult PLUGIN_API seek (int64 pos, int32 mode, int64 *result) SMTG_OVERRIDE
 Sets stream read-write position.
 
tresult PLUGIN_API tell (int64 *pos) SMTG_OVERRIDE
 Gets current stream read-write position.
 
TSize getSize () const
 returns the current memory size
 
void setSize (TSize size)
 set the memory size, a realloc will occur if memory already used
 
chargetData () const
 returns the memory pointer
 
chardetachData ()
 returns the memory pointer and give up ownership
 
bool truncate ()
 realloc to the current use memory size if needed
 
bool truncateToCursor ()
 truncate memory at current cursor position
 
- Public Member Functions inherited from Steinberg::FUnknown
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void **obj)=0
 Query for a pointer to the specified interface.
 
virtual uint32 PLUGIN_API addRef ()=0
 Adds a reference and returns the new reference count.
 
virtual uint32 PLUGIN_API release ()=0
 Releases a reference and returns the new reference count.
 

Protected Attributes

charmemory
 
TSize memorySize
 
TSize size
 
int64 cursor
 
bool ownMemory
 
bool allocationError
 

Additional Inherited Members

- Public Types inherited from Steinberg::IBStream
enum  IStreamSeekMode { kIBSeekSet , kIBSeekCur , kIBSeekEnd }
 
- Static Public Attributes inherited from Steinberg::IBStream
static const FUID iid
 
- Static Public Attributes inherited from Steinberg::FUnknown
static const FUID iid
 

Detailed Description

Memory based Stream for IBStream implementation (using malloc).

Definition at line 47 of file memorystream.h.

Constructor & Destructor Documentation

◆ MemoryStream() [1/2]

Steinberg::MemoryStream::MemoryStream ( )

Definition at line 60 of file memorystream.cpp.

◆ MemoryStream() [2/2]

Steinberg::MemoryStream::MemoryStream ( void *  memory,
TSize  memorySize 
)

reuse a given memory without getting ownership

Definition at line 48 of file memorystream.cpp.

◆ ~MemoryStream()

Steinberg::MemoryStream::~MemoryStream ( )
virtual

Definition at line 72 of file memorystream.cpp.

Member Function Documentation

◆ detachData()

char * Steinberg::MemoryStream::detachData ( )

returns the memory pointer and give up ownership

Definition at line 267 of file memorystream.cpp.

◆ getData()

char * Steinberg::MemoryStream::getData ( ) const

returns the memory pointer

Definition at line 261 of file memorystream.cpp.

◆ getSize()

TSize Steinberg::MemoryStream::getSize ( ) const

returns the current memory size

Definition at line 190 of file memorystream.cpp.

◆ read()

tresult PLUGIN_API Steinberg::MemoryStream::read ( void *  buffer,
int32  numBytes,
int32 *  numBytesRead 
)
virtual

Reads binary data from stream.

Parameters
buffer: destination buffer
numBytes: amount of bytes to be read
numBytesRead: result - how many bytes have been read from stream (set to 0 if this is of no interest)

Implements Steinberg::IBStream.

Definition at line 81 of file memorystream.cpp.

◆ seek()

tresult PLUGIN_API Steinberg::MemoryStream::seek ( int64  pos,
int32  mode,
int64 *  result 
)
virtual

Sets stream read-write position.

Parameters
pos: new stream position (dependent on mode)
mode: value of enum IStreamSeekMode
result: new seek position (set to 0 if this is of no interest)

Implements Steinberg::IBStream.

Definition at line 154 of file memorystream.cpp.

◆ setSize()

void Steinberg::MemoryStream::setSize ( TSize  size)

set the memory size, a realloc will occur if memory already used

Definition at line 196 of file memorystream.cpp.

◆ tell()

tresult PLUGIN_API Steinberg::MemoryStream::tell ( int64 *  pos)
virtual

Gets current stream read-write position.

Parameters
pos: is assigned the current position if function succeeds

Implements Steinberg::IBStream.

Definition at line 180 of file memorystream.cpp.

◆ truncate()

bool Steinberg::MemoryStream::truncate ( )

realloc to the current use memory size if needed

Definition at line 282 of file memorystream.cpp.

◆ truncateToCursor()

bool Steinberg::MemoryStream::truncateToCursor ( )

truncate memory at current cursor position

Definition at line 313 of file memorystream.cpp.

◆ write()

tresult PLUGIN_API Steinberg::MemoryStream::write ( void *  buffer,
int32  numBytes,
int32 *  numBytesWritten 
)
virtual

Writes binary data to stream.

Parameters
buffer: source buffer
numBytes: amount of bytes to write
numBytesWritten: result - how many bytes have been written to stream (set to 0 if this is of no interest)

Implements Steinberg::IBStream.

Definition at line 120 of file memorystream.cpp.

Member Data Documentation

◆ allocationError

bool Steinberg::MemoryStream::allocationError
protected

Definition at line 76 of file memorystream.h.

◆ cursor

int64 Steinberg::MemoryStream::cursor
protected

Definition at line 74 of file memorystream.h.

◆ memory

char* Steinberg::MemoryStream::memory
protected

Definition at line 71 of file memorystream.h.

◆ memorySize

TSize Steinberg::MemoryStream::memorySize
protected

Definition at line 72 of file memorystream.h.

◆ ownMemory

bool Steinberg::MemoryStream::ownMemory
protected

Definition at line 75 of file memorystream.h.

◆ size

TSize Steinberg::MemoryStream::size
protected

Definition at line 73 of file memorystream.h.


The documentation for this class was generated from the following files: