31#ifndef ETL_U8STRING_INCLUDED
32#define ETL_U8STRING_INCLUDED
47#if ETL_USING_CPP11 && ETL_HAS_NATIVE_CHAR8_T
48 inline namespace literals
52 inline constexpr etl::u8string_view operator ""_sv(
const char8_t* str,
size_t length)
noexcept
67 template <
size_t MAX_SIZE_>
75 typedef iu8string::value_type value_type;
77 static ETL_CONSTANT
size_t MAX_SIZE =
MAX_SIZE_;
129 ETL_EXPLICIT_STRING_FROM_CHAR
u8string(
const value_type* text)
145 this->
assign(text, text + count);
166 template <
typename TIterator>
171 this->
assign(first, last);
174#if ETL_HAS_INITIALIZER_LIST
206 if (position != this->
size())
268#if ETL_HAS_ISTRING_REPAIR
269 virtual void repair() ETL_OVERRIDE
279 value_type buffer[MAX_SIZE + 1];
282 template <
size_t MAX_SIZE_>
283 ETL_CONSTANT
size_t u8string<MAX_SIZE_>::MAX_SIZE;
296 typedef iu8string::value_type value_type;
297 typedef iu8string::size_type size_type;
349 u8string_ext(
const char8_t* text,
char8_t* buffer, size_type buffer_size)
369 u8string_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
373 this->
assign(text, text + count);
381 u8string_ext(size_type count, value_type
c, value_type* buffer, size_type buffer_size)
394 template <
typename TIterator>
399 this->
assign(first, last);
402#if ETL_HAS_INITIALIZER_LIST
406 u8string_ext(std::initializer_list<value_type>
init, value_type* buffer, size_type buffer_size)
474#if ETL_HAS_ISTRING_REPAIR
475 virtual void repair() ETL_OVERRIDE
493#if ETL_USING_8BIT_TYPES
496 struct hash<
etl::iu8string>
500 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
501 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
505 template <
size_t SIZE>
506 struct hash<
etl::u8string<SIZE> >
510 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
511 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
516 struct hash<
etl::u8string_ext>
520 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
521 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
530 template<
size_t Array_Size>
539 template<
size_t MAX_SIZE,
size_t SIZE>
String view.
Definition string_view.h:104
ETL_CONSTEXPR const_iterator begin() const
Returns a const iterator to the beginning of the array.
Definition string_view.h:204
Definition basic_string.h:351
void resize(size_type new_size)
Definition basic_string.h:481
void assign(const etl::ibasic_string< T > &other)
Definition basic_string.h:677
pointer data()
Definition basic_string.h:640
void initialise()
Initialise the string.
Definition basic_string.h:2548
void repair_buffer(T *p_buffer_)
Fix the internal pointers after a low level memory copy.
Definition basic_string.h:2560
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 u8string.h:290
u8string_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 u8string.h:395
u8string_ext(const char8_t *text, char8_t *buffer, size_type buffer_size)
Definition u8string.h:349
u8string_ext & operator=(const u8string_ext &rhs)
Assignment operator.
Definition u8string.h:428
u8string_ext(const etl::u8string_ext &other, value_type *buffer, size_type buffer_size)
Definition u8string.h:312
u8string_ext(const etl::iu8string &other, value_type *buffer, size_type buffer_size, size_type position, size_type length=npos)
Definition u8string.h:336
void repair()
Fix the internal pointers after a low level memory copy.
Definition u8string.h:477
u8string_ext(value_type *buffer, size_type buffer_size)
Constructor.
Definition u8string.h:302
u8string_ext(const value_type *text, size_type count, value_type *buffer, size_type buffer_size)
Definition u8string.h:369
u8string_ext(const etl::iu8string &other, value_type *buffer, size_type buffer_size)
Definition u8string.h:323
u8string_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition u8string.h:381
u8string_ext(const etl::u8string_view &view, value_type *buffer, size_type buffer_size)
Definition u8string.h:418
u8string & operator=(const u8string &rhs)
Assignment operator.
Definition u8string.h:221
u8string(const value_type *text, size_t count)
Definition u8string.h:141
u8string(size_type count, value_type c)
Definition u8string.h:153
void repair()
Fix the internal pointers after a low level memory copy.
Definition u8string.h:271
etl::u8string< MAX_SIZE_ > substr(size_type position=0, size_type length_=npos) const
Definition u8string.h:202
u8string(const etl::u8string_view &view)
Definition u8string.h:190
u8string(const etl::iu8string &other, size_t position, size_t length=npos)
Definition u8string.h:116
u8string(const etl::u8string< MAX_SIZE_ > &other)
Definition u8string.h:92
ETL_EXPLICIT_STRING_FROM_CHAR u8string(const value_type *text)
Definition u8string.h:129
u8string()
Constructor.
Definition u8string.h:82
u8string(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition u8string.h:167
u8string(const etl::iu8string &other)
Definition u8string.h:103
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
enable_if
Definition type_traits_generator.h:1230
is_integral
Definition type_traits_generator.h:1040
bitset_ext
Definition absolute.h:38
etl::string< Array_Size - 1U > make_string(const char(&text)[Array_Size])
Hash function.
Definition string.h:526
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:535
ETL_CONSTEXPR14 size_t strlen(const T *t)
Alternative strlen for all character types.
Definition char_traits.h:287
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314