ImFusion C++ SDK 4.4.0
ImFusion::ByteBufferMutableView Class Reference

#include <ImFusion/Core/ByteBuffer.h>

Specialization of a ByteBufferView that additionally provides non-const access to the underlying data. More...

Inheritance diagram for ImFusion::ByteBufferMutableView:

Detailed Description

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.

See also
ByteBufferStream

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
ByteBufferMutableViewoperator= (const ByteBufferMutableView &rhs)=default
ByteBufferMutableViewoperator= (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
ByteBufferMutableViewoperator= (ByteBuffer &&rhs)=delete
Public Member Functions inherited from ImFusion::ByteBufferView
 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
ByteBufferViewoperator= (const ByteBufferView &rhs)=default
ByteBufferViewoperator= (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 () const
 Copy the data to a new std::string.
std::string_view toStringView () const
 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
ByteBufferViewoperator= (ByteBuffer &&rhs)=delete

Additional Inherited Members

Protected Attributes inherited from ImFusion::ByteBufferView
char * m_data = nullptr
 Raw pointer to the buffer data.
size_t m_size = 0
 Number of bytes stored in m_data.

Constructor & Destructor Documentation

◆ ByteBufferMutableView()

ImFusion::ByteBufferMutableView::ByteBufferMutableView ( char * data,
size_t size )
explicit

Create a non-owning buffer of the given size wrapping around the given array.

Note
data must remain valid for the entire lifetime of this object instance.

The documentation for this class was generated from the following file:
  • ImFusion/Core/ByteBuffer.h
Search Tab / S to search, Esc to close