iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
IByteGetter Struct Reference

A helper class for IByteChunk and IByteStream that avoids code duplication. More...

#include <IPlugStructs.h>

Inheritance diagram for IByteGetter:
[legend]

Static Public Member Functions

static int GetBytes (const uint8_t *pSrc, int srcSize, void *pDst, int nBytesToCopy, int startPos)
 Copy raw bytes from a byte array, returning the new position for subsequent calls. More...
 
static int GetStr (const uint8_t *pSrc, int srcSize, WDL_String &str, int startPos)
 Get a string from a byte array, to a WDL_String, returning the new position for subsequent calls. More...
 

Detailed Description

A helper class for IByteChunk and IByteStream that avoids code duplication.

Definition at line 64 of file IPlugStructs.h.

Member Function Documentation

◆ GetBytes()

static int IByteGetter::GetBytes ( const uint8_t *  pSrc,
int  srcSize,
void *  pDst,
int  nBytesToCopy,
int  startPos 
)
inlinestatic

Copy raw bytes from a byte array, returning the new position for subsequent calls.

Parameters
pSrcThe source buffer
dstSizeThe size of the source data in bytes
pDstThe destination buffer
nBytesToCopyThe number of bytes to copy from pSrc
startPosThe starting position in bytes in pSrc
Returns
int The end position in bytes after the copy, or -1 if the copy would have copied more data than in the src buffer

Definition at line 73 of file IPlugStructs.h.

Referenced by IByteChunk::GetBytes(), IByteStream::GetBytes(), and GetStr().

◆ GetStr()

static int IByteGetter::GetStr ( const uint8_t *  pSrc,
int  srcSize,
WDL_String &  str,
int  startPos 
)
inlinestatic

Get a string from a byte array, to a WDL_String, returning the new position for subsequent calls.

Parameters
pSrcThe source buffer
dstSizeThe size of the source data in bytes
strWDL_String to fill with the extracted string
startPosThe starting position in bytes in pSrc
Returns
int The end position in bytes after the copy, or -1 if the copy would have copied more data than in the src buffer

Definition at line 90 of file IPlugStructs.h.

References GetBytes().

Referenced by IByteChunk::GetStr(), and IByteStream::GetStr().


The documentation for this struct was generated from the following file: