15 template<MutableStringType Self>
16 inline void clear(
this Self& self)
noexcept
21 template<MutableStringType Self>
22 inline void push_back(
this Self& self,
typename Self::CharType character)
noexcept
30 if (new_size >= capacity)
38 new_size =
ice::min(new_size, capacity - 1);
42 self.resize(new_size);
43 self.data()[new_size - 1] = character;
46 template<MutableStringType Self>
47 inline void push_back(
this Self& self,
typename Self::CharType
const* cstr)
noexcept
52 template<MutableStringType Self>
53 inline void push_back(
this Self& self, ice::StringType
auto const& other)
noexcept
55 if (other.not_empty())
63 if (new_size + 1 >= capacity)
65 self.grow(new_size + 1);
71 new_size =
ice::min(new_size, capacity - 1);
80 self.resize(new_size);
84 template<MutableStringType Self,
typename... Args>
87 fmt::format_string<Args...> format,
91 ice::ncount const pushed_size = ::fmt::formatted_size(format, std::forward<Args>(args)...);
98 if (final_size >= capacity)
100 self.grow(final_size + 1);
103 ::fmt::format_to_n(self.end(), pushed_size, format, std::forward<Args>(args)...);
108 final_size =
ice::min(final_size, capacity);
110 ice::ncount const allowed_growth = capacity - self.size();
111 if (allowed_growth > 0)
113 ::fmt::format_to_n(self.end(), allowed_growth, format, std::forward<Args>(args)...);
116 self.resize(final_size);
119 template<MutableStringType Self>
122 if (self.data() !=
nullptr)
131 template<MutableStringType Self>
132 constexpr auto begin(
this Self& self)
noexcept ->
typename Self::Iterator
137 template<MutableStringType Self>
138 constexpr auto end(
this Self& self)
noexcept ->
typename Self::Iterator
140 return self.data() + self.size();
143 template<MutableStringType Self>
144 constexpr auto rbegin(
this Self& self)
noexcept ->
typename Self::ReverseIterator
146 return typename Self::ReverseIterator{ self.data() + self.size() };
149 template<MutableStringType Self>
150 constexpr auto rend(
this Self& self)
noexcept ->
typename Self::ReverseIterator
152 return typename Self::ReverseIterator{ self.data() };
157 using ReadOnlyOperations::operator[];
159 template<MutableStringType Self>
162 return self.data()[index.native()];
167 template<MutableStringType Self>
#define ICE_ASSERT_CORE(expression)
Definition assert_core.hxx:43
Definition string_concepts.hxx:33
Definition string_concepts.hxx:42
constexpr auto min(arr_t< Size, T > left, arr_t< Size, U > right) noexcept -> arr_t< Size, T >
Definition array_operations.hxx:60
Definition editable_operations.hxx:9
typename StringT::StringType String
Definition string_concepts.hxx:64
constexpr ice::ualign align_of
Definition mem_info.hxx:15
constexpr auto count(T const (&)[Size]) noexcept -> ice::u32
Definition base.hxx:43
auto memcpy(void *dest, void const *source, ice::usize size) noexcept -> void *
Definition mem_memory.hxx:13
Definition editable_operations.hxx:14
constexpr auto memory_view(this Self &self) noexcept -> ice::Memory
Definition editable_operations.hxx:168
void clear(this Self &self) noexcept
Definition editable_operations.hxx:16
constexpr auto rbegin(this Self &self) noexcept -> typename Self::ReverseIterator
Definition editable_operations.hxx:144
void push_back(this Self &self, typename Self::CharType const *cstr) noexcept
Definition editable_operations.hxx:47
void pop_back(this Self &self, ice::ncount count=1) noexcept
Definition editable_operations.hxx:120
void push_back(this Self &self, ice::StringType auto const &other) noexcept
Definition editable_operations.hxx:53
constexpr auto begin(this Self &self) noexcept -> typename Self::Iterator
Definition editable_operations.hxx:132
constexpr auto end(this Self &self) noexcept -> typename Self::Iterator
Definition editable_operations.hxx:138
constexpr auto rend(this Self &self) noexcept -> typename Self::ReverseIterator
Definition editable_operations.hxx:150
void push_back(this Self &self, typename Self::CharType character) noexcept
Definition editable_operations.hxx:22
constexpr void push_format(this Self &self, fmt::format_string< Args... > format, Args &&... args) noexcept
Definition editable_operations.hxx:85
constexpr auto operator[](this Self &self, ice::nindex index) noexcept -> typename Self::ValueType &
Definition editable_operations.hxx:160
Definition readonly_operations.hxx:14