12 template<
typename CharT =
char>
15 static_assert(
sizeof(CharT) == 1,
"Wider characters are not supported yet!");
40 constexpr
void clear() noexcept;
63 return reinterpret_cast<char*
>(result.
location);
82 template<
typename CharT>
89 template<
typename CharT>
96 template<
typename CharT>
99 ,
_data{ ice::exchange(other._data,
nullptr) }
103 template<
typename CharT>
109 template<
typename CharT>
112 if (
_data !=
nullptr)
118 template<
typename CharT>
124 template<
typename CharT>
130 template<
typename CharT>
136 template<
typename CharT>
147 if (new_str !=
nullptr)
150 new_str[bytes.
value +
size.native()] =
'\0';
158 template<
typename CharT>
166 .size = {
size.bytes() + bytes},
171 template<
typename CharT>
186 template<
typename CharT>
#define ICE_ASSERT_CORE(expression)
Definition assert_core.hxx:43
Definition heap_varstring.hxx:50
auto create(ice::Allocator &alloc, ice::String str) noexcept -> char *
Definition heap_varstring.hxx:66
auto read_data(CharType *data) noexcept -> CharType *
Definition varstring.hxx:86
auto allocate_exact(ice::Allocator &alloc, ice::ncount size, ice::usize &out_bytes) noexcept -> char *
Definition heap_varstring.hxx:52
auto calc_required_size(ice::ncount size) noexcept -> ice::usize
Definition varstring.hxx:48
auto write_size(void *data, ice::ncount size) noexcept -> ice::ncount
Definition varstring.hxx:96
auto read_size(char const *data, ice::usize &out_bytes) noexcept -> ice::ncount
Definition varstring.hxx:60
SPDX-License-Identifier: MIT.
Definition array.hxx:12
ice::BasicString< char > String
Definition string.hxx:82
struct _tagVarString VarStringTag
Definition varstring.hxx:12
auto alloc(ice::usize size) noexcept -> ice::AllocResult
auto ptr_add(void *pointer, ice::usize offset) noexcept -> void *
Definition mem_arithmetic.hxx:34
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition mem_types.hxx:25
@ b_1
Definition mem_size_types.hxx:42
auto memcpy(void *dest, void const *source, ice::usize size) noexcept -> void *
Definition mem_data.hxx:17
Definition heap_varstring.hxx:14
ice::ncount SizeType
Definition heap_varstring.hxx:24
constexpr auto deserialize(ice::Data data) noexcept -> ice::Data
Definition heap_varstring.hxx:137
constexpr HeapVarString(ice::Allocator &alloc) noexcept
Definition heap_varstring.hxx:83
CharType ValueType
Definition heap_varstring.hxx:19
ice::BasicString< CharType > StringType
Definition heap_varstring.hxx:25
constexpr auto size() const noexcept -> SizeType
Definition heap_varstring.hxx:125
std::reverse_iterator< CharType const * > ConstReverseIterator
Definition heap_varstring.hxx:23
CharType * Iterator
Definition heap_varstring.hxx:20
VarStringTag TypeTag
Definition heap_varstring.hxx:17
ValueType * _data
Definition heap_varstring.hxx:28
constexpr auto data() const noexcept -> ValueType *
Definition heap_varstring.hxx:119
std::reverse_iterator< CharType * > ReverseIterator
Definition heap_varstring.hxx:21
ice::Allocator * _allocator
Definition heap_varstring.hxx:27
constexpr ~HeapVarString() noexcept
Definition heap_varstring.hxx:110
constexpr void clear() noexcept
Definition heap_varstring.hxx:131
constexpr auto data_view() const noexcept -> ice::Data
Definition heap_varstring.hxx:159
CharT CharType
Definition heap_varstring.hxx:18
CharType const * ConstIterator
Definition heap_varstring.hxx:22
Definition mem_memory.hxx:13
void * location
Definition mem_memory.hxx:14
Definition varstring.hxx:16
constexpr auto bytes(this ncount self) noexcept -> ice::usize
Definition ncount.hxx:36
constexpr auto native() const noexcept
Definition nvalue.hxx:109
Definition resizable_operations.hxx:13
Represents a unsigned size value on the given platform.
Definition mem_size_types.hxx:26
base_type value
Definition mem_size_types.hxx:35