iPlug 2: IByteStream Class Reference
Manages a non-owned block of memory, for receiving arbitrary message byte streams. More...
#include <IPlugStructs.h>
Public Member Functions | |
| IByteStream (const void *pData, int dataSize) | |
| int | GetBytes (void *pDst, int nBytesToCopy, int startPos) const |
| Copy raw bytes from the stream, returning the new position for subsequent calls. More... | |
| template<class T > | |
| int | Get (T *pDst, int startPos) const |
| Get arbitary typed data from the stream. More... | |
| int | GetStr (WDL_String &str, int startPos) const |
| Get a string from the stream. More... | |
| int | Size () const |
| Returns the size of the stream. More... | |
| bool | IsEqual (IByteStream &otherStream) const |
| Compares the size & values of the data of another stream with this one. More... | |
| const uint8_t * | GetData () |
| Gets a const ptr to the stream data. More... | |
Manages a non-owned block of memory, for receiving arbitrary message byte streams.
Definition at line 267 of file IPlugStructs.h.
|
inline |
◆ ~IByteStream()
|
inline |
◆ Get()
template<class T >
|
inline |
Get arbitary typed data from the stream.
- Template Parameters
-
T The type of data to be extracted
- Parameters
-
pDst Ptr to the destination where the data will be extracted startPos The starting position in bytes in the stream
- Returns
- int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream
Definition at line 289 of file IPlugStructs.h.
References GetBytes().
Referenced by IBMeterControl::OnMsgFromDelegate(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), and IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate().
◆ GetBytes()
|
inline |
Copy raw bytes from the stream, returning the new position for subsequent calls.
- Parameters
-
pDst The destination buffer nBytesToCopy The number of bytes to copy from the stream startPos The starting position in bytes in the stream
- Returns
- int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream
Definition at line 278 of file IPlugStructs.h.
References IByteGetter::GetBytes(), and Size().
Referenced by Get().
◆ GetData()
|
inline |
Gets a const ptr to the stream data.
- Returns
- uint8_t* const ptr to the stream data
Definition at line 320 of file IPlugStructs.h.
◆ GetStr()
|
inline |
Get a string from the stream.
- Parameters
-
str WDL_String to fill startPos The starting position in bytes in the stream
- Returns
- int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream
Definition at line 298 of file IPlugStructs.h.
References IByteGetter::GetStr(), and Size().
◆ IsEqual()
|
inline |
Compares the size & values of the data of another stream with this one.
- Parameters
-
otherChunk The stream to compare with
- Returns
trueif the streams are equal
Definition at line 313 of file IPlugStructs.h.
References Size().
◆ Size()
|
inline |
The documentation for this class was generated from the following file: