31#ifndef ETL_WSTRING_INCLUDED
32#define ETL_WSTRING_INCLUDED
45 inline namespace literals
49 inline constexpr etl::wstring_view operator ""_sv(
const wchar_t* str,
size_t length) ETL_NOEXCEPT
64 template <
size_t MAX_SIZE_>
72 typedef iwstring::value_type value_type;
126 ETL_EXPLICIT_STRING_FROM_CHAR
wstring(
const value_type* text)
138 wstring(
const value_type* text, size_type count)
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 iwstring::value_type value_type;
277 typedef iwstring::size_type size_type;
283 :
iwstring(buffer, buffer_size - 1U)
293 :
iwstring(buffer, buffer_size - 1U)
311 :
iwstring(buffer, buffer_size - 1U)
331 :
iwstring(buffer, buffer_size - 1U)
350 template <
typename TPo
inter>
353 :
iwstring(buffer, buffer_size - 1U)
370 template <
size_t Size>
372 :
iwstring(buffer, buffer_size - 1U)
390 wstring_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
391 :
iwstring(buffer, buffer_size - 1U)
400 this->
assign(text, text + count);
409 wstring_ext(size_type count, value_type
c, value_type* buffer, size_type buffer_size)
410 :
iwstring(buffer, buffer_size - 1U)
421 :
iwstring(buffer, buffer_size - 1U)
440 template <
typename TIterator>
442 :
iwstring(buffer, buffer_size - 1U)
451 this->
assign(first, last);
455#if ETL_HAS_INITIALIZER_LIST
459 wstring_ext(std::initializer_list<value_type>
init, value_type* buffer, size_type buffer_size)
460 :
iwstring(buffer, buffer_size - 1U)
516#if ETL_HAS_ISTRING_REPAIR
517 virtual void repair() ETL_OVERRIDE
535#if ETL_USING_8BIT_TYPES
537 struct hash<
etl::iwstring>
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::wstring<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::wstring_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
wstring_ext(const etl::iwstring &other, value_type *buffer, size_type buffer_size)
Definition wstring.h:310
wstring_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 wstring.h:351
wstring_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition wstring.h:409
wstring_ext(value_type *buffer, size_type buffer_size)
Constructor.
Definition wstring.h:282
wstring_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 wstring.h:441
wstring_ext & operator=(const wstring_ext &rhs)
Assignment operator.
Definition wstring.h:470
wstring_ext(const value_type(&literal)[Size], value_type *buffer, size_type buffer_size)
Definition wstring.h:371
wstring_ext(const etl::wstring_view &view, value_type *buffer, size_type buffer_size)
Definition wstring.h:420
wstring_ext(const etl::iwstring &other, value_type *buffer, size_type buffer_size, size_type position, size_type length=npos)
Definition wstring.h:330
void repair()
Fix the internal pointers after a low level memory copy.
Definition wstring.h:519
wstring_ext(const etl::wstring_ext &other, value_type *buffer, size_type buffer_size)
Definition wstring.h:292
wstring_ext(const value_type *text, size_type count, value_type *buffer, size_type buffer_size)
Definition wstring.h:390
wstring(const value_type *text, size_type count)
Definition wstring.h:138
wstring(const etl::iwstring &other)
Definition wstring.h:100
wstring(const etl::iwstring &other, size_type position, size_type length=npos)
Definition wstring.h:113
wstring(const etl::wstring_view &view)
Definition wstring.h:187
ETL_EXPLICIT_STRING_FROM_CHAR wstring(const value_type *text)
Definition wstring.h:126
wstring & operator=(const wstring &rhs)
Assignment operator.
Definition wstring.h:218
void repair()
Fix the internal pointers after a low level memory copy.
Definition wstring.h:254
wstring(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition wstring.h:164
wstring()
Constructor.
Definition wstring.h:79
wstring(size_type count, value_type c)
Definition wstring.h:150
wstring(const etl::wstring< MAX_SIZE_ > &other)
Definition wstring.h:89
etl::wstring< MAX_SIZE_ > substr(size_type position=0, size_type length_=npos) const
Definition wstring.h:199
#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