|
| ByteArray (Size bytes=0, const void *pData=nullptr) |
|
| ByteArray (const ByteArray &other) |
|
| ByteArray (ByteArray &&other) |
|
ByteArray & | operator= (const ByteArray &other) |
|
ByteArray & | operator= (ByteArray &&other) |
|
bool | operator== (const ByteArray &rhs) const |
|
bool | operator!= (const ByteArray &rhs) const |
|
Size | getSize (void) const |
|
template<typename T = void*> |
T | getData (void) const |
|
bool | isEmpty (void) const |
|
Context * | getContext (void) const |
|
void | clear (void) |
|
void | acquire (std::pair< Size, void * > data) |
|
auto | release (void) -> std::pair< Size, void * > |
|
template<typename T > |
void | readData (T *pOutData, Size offset=0, Size bytes=sizeof(T)) const |
|
template<typename T > |
void | writeData (const T &pInData, Size offset=0, Size bytes=sizeof(T)) |
|
void | resize (Size bytes) |
|
void | grow (Size bytes) |
|
void | shrink (Size bytes) |
|
void | erase (Size offset, Size bytes) |
|
template<typename T > |
void | insert (const T &dataIn, Size offset=0, Size bytes=sizeof(T)) |
|
template<typename T > |
void | append (const T &dataIn, Size bytes=sizeof(T)) |
|
template<typename T > |
void | prepend (const T &dataIn, Size bytes=sizeof(T)) |
|
|
size_t | size |
|
uint8_t * | pData |
|
GblByteArray * | GblByteArray_create (size_t size, const void *pData, GblContext *pCtx) |
|
GblByteArray * | GblByteArray_ref (GblByteArray *pSelf) |
|
GblRefCount | GblByteArray_unref (GblByteArray *pSelf) |
|
GBL_RESULT | GblByteArray_copy (GblByteArray *pSelf, const GblByteArray *pOther) |
|
GBL_RESULT | GblByteArray_move (GblByteArray *pSelf, GblByteArray *pOther) |
|
GBL_RESULT | GblByteArray_acquire (GblByteArray *pSelf, size_t bytes, void *pData) |
|
GBL_RESULT | GblByteArray_release (GblByteArray *pSelf, size_t *pSize, void **ppData) |
|
int | GblByteArray_compare (const GblByteArray *pSelf, const GblByteArray *pRhs) |
|
GblBool | GblByteArray_equals (const GblByteArray *pSelf, const GblByteArray *pRhs) |
|
GblRefCount | GblByteArray_refCount (const GblByteArray *pSelf) |
|
GblContext * | GblByteArray_context (const GblByteArray *pSelf) |
|
size_t | GblByteArray_size (const GblByteArray *pSelf) |
|
void * | GblByteArray_data (const GblByteArray *pSelf) |
|
GblBool | GblByteArray_empty (const GblByteArray *pSelf) |
|
GblHash | GblByteArray_hash (const GblByteArray *pSelf) |
|
const char * | GblByteArray_cString (const GblByteArray *pSelf) |
|
GblStringView | GblByteArray_stringView (const GblByteArray *pSelf) |
|
uint8_t | GblByteArray_at (const GblByteArray *pSelf, size_t index) |
|
GBL_RESULT | GblByteArray_read (const GblByteArray *pSelf, size_t offset, size_t bytes, void *pOut) |
|
GBL_RESULT | GblByteArray_write (GblByteArray *pSelf, size_t offset, size_t bytes, const void *pIn) |
|
GBL_RESULT | GblByteArray_set (GblByteArray *pSelf, size_t bytes, const void *pData) |
|
GBL_RESULT | GblByteArray_append (GblByteArray *pSelf, size_t bytes, const void *pData) |
|
GBL_RESULT | GblByteArray_prepend (GblByteArray *pSelf, size_t bytes, const void *pData) |
|
GBL_RESULT | GblByteArray_insert (GblByteArray *pSelf, size_t offset, size_t bytes, const void *pData) |
|
GBL_RESULT | GblByteArray_erase (GblByteArray *pSelf, size_t offset, size_t bytes) |
|
GBL_RESULT | GblByteArray_clear (GblByteArray *pSelf) |
|
GBL_RESULT | GblByteArray_resize (GblByteArray *pSelf, size_t bytes) |
|
GBL_RESULT | GblByteArray_grow (GblByteArray *pSelf, size_t bytes) |
|
GBL_RESULT | GblByteArray_shrink (GblByteArray *pSelf, size_t bytes) |
|
Definition at line 11 of file gimbal_byte_array.hpp.
◆ ByteArray() [1/3]
gimbal::ByteArray::ByteArray |
( |
Size |
bytes = 0 , |
|
|
const void * |
pData = nullptr |
|
) |
| |
|
inline |
Definition at line 58 of file gimbal_byte_array.hpp.
58 {
59 Exception::checkThrow(GblByteArray_construct(
this, bytes,
pData));
60}
uint8_t * pData
Actual data payload, contiguously-allocated array of bytes.
◆ ByteArray() [2/3]
gimbal::ByteArray::ByteArray |
( |
const ByteArray & |
other | ) |
|
|
inline |
Definition at line 63 of file gimbal_byte_array.hpp.
63 {
65}
GBL_RESULT GblByteArray_copy(GblByteArray *pSelf, const GblByteArray *pOther)
Frees the existing allocation and copies over the allocation and size from pOther.
◆ ByteArray() [3/3]
gimbal::ByteArray::ByteArray |
( |
ByteArray && |
other | ) |
|
|
inline |
Definition at line 67 of file gimbal_byte_array.hpp.
67 {
69}
GBL_RESULT GblByteArray_move(GblByteArray *pSelf, GblByteArray *pOther)
Frees the existing allocation and takes the allocation from pOther, clearing it.
◆ ~ByteArray()
gimbal::ByteArray::~ByteArray |
( |
void |
| ) |
|
|
inline |
Definition at line 71 of file gimbal_byte_array.hpp.
71 {
72 Exception::checkThrow(GblByteArray_destruct(this));
73}
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool gimbal::ByteArray::operator== |
( |
const ByteArray & |
rhs | ) |
const |
|
inline |
Definition at line 75 of file gimbal_byte_array.hpp.
75 {
77 return !result;
78}
int GblByteArray_compare(const GblByteArray *pSelf, const GblByteArray *pRhs)
Compares the two byte arrays with semantics similar to memcmp(), returning the result.
◆ operator!=()
bool gimbal::ByteArray::operator!= |
( |
const ByteArray & |
rhs | ) |
const |
|
inline |
◆ getSize()
Size gimbal::ByteArray::getSize |
( |
void |
| ) |
const |
|
inline |
Definition at line 95 of file gimbal_byte_array.hpp.
95 {
97}
size_t GblByteArray_size(const GblByteArray *pSelf)
Returns the size of the GblByteArray (GblByteArray::size)
◆ getData()
template<typename T >
T gimbal::ByteArray::getData |
( |
void |
| ) |
const |
|
inline |
Definition at line 100 of file gimbal_byte_array.hpp.
100 {
102}
void * GblByteArray_data(const GblByteArray *pSelf)
Returns the data pointer of the GblByteArray (GblByteArray::pData)
◆ isEmpty()
bool gimbal::ByteArray::isEmpty |
( |
void |
| ) |
const |
|
inline |
◆ clear()
void gimbal::ByteArray::clear |
( |
void |
| ) |
|
|
inline |
Definition at line 108 of file gimbal_byte_array.hpp.
108 {
110}
GBL_RESULT GblByteArray_clear(GblByteArray *pSelf)
Clears all bytes from the given GblByteArray, freeing its allocation and resetting its size to 0.
◆ acquire()
void gimbal::ByteArray::acquire |
( |
std::pair< Size, void * > |
data | ) |
|
|
inline |
Definition at line 112 of file gimbal_byte_array.hpp.
112 {
114}
GBL_RESULT GblByteArray_acquire(GblByteArray *pSelf, size_t bytes, void *pData)
Frees the existing allocation and takes the allocation given by pData with the given size.
◆ release()
auto gimbal::ByteArray::release |
( |
void |
| ) |
-> std::pair<Size, void*> |
|
inline |
Definition at line 116 of file gimbal_byte_array.hpp.
116 {
117 std::pair<Size, void*> retVal;
119 return retVal;
120}
GBL_RESULT GblByteArray_release(GblByteArray *pSelf, size_t *pSize, void **ppData)
Releases the internal allocation resource, copying it and its size out, clearing them from pSelf.
◆ readData()
template<typename T >
void gimbal::ByteArray::readData |
( |
T * |
pOutData, |
|
|
Size |
offset = 0 , |
|
|
Size |
bytes = sizeof(T) |
|
) |
| const |
|
inline |
Definition at line 153 of file gimbal_byte_array.hpp.
153 {
154 Exception::checkThrow(GblByteArray_dataRead(this, offset, bytes, pOutData));
155}
◆ writeData()
template<typename T >
void gimbal::ByteArray::writeData |
( |
const T & |
pInData, |
|
|
Size |
offset = 0 , |
|
|
Size |
bytes = sizeof(T) |
|
) |
| |
|
inline |
Definition at line 158 of file gimbal_byte_array.hpp.
158 {
159 Exception::checkThrow(GblByteArray_dataWrite(this, offset, bytes, &pInData));
160}
◆ resize()
void gimbal::ByteArray::resize |
( |
Size |
bytes | ) |
|
|
inline |
Definition at line 122 of file gimbal_byte_array.hpp.
122 {
124}
GBL_RESULT GblByteArray_resize(GblByteArray *pSelf, size_t bytes)
Resizes the given GblByteArray to a size of bytes, appending byte values of 0 when growing,...
◆ grow()
void gimbal::ByteArray::grow |
( |
Size |
bytes | ) |
|
|
inline |
Definition at line 126 of file gimbal_byte_array.hpp.
126 {
128}
GBL_RESULT GblByteArray_grow(GblByteArray *pSelf, size_t bytes)
Grows the given GblByteArray by the given number of bytes, filling the new ones with 0s,...
◆ shrink()
void gimbal::ByteArray::shrink |
( |
Size |
bytes | ) |
|
|
inline |
Definition at line 130 of file gimbal_byte_array.hpp.
130 {
132}
GBL_RESULT GblByteArray_shrink(GblByteArray *pSelf, size_t bytes)
Shrinks the given GblByteArray by the given number of bytes, returning a status code.
◆ erase()
void gimbal::ByteArray::erase |
( |
Size |
offset, |
|
|
Size |
bytes |
|
) |
| |
|
inline |
Definition at line 134 of file gimbal_byte_array.hpp.
134 {
136}
GBL_RESULT GblByteArray_erase(GblByteArray *pSelf, size_t offset, size_t bytes)
Erases bytes from the given GblByteArray starting at offset, returning a status code.
◆ insert()
template<typename T >
void gimbal::ByteArray::insert |
( |
const T & |
dataIn, |
|
|
Size |
offset = 0 , |
|
|
Size |
bytes = sizeof(T) |
|
) |
| |
|
inline |
Definition at line 139 of file gimbal_byte_array.hpp.
139 {
141}
GBL_RESULT GblByteArray_insert(GblByteArray *pSelf, size_t offset, size_t bytes, const void *pData)
Inserts bytes into the given GblByteArray at offset, copying from pData, returning a status code and ...
◆ append()
template<typename T >
void gimbal::ByteArray::append |
( |
const T & |
dataIn, |
|
|
Size |
bytes = sizeof(T) |
|
) |
| |
|
inline |
Definition at line 144 of file gimbal_byte_array.hpp.
144 {
146}
GBL_RESULT GblByteArray_append(GblByteArray *pSelf, size_t bytes, const void *pData)
Appends bytes from pData to the end of the given GblByteArray, returning a status code.
◆ prepend()
template<typename T >
void gimbal::ByteArray::prepend |
( |
const T & |
dataIn, |
|
|
Size |
bytes = sizeof(T) |
|
) |
| |
|
inline |
Definition at line 149 of file gimbal_byte_array.hpp.
149 {
151}
GBL_RESULT GblByteArray_prepend(GblByteArray *pSelf, size_t bytes, const void *pData)
Prepends bytes from pData to the beginning of the given GblByteArray, returning a status code.
The documentation for this class was generated from the following file: