Acts like std::string_view but for AByteBuffer.
More...
#include <AUI/Common/AByteBufferView.h>
|
| AByteBufferView (const char *buffer, size_t size) noexcept |
|
| AByteBufferView (const std::string &string) noexcept |
|
| AByteBufferView (std::string_view string) noexcept |
|
template<typename T> |
const T & | at (size_t byteIndex) const noexcept |
| Gets value of specified type by byte index relative to the beginning of internal buffer.
|
|
bool | empty () const noexcept |
|
AByteBufferView | slice (std::size_t offset) const noexcept |
|
AByteBufferView | slice (std::size_t offset, std::size_t size) const noexcept |
|
const char * | data () const noexcept |
|
size_t | size () const noexcept |
|
auto | begin () const noexcept |
|
auto | end () const noexcept |
|
AString | toHexString () const |
|
AString | toBase64String () const |
|
template<typename T> |
const T & | as () const |
|
_unique< IInputStream > | toStream () const |
|
|
static AByteBufferView | fromRange (const char *begin, const char *end) noexcept |
|
template<typename T> |
static AByteBufferView | fromRaw (const T &data) noexcept |
|
Acts like std::string_view but for AByteBuffer.
- Note
- don't use const reference of AByteBufferView. Passing by const reference forces compiler to use memory instead of registers.
-
AByteBufferView is intended for const access to memory data. As a function argument, consider to use
std::span<std::byte>
instead for non-const access.
◆ at()
template<typename T>
const T & AByteBufferView::at |
( |
size_t | byteIndex | ) |
const |
|
inlinenoexcept |
Gets value of specified type by byte index relative to the beginning of internal buffer.
- Template Parameters
-
- Parameters
-
byteIndex | byte offset realtive to the beginning of internal buffer |
- Returns
- data
The documentation for this class was generated from the following files:
- aui.core/src/AUI/Common/AByteBufferView.h
- aui.core/src/AUI/Common/AByteBufferBase64.cpp
- aui.core/src/AUI/Common/AByteBufferView.cpp