IndexSupportasmjit::ArenaString< N >

asmjit::ArenaString< N > Class Template Reference [¶]

template<size_t N>
class asmjit::ArenaString< N >

A string template that can be arena-allocated.

Helps with creating strings that can be either statically allocated if they are small, or externally allocated in case their size exceeds the limit. The N represents the size of the whole ArenaString structure, based on that size the maximum size of the internal buffer is determined.

Public Members

Members

Static Public Attributes

Constants

Member Functions

Construction & Destruction
Accessors

template<size_t N>
bool ArenaString<N>::is_empty() constnodiscardnoexcept[¶]

Tests whether the string is empty.

template<size_t N>
const char* ArenaString<N>::data() constnodiscardnoexcept[¶]

Returns the string data.

template<size_t N>
uint32_t ArenaString<N>::size() constnodiscardnoexcept[¶]

Returns the string size.

template<size_t N>
bool ArenaString<N>::is_embedded() constnodiscardnoexcept[¶]

Tests whether the string is embedded (e.g. no dynamically allocated).

template<size_t N>
Error ArenaString<N>::set_data(
Arena& arena,
const char* data,
size_t size
)noexcept[¶]

Copies a new data of the given size to the string.

If the size exceeds the internal buffer the given arena will be used to duplicate the data, otherwise the internal buffer will be used as a storage.