Classes | Macros | Typedefs | Enumerations | Functions
sbgStreamBufferCommon.h File Reference

Used to read/write data from/to a memory buffer stream. More...

#include <sbgCommon.h>
Include dependency graph for sbgStreamBufferCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SbgStreamBuffer
 

Macros

#define sbgStreamBufferReadBooleanBE   sbgStreamBufferReadBoolean
 
#define sbgStreamBufferReadBooleanLE   sbgStreamBufferReadBoolean
 
#define sbgStreamBufferReadBufferBE   sbgStreamBufferReadBuffer
 
#define sbgStreamBufferReadBufferLE   sbgStreamBufferReadBuffer
 
#define sbgStreamBufferReadDouble   sbgStreamBufferReadDoubleLE
 
#define sbgStreamBufferReadFloat   sbgStreamBufferReadFloatLE
 
#define sbgStreamBufferReadInt16   sbgStreamBufferReadInt16LE
 
#define sbgStreamBufferReadInt24   sbgStreamBufferReadInt24LE
 
#define sbgStreamBufferReadInt32   sbgStreamBufferReadInt32LE
 
#define sbgStreamBufferReadInt40   sbgStreamBufferReadInt40LE
 
#define sbgStreamBufferReadInt48   sbgStreamBufferReadInt48LE
 
#define sbgStreamBufferReadInt56   sbgStreamBufferReadInt56LE
 
#define sbgStreamBufferReadInt64   sbgStreamBufferReadInt64LE
 
#define sbgStreamBufferReadInt8BE   sbgStreamBufferReadInt8
 
#define sbgStreamBufferReadInt8LE   sbgStreamBufferReadInt8
 
#define sbgStreamBufferReadSizeT32   sbgStreamBufferReadSizeT32LE
 
#define sbgStreamBufferReadSizeT64   sbgStreamBufferReadSizeT64LE
 
#define sbgStreamBufferReadString   sbgStreamBufferReadStringLE
 
#define sbgStreamBufferReadUint16   sbgStreamBufferReadUint16LE
 
#define sbgStreamBufferReadUint24   sbgStreamBufferReadUint24LE
 
#define sbgStreamBufferReadUint32   sbgStreamBufferReadUint32LE
 
#define sbgStreamBufferReadUint40   sbgStreamBufferReadUint40LE
 
#define sbgStreamBufferReadUint48   sbgStreamBufferReadUint48LE
 
#define sbgStreamBufferReadUint56   sbgStreamBufferReadUint56LE
 
#define sbgStreamBufferReadUint64   sbgStreamBufferReadUint64LE
 
#define sbgStreamBufferReadUint8BE   sbgStreamBufferReadUint8
 
#define sbgStreamBufferReadUint8LE   sbgStreamBufferReadUint8
 
#define sbgStreamBufferWriteBooleanBE   sbgStreamBufferWriteBoolean
 
#define sbgStreamBufferWriteBooleanLE   sbgStreamBufferWriteBoolean
 
#define sbgStreamBufferWriteBufferBE   sbgStreamBufferWriteBuffer
 
#define sbgStreamBufferWriteBufferLE   sbgStreamBufferWriteBuffer
 
#define sbgStreamBufferWriteDouble   sbgStreamBufferWriteDoubleLE
 
#define sbgStreamBufferWriteFloat   sbgStreamBufferWriteFloatLE
 
#define sbgStreamBufferWriteInt16   sbgStreamBufferWriteInt16LE
 
#define sbgStreamBufferWriteInt24   sbgStreamBufferWriteInt24LE
 
#define sbgStreamBufferWriteInt32   sbgStreamBufferWriteInt32LE
 
#define sbgStreamBufferWriteInt64   sbgStreamBufferWriteInt64LE
 
#define sbgStreamBufferWriteInt8BE   sbgStreamBufferWriteInt8
 
#define sbgStreamBufferWriteInt8LE   sbgStreamBufferWriteInt8
 
#define sbgStreamBufferWriteSizeT32   sbgStreamBufferWriteSizeT32LE
 
#define sbgStreamBufferWriteSizeT64   sbgStreamBufferWriteSizeT64LE
 
#define sbgStreamBufferWriteString   sbgStreamBufferWriteStringLE
 
#define sbgStreamBufferWriteUint16   sbgStreamBufferWriteUint16LE
 
#define sbgStreamBufferWriteUint24   sbgStreamBufferWriteUint24LE
 
#define sbgStreamBufferWriteUint32   sbgStreamBufferWriteUint32LE
 
#define sbgStreamBufferWriteUint64   sbgStreamBufferWriteUint64LE
 
#define sbgStreamBufferWriteUint8BE   sbgStreamBufferWriteUint8
 
#define sbgStreamBufferWriteUint8LE   sbgStreamBufferWriteUint8
 

Typedefs

typedef enum _SbgSBMode SbgSBMode
 
typedef enum _SbgSBSeekOrigin SbgSBSeekOrigin
 
typedef struct _SbgStreamBuffer SbgStreamBuffer
 

Enumerations

enum  _SbgSBMode { SB_MODE_READ, SB_MODE_WRITE }
 
enum  _SbgSBSeekOrigin { SB_SEEK_SET, SB_SEEK_CUR_INC, SB_SEEK_CUR_DEC, SB_SEEK_END }
 

Functions

SBG_INLINE void sbgStreamBufferClearLastError (SbgStreamBuffer *pHandle)
 
SBG_INLINE void * sbgStreamBufferGetCursor (SbgStreamBuffer *pHandle)
 
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError (SbgStreamBuffer *pHandle)
 
SBG_INLINE size_t sbgStreamBufferGetLength (SbgStreamBuffer *pHandle)
 
SBG_INLINE void * sbgStreamBufferGetLinkedBuffer (SbgStreamBuffer *pHandle)
 
SBG_INLINE size_t sbgStreamBufferGetSize (SbgStreamBuffer *pHandle)
 
SBG_INLINE size_t sbgStreamBufferGetSpace (SbgStreamBuffer *pHandle)
 
SBG_INLINE SbgErrorCode sbgStreamBufferInitForRead (SbgStreamBuffer *pHandle, const void *pLinkedBuffer, size_t bufferSize)
 
SBG_INLINE SbgErrorCode sbgStreamBufferInitForWrite (SbgStreamBuffer *pHandle, void *pLinkedBuffer, size_t bufferSize)
 
SBG_INLINE bool sbgStreamBufferReadBoolean (SbgStreamBuffer *pHandle)
 
SBG_INLINE SbgErrorCode sbgStreamBufferReadBuffer (SbgStreamBuffer *pHandle, void *pBuffer, size_t numBytesToRead)
 
SBG_INLINE int8_t sbgStreamBufferReadInt8 (SbgStreamBuffer *pHandle)
 
SBG_INLINE uint8_t sbgStreamBufferReadUint8 (SbgStreamBuffer *pHandle)
 
SBG_INLINE SbgErrorCode sbgStreamBufferSeek (SbgStreamBuffer *pHandle, size_t offset, SbgSBSeekOrigin origin)
 
SBG_INLINE size_t sbgStreamBufferTell (SbgStreamBuffer *pHandle)
 
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBoolean (SbgStreamBuffer *pHandle, bool value)
 
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBuffer (SbgStreamBuffer *pHandle, const void *pBuffer, size_t numBytesToWrite)
 
SBG_INLINE SbgErrorCode sbgStreamBufferWriteInt8 (SbgStreamBuffer *pHandle, int8_t value)
 
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint8 (SbgStreamBuffer *pHandle, uint8_t value)
 

Detailed Description

Used to read/write data from/to a memory buffer stream.

Author
SBG Systems (Raphael Siryani)
Date
02 January 2013

Copyright Notice

Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.

This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

Definition in file sbgStreamBufferCommon.h.

Macro Definition Documentation

◆ sbgStreamBufferReadBooleanBE

#define sbgStreamBufferReadBooleanBE   sbgStreamBufferReadBoolean

Definition at line 153 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadBooleanLE

#define sbgStreamBufferReadBooleanLE   sbgStreamBufferReadBoolean

Definition at line 143 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadBufferBE

#define sbgStreamBufferReadBufferBE   sbgStreamBufferReadBuffer

Definition at line 154 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadBufferLE

#define sbgStreamBufferReadBufferLE   sbgStreamBufferReadBuffer

Definition at line 144 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadDouble

#define sbgStreamBufferReadDouble   sbgStreamBufferReadDoubleLE

Definition at line 113 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadFloat

#define sbgStreamBufferReadFloat   sbgStreamBufferReadFloatLE

Definition at line 112 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt16

#define sbgStreamBufferReadInt16   sbgStreamBufferReadInt16LE

Definition at line 89 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt24

#define sbgStreamBufferReadInt24   sbgStreamBufferReadInt24LE

Definition at line 92 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt32

#define sbgStreamBufferReadInt32   sbgStreamBufferReadInt32LE

Definition at line 95 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt40

#define sbgStreamBufferReadInt40   sbgStreamBufferReadInt40LE

Definition at line 98 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt48

#define sbgStreamBufferReadInt48   sbgStreamBufferReadInt48LE

Definition at line 101 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt56

#define sbgStreamBufferReadInt56   sbgStreamBufferReadInt56LE

Definition at line 104 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt64

#define sbgStreamBufferReadInt64   sbgStreamBufferReadInt64LE

Definition at line 107 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt8BE

#define sbgStreamBufferReadInt8BE   sbgStreamBufferReadInt8

Definition at line 152 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt8LE

#define sbgStreamBufferReadInt8LE   sbgStreamBufferReadInt8

Definition at line 142 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadSizeT32

#define sbgStreamBufferReadSizeT32   sbgStreamBufferReadSizeT32LE

Definition at line 109 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadSizeT64

#define sbgStreamBufferReadSizeT64   sbgStreamBufferReadSizeT64LE

Definition at line 110 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadString

#define sbgStreamBufferReadString   sbgStreamBufferReadStringLE

Definition at line 133 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint16

#define sbgStreamBufferReadUint16   sbgStreamBufferReadUint16LE

The default method should read and write using the platform endianness

The platform is a little endian one so default methods should use little endian byte order.

Definition at line 88 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint24

#define sbgStreamBufferReadUint24   sbgStreamBufferReadUint24LE

Definition at line 91 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint32

#define sbgStreamBufferReadUint32   sbgStreamBufferReadUint32LE

Definition at line 94 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint40

#define sbgStreamBufferReadUint40   sbgStreamBufferReadUint40LE

Definition at line 97 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint48

#define sbgStreamBufferReadUint48   sbgStreamBufferReadUint48LE

Definition at line 100 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint56

#define sbgStreamBufferReadUint56   sbgStreamBufferReadUint56LE

Definition at line 103 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint64

#define sbgStreamBufferReadUint64   sbgStreamBufferReadUint64LE

Definition at line 106 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint8BE

#define sbgStreamBufferReadUint8BE   sbgStreamBufferReadUint8

Definition at line 151 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint8LE

#define sbgStreamBufferReadUint8LE   sbgStreamBufferReadUint8

Some methods are common between big and little endian. This definitions just unify the API.

Definition at line 141 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBooleanBE

#define sbgStreamBufferWriteBooleanBE   sbgStreamBufferWriteBoolean

Definition at line 158 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBooleanLE

#define sbgStreamBufferWriteBooleanLE   sbgStreamBufferWriteBoolean

Definition at line 148 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBufferBE

#define sbgStreamBufferWriteBufferBE   sbgStreamBufferWriteBuffer

Definition at line 159 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBufferLE

#define sbgStreamBufferWriteBufferLE   sbgStreamBufferWriteBuffer

Definition at line 149 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteDouble

#define sbgStreamBufferWriteDouble   sbgStreamBufferWriteDoubleLE

Definition at line 131 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteFloat

#define sbgStreamBufferWriteFloat   sbgStreamBufferWriteFloatLE

Definition at line 130 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt16

#define sbgStreamBufferWriteInt16   sbgStreamBufferWriteInt16LE

Definition at line 116 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt24

#define sbgStreamBufferWriteInt24   sbgStreamBufferWriteInt24LE

Definition at line 119 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt32

#define sbgStreamBufferWriteInt32   sbgStreamBufferWriteInt32LE

Definition at line 122 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt64

#define sbgStreamBufferWriteInt64   sbgStreamBufferWriteInt64LE

Definition at line 125 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt8BE

#define sbgStreamBufferWriteInt8BE   sbgStreamBufferWriteInt8

Definition at line 157 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt8LE

#define sbgStreamBufferWriteInt8LE   sbgStreamBufferWriteInt8

Definition at line 147 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteSizeT32

#define sbgStreamBufferWriteSizeT32   sbgStreamBufferWriteSizeT32LE

Definition at line 127 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteSizeT64

#define sbgStreamBufferWriteSizeT64   sbgStreamBufferWriteSizeT64LE

Definition at line 128 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteString

#define sbgStreamBufferWriteString   sbgStreamBufferWriteStringLE

Definition at line 134 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint16

#define sbgStreamBufferWriteUint16   sbgStreamBufferWriteUint16LE

Definition at line 115 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint24

#define sbgStreamBufferWriteUint24   sbgStreamBufferWriteUint24LE

Definition at line 118 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint32

#define sbgStreamBufferWriteUint32   sbgStreamBufferWriteUint32LE

Definition at line 121 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint64

#define sbgStreamBufferWriteUint64   sbgStreamBufferWriteUint64LE

Definition at line 124 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint8BE

#define sbgStreamBufferWriteUint8BE   sbgStreamBufferWriteUint8

Definition at line 156 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint8LE

#define sbgStreamBufferWriteUint8LE   sbgStreamBufferWriteUint8

Definition at line 146 of file sbgStreamBufferCommon.h.

Typedef Documentation

◆ SbgSBMode

typedef enum _SbgSBMode SbgSBMode

Stream buffer modes.

◆ SbgSBSeekOrigin

Enum used to define all seek modes

◆ SbgStreamBuffer

Defines a stream buffer.

Enumeration Type Documentation

◆ _SbgSBMode

enum _SbgSBMode

Stream buffer modes.

Enumerator
SB_MODE_READ 

This stream buffer can perform read operations.

SB_MODE_WRITE 

This stream buffer can perform write operations.

Definition at line 168 of file sbgStreamBufferCommon.h.

◆ _SbgSBSeekOrigin

Enum used to define all seek modes

Enumerator
SB_SEEK_SET 

The offset is referenced to the begining of the stream.

SB_SEEK_CUR_INC 

The offset is referenced to the current cursor position and increment the current cursor.

SB_SEEK_CUR_DEC 

The offset is referenced to the current cursor position and decrement the current cursor.

SB_SEEK_END 

The offset is referenced to the end of the stream.

Definition at line 177 of file sbgStreamBufferCommon.h.

Function Documentation

◆ sbgStreamBufferClearLastError()

SBG_INLINE void sbgStreamBufferClearLastError ( SbgStreamBuffer pHandle)

Clear the last error code that has occurred on the last stream buffer operation.

Parameters
[in]pHandlePointer to a valid Stream Buffer handle

Definition at line 291 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetCursor()

SBG_INLINE void* sbgStreamBufferGetCursor ( SbgStreamBuffer pHandle)

Returns a pointer on the internal buffer at the current cursor.

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
Pointer on the current cursor of the internal buffer.

Definition at line 482 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetLastError()

SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError ( SbgStreamBuffer pHandle)

Return the error code that has occurred on the last stream buffer operation.

Parameters
[in]pHandlePointer to a valid Stream Buffer handle
Returns
Last stream buffer error code

Definition at line 274 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetLength()

SBG_INLINE size_t sbgStreamBufferGetLength ( SbgStreamBuffer pHandle)

Returns the length in bytes of this stream. The length is computed using the current cursor position. If no data has been read or written, this method will return 0. If 4 uint32_t has been written, it should return 16.

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
The current cursor position in bytes.

Definition at line 333 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetLinkedBuffer()

SBG_INLINE void* sbgStreamBufferGetLinkedBuffer ( SbgStreamBuffer pHandle)

Returns a pointer on the internal buffer.

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
Pointer on the begining of the internal buffer.

Definition at line 467 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetSize()

SBG_INLINE size_t sbgStreamBufferGetSize ( SbgStreamBuffer pHandle)

Returns the size in bytes of this stream. The size is the linked buffer total size in bytes. For example, for a SbgStreamBuffer linked with a buffer of 256 bytes, this method will always returns 256 even if no data has been written or read.

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
The allocated size of the linked buffer in bytes.

Definition at line 312 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferGetSpace()

SBG_INLINE size_t sbgStreamBufferGetSpace ( SbgStreamBuffer pHandle)

Returns the available space in this stream. The available space is just the delta between the linked buffer size and the current buffer length (cursor position).

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
The space available in this stream buffer in bytes.

Definition at line 353 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferInitForRead()

SBG_INLINE SbgErrorCode sbgStreamBufferInitForRead ( SbgStreamBuffer pHandle,
const void *  pLinkedBuffer,
size_t  bufferSize 
)

Initialize a stream buffer for both read and write operations and link it to a buffer.

Parameters
[in]pHandleHandle on an allocated stream buffer.
[in]pLinkedBufferPointer on an allocated buffer to link with this stream.
[in]bufferSizeSize in bytes of the linked buffer.
Returns
SBG_NO_ERROR if the stream buffer has been initialized successfully.

Definition at line 242 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferInitForWrite()

SBG_INLINE SbgErrorCode sbgStreamBufferInitForWrite ( SbgStreamBuffer pHandle,
void *  pLinkedBuffer,
size_t  bufferSize 
)

Initialize a stream buffer for both read and write operations and link it to a buffer.

Parameters
[in]pHandleHandle on an allocated stream buffer.
[in]pLinkedBufferPointer on an allocated buffer to link with this stream.
[in]bufferSizeSize in bytes of the linked buffer.
Returns
SBG_NO_ERROR if the stream buffer has been initialized successfully.

Definition at line 208 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadBoolean()

SBG_INLINE bool sbgStreamBufferReadBoolean ( SbgStreamBuffer pHandle)

Read a boolean from a stream buffer.

Parameters
[in]pHandleValid stream buffer handle that supports read operations.
Returns
The read value or false if we have an error.

Definition at line 585 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadBuffer()

SBG_INLINE SbgErrorCode sbgStreamBufferReadBuffer ( SbgStreamBuffer pHandle,
void *  pBuffer,
size_t  numBytesToRead 
)

Read a buffer from a stream buffer.

Parameters
[in]pHandleValid stream buffer handle that supports read operations.
[out]pBufferAllocated buffer used to hold read data.
[in]numBytesToReadNumber of bytes to read from the stream buffer and to store in pBuffer.
Returns
SBG_NO_ERROR if the data has been read.

Definition at line 636 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadInt8()

SBG_INLINE int8_t sbgStreamBufferReadInt8 ( SbgStreamBuffer pHandle)

Read an int8_t from a stream buffer.

Parameters
[in]pHandleValid stream buffer handle that supports read operations.
Returns
The read value or 0 if we have an error.

Definition at line 501 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferReadUint8()

SBG_INLINE uint8_t sbgStreamBufferReadUint8 ( SbgStreamBuffer pHandle)

Read an uint8_t from a stream buffer.

Parameters
[in]pHandleValid stream buffer handle that supports read operations.
Returns
The read value or 0 if we have an error.

Definition at line 543 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferSeek()

SBG_INLINE SbgErrorCode sbgStreamBufferSeek ( SbgStreamBuffer pHandle,
size_t  offset,
SbgSBSeekOrigin  origin 
)

Move the current cursor position.

Parameters
[in]pHandleValid handle on a stream buffer.
[in]offsetOffset in bytes to apply (only positive).
[in]originOrigin reference point to apply the offset from.
Returns
SBG_NO_ERROR if the stream current cursor position has been moved.

Definition at line 373 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferTell()

SBG_INLINE size_t sbgStreamBufferTell ( SbgStreamBuffer pHandle)

Returns the current offset in bytes from the beginning of the stream.

Parameters
[in]pHandleValid handle on a stream buffer.
Returns
Current offset in bytes from the beginning.

Definition at line 452 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBoolean()

SBG_INLINE SbgErrorCode sbgStreamBufferWriteBoolean ( SbgStreamBuffer pHandle,
bool  value 
)

Write a boolean into a stream buffer

Parameters
[in]pHandleValid stream buffer handle that supports write operations.
[in]valueThe value to write.
Returns
SBG_NO_ERROR if the value has been successfully written.

Definition at line 766 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteBuffer()

SBG_INLINE SbgErrorCode sbgStreamBufferWriteBuffer ( SbgStreamBuffer pHandle,
const void *  pBuffer,
size_t  numBytesToWrite 
)

Write a buffer to a stream buffer.

Parameters
[in]pHandleValid stream buffer handle that supports write operations.
[out]pBufferBuffer to write into the stream buffer.
[in]numBytesToReadNumber of bytes to write to the stream buffer.
Returns
SBG_NO_ERROR if the data has been written.

Definition at line 814 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteInt8()

SBG_INLINE SbgErrorCode sbgStreamBufferWriteInt8 ( SbgStreamBuffer pHandle,
int8_t  value 
)

Write an int8_t into a stream buffer

Parameters
[in]pHandleValid stream buffer handle that supports write operations.
[in]valueThe value to write.
Returns
SBG_NO_ERROR if the value has been successfully written.

Definition at line 686 of file sbgStreamBufferCommon.h.

◆ sbgStreamBufferWriteUint8()

SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint8 ( SbgStreamBuffer pHandle,
uint8_t  value 
)

Write an uint8_t into a stream buffer

Parameters
[in]pHandleValid stream buffer handle that supports write operations.
[in]valueThe value to write.
Returns
SBG_NO_ERROR if the value has been successfully written.

Definition at line 726 of file sbgStreamBufferCommon.h.



sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:36