31#ifndef ETL_U32STRING_INCLUDED
32#define ETL_U32STRING_INCLUDED
45 inline namespace literals
49 inline constexpr etl::u32string_view operator ""_sv(
const char32_t* str,
size_t length) ETL_NOEXCEPT
64 template <
size_t MAX_SIZE_>
72 typedef iu32string::value_type value_type;
126 ETL_EXPLICIT_STRING_FROM_CHAR
u32string(
const value_type* text)
142 this->
assign(text, text + count);
163 template <
typename TIterator>
168 this->
assign(first, last);
171#if ETL_HAS_INITIALIZER_LIST
203 if (position !=
size())
251#if ETL_HAS_ISTRING_REPAIR
252 virtual void repair() ETL_OVERRIDE
262 value_type buffer[MAX_SIZE + 1];
276 typedef iu32string::value_type value_type;
277 typedef iu32string::size_type size_type;
350 template <
typename TPo
inter>
370 template <
size_t Size>
390 u32string_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
400 this->
assign(text, text + count);
409 u32string_ext(size_type count, value_type
c, value_type* buffer, size_type buffer_size)
440 template <
typename TIterator>
451 this->
assign(first, last);
455#if ETL_HAS_INITIALIZER_LIST
459 u32string_ext(std::initializer_list<value_type>
init, value_type* buffer, size_type buffer_size)
516#if ETL_HAS_ISTRING_REPAIR
517 virtual void repair() ETL_OVERRIDE
535#if ETL_USING_8BIT_TYPES
537 struct hash<
etl::iu32string>
541 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
542 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
546 template <
size_t SIZE>
547 struct hash<
etl::u32string<SIZE> >
551 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
552 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
557 struct hash<
etl::u32string_ext >
561 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
562 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
570 template<
size_t Array_Size>
579 template<
size_t MAX_SIZE,
size_t SIZE>
String view.
Definition string_view.h:104
ETL_CONSTEXPR size_t size() const ETL_NOEXCEPT
Returns the size of the array.
Definition string_view.h:280
ETL_CONSTEXPR const_pointer data() const ETL_NOEXCEPT
Returns a const pointer to the first element of the internal storage.
Definition string_view.h:196
ETL_CONSTEXPR const_iterator begin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the array.
Definition string_view.h:204
Definition basic_string.h:351
bool is_within_buffer(const_pointer ptr) const
Checks if a pointer is within the buffer.
Definition basic_string.h:2718
void resize(size_type new_size)
Definition basic_string.h:481
void assign(const etl::ibasic_string< T > &other)
Definition basic_string.h:683
pointer data()
Definition basic_string.h:646
void initialise()
Initialise the string.
Definition basic_string.h:2491
void repair_buffer(T *p_buffer_)
Fix the internal pointers after a low level memory copy.
Definition basic_string.h:2503
size_type length() const
Definition basic_string.h:202
size_type current_size
The current number of elements in the string.
Definition basic_string.h:336
size_type size() const
Definition basic_string.h:193
Definition basic_string.h:115
Definition u32string.h:270
u32string_ext(TPointer text, value_type *buffer, size_type buffer_size, typename etl::enable_if< etl::is_same< const value_type *, TPointer >::value, int >::type *=ETL_NULLPTR)
Definition u32string.h:351
u32string_ext(const value_type *text, size_type count, value_type *buffer, size_type buffer_size)
Definition u32string.h:390
u32string_ext & operator=(const u32string_ext &rhs)
Assignment operator.
Definition u32string.h:470
u32string_ext(const etl::u32string_ext &other, value_type *buffer, size_type buffer_size)
Definition u32string.h:292
u32string_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition u32string.h:409
void repair()
Fix the internal pointers after a low level memory copy.
Definition u32string.h:519
u32string_ext(TIterator first, TIterator last, value_type *buffer, size_type buffer_size, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition u32string.h:441
u32string_ext(const etl::u32string_view &view, value_type *buffer, size_type buffer_size)
Definition u32string.h:420
u32string_ext(const value_type(&literal)[Size], value_type *buffer, size_type buffer_size)
Definition u32string.h:371
u32string_ext(const etl::iu32string &other, value_type *buffer, size_type buffer_size, size_type position, size_type length=npos)
Definition u32string.h:330
u32string_ext(const etl::iu32string &other, value_type *buffer, size_type buffer_size)
Definition u32string.h:310
u32string_ext(value_type *buffer, size_type buffer_size)
Constructor.
Definition u32string.h:282
Definition u32string.h:66
u32string(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition u32string.h:164
ETL_EXPLICIT_STRING_FROM_CHAR u32string(const value_type *text)
Definition u32string.h:126
u32string()
Constructor.
Definition u32string.h:79
u32string(const etl::u32string_view &view)
Definition u32string.h:187
u32string(const etl::iu32string &other, size_type position, size_type length=npos)
Definition u32string.h:113
u32string(const etl::u32string< MAX_SIZE_ > &other)
Definition u32string.h:89
etl::u32string< MAX_SIZE_ > substr(size_type position=0, size_type length_=npos) const
Definition u32string.h:199
void repair()
Fix the internal pointers after a low level memory copy.
Definition u32string.h:254
u32string(const etl::iu32string &other)
Definition u32string.h:100
u32string(size_type count, value_type c)
Definition u32string.h:150
u32string & operator=(const u32string &rhs)
Assignment operator.
Definition u32string.h:218
u32string(const value_type *text, size_type count)
Definition u32string.h:138
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
ETL_CONSTEXPR17 etl::enable_if<!etl::is_same< T, etl::nullptr_t >::value, T >::type * addressof(T &t)
Definition addressof.h:52
enable_if
Definition type_traits_generator.h:1254
is_integral
Definition type_traits_generator.h:1064
is_same
Definition type_traits_generator.h:1104
bitset_ext
Definition absolute.h:39
etl::string< Array_Size - 1U > make_string(const char(&text)[Array_Size])
Hash function.
Definition string.h:591
etl::string< MAX_SIZE > make_string_with_capacity(const char(&text)[SIZE])
Make string with max capacity from string literal or array.
Definition string.h:600
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:315
ETL_CONSTEXPR14 size_t strlen(const T *t) ETL_NOEXCEPT
Alternative strlen for all character types.
Definition char_traits.h:287