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) ETL_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;
370 template <
typename TPo
inter>
390 template <
size_t Size>
410 u8string_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
420 this->
assign(text, text + count);
429 u8string_ext(size_type count, value_type
c, value_type* buffer, size_type buffer_size)
460 template <
typename TIterator>
471 this->
assign(first, last);
475#if ETL_HAS_INITIALIZER_LIST
479 u8string_ext(std::initializer_list<value_type>
init, value_type* buffer, size_type buffer_size)
536#if ETL_HAS_ISTRING_REPAIR
537 virtual void repair() ETL_OVERRIDE
555#if ETL_USING_8BIT_TYPES
558 struct hash<
etl::iu8string>
562 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
563 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
567 template <
size_t SIZE>
568 struct hash<
etl::u8string<SIZE> >
572 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
573 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
578 struct hash<
etl::u8string_ext>
582 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
583 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
592 template<
size_t Array_Size>
601 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 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:461
u8string_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 u8string.h:371
u8string_ext & operator=(const u8string_ext &rhs)
Assignment operator.
Definition u8string.h:490
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:350
void repair()
Fix the internal pointers after a low level memory copy.
Definition u8string.h:539
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:410
u8string_ext(const etl::iu8string &other, value_type *buffer, size_type buffer_size)
Definition u8string.h:330
u8string_ext(const value_type(&literal)[Size], value_type *buffer, size_type buffer_size)
Definition u8string.h:391
u8string_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition u8string.h:429
u8string_ext(const etl::u8string_view &view, value_type *buffer, size_type buffer_size)
Definition u8string.h:440
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
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