nw::ByteArray
-
struct ByteArray
Public Types
-
using Base = Vector<uint8_t>
Public Functions
-
ByteArray() = default
-
ByteArray(const uint8_t *buffer, size_t len)
-
void append(const void *buffer, size_t len)
Appends bytes to the array.
-
inline void clear()
Clears the data in the array.
-
inline uint8_t *data() noexcept
Returns pointer to the underlying array.
-
inline const uint8_t *data() const noexcept
Returns pointer to the underlying array.
-
inline void push_back(uint8_t byte)
Appends one element to the array.
-
bool read_at(size_t offset, void *buffer, size_t size) const
Reads
sizebytes atoffsetinto an arbitrarybuffer
-
inline void resize(size_type count)
Resizes array to contain
countelements. If greater, than current size, null padded.
-
inline std::span<uint8_t> span()
Construct std::span.
-
inline std::span<const uint8_t> span() const
Construct std::span.
-
StringView string_view() const
Constructs string view of the array.
-
bool write_to(const std::filesystem::path &path) const
Write contents to file.
-
using Base = Vector<uint8_t>