![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/ByteBuffer.h>
Specialization of a ByteBufferView that additionally provides non-const access to the underlying data. More...
Specialization of a ByteBufferView that additionally provides non-const access to the underlying data.
This class is usually used as argument type for processing functions that receive an output buffer to write into.
Public Member Functions | |
ByteBufferMutableView ()=default | |
Create an empty (invalid) buffer. | |
ByteBufferMutableView (char *data, size_t size) | |
Create a non-owning buffer of the given size wrapping around the given array. | |
ByteBufferMutableView (std::string &string) | |
Create a new buffer referencing the content from string. | |
ByteBufferMutableView (const ByteBufferMutableView &rhs)=default | |
ByteBufferMutableView (ByteBufferMutableView &&rhs) noexcept=default | |
ByteBufferMutableView & | operator= (const ByteBufferMutableView &rhs)=default |
ByteBufferMutableView & | operator= (ByteBufferMutableView &&rhs) noexcept=default |
ByteBufferMutableView | mutableView () |
Return a mutable view onto this buffer, same effect as calling the copy constructor. | |
ByteBufferMutableView | mutableSubView (size_t offset, size_t size) const |
Create a mutable view onto a subregion of this buffer. | |
char & | operator[] (size_t which) |
const char & | operator[] (size_t which) const |
char * | data () |
Return the pointer to the buffer data. | |
const char * | data () const |
Return the pointer to the buffer data. | |
char * | begin () |
Return iterator to the beginning of the buffer. | |
const char * | begin () const |
Return iterator to the beginning of the buffer. | |
char * | end () |
Return iterator to one past the end of the buffer. | |
const char * | end () const |
Return iterator to one past the end of the buffer. | |
ByteBufferMutableView (ByteBuffer &&rhs)=delete | |
ByteBufferMutableView & | operator= (ByteBuffer &&rhs)=delete |
![]() | |
ByteBufferView ()=default | |
Create an empty (invalid) buffer. | |
ByteBufferView (const char *data, size_t size) | |
Create a non-owning buffer of the given size wrapping around the given array. | |
ByteBufferView (const std::string &string) | |
Create a new buffer referencing the content from string. | |
ByteBufferView (std::string_view string) | |
ByteBufferView (const ByteBufferView &rhs)=default | |
ByteBufferView (ByteBufferView &&rhs) noexcept=default | |
ByteBufferView & | operator= (const ByteBufferView &rhs)=default |
ByteBufferView & | operator= (ByteBufferView &&rhs) noexcept=default |
const char & | operator[] (size_t which) const |
const char * | data () const |
Return the pointer to the buffer data. | |
ByteSize | size () const |
Return the number of bytes stored in the buffer. | |
std::string | toString () |
Copy the data to a new std::string. | |
std::string_view | toStringView () |
Create a std::string_view onto the underlying buffer. | |
bool | isEmpty () const |
Check whether the buffer is empty. | |
ByteBuffer | copy () const |
Create an owning deep copy of this buffer. | |
ByteBuffer | subCopy (size_t offset, size_t size) const |
Create an owning deep copy of a subregion of this buffer. | |
ByteBufferView | view () const |
Return a const view onto this buffer, same effect as calling the copy constructor. | |
ByteBufferView | subView (size_t offset, size_t size) const |
Create a read-only view onto a subregion of this buffer. | |
const char * | begin () const |
Return iterator to the beginning of the buffer. | |
const char * | end () const |
Return iterator to one past the end of the buffer. | |
ByteBufferView (ByteBuffer &&rhs)=delete | |
ByteBufferView & | operator= (ByteBuffer &&rhs)=delete |
Additional Inherited Members | |
![]() | |
char * | m_data = nullptr |
Raw pointer to the buffer data. | |
size_t | m_size = 0 |
Number of bytes stored in m_data. | |
|
explicit |
Create a non-owning buffer of the given size wrapping around the given array.