31#ifndef ETL_U32STRING_INCLUDED
32#define ETL_U32STRING_INCLUDED
45 inline namespace literals
47 inline namespace string_literals
57 typedef ibasic_string<char32_t> iu32string;
64 template <
size_t MAX_SIZE_>
72 typedef iu32string::value_type value_type;
74 static const size_t MAX_SIZE = MAX_SIZE_;
80 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
90 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
100 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
112 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
123 ETL_EXPLICIT_STRING_FROM_CHAR
u32string(
const value_type* text)
124 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
135 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
137 this->
assign(text, text + count);
146 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
158 template <
typename TIterator>
160 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
162 this->
assign(first, last);
165#if ETL_HAS_INITIALIZER_LIST
169 u32string(std::initializer_list<value_type> init)
170 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
172 this->
assign(init.begin(), init.end());
181 :
iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
195 if (position !=
size())
199 length_ = etl::min(length_,
size() - position);
201 new_string.
assign(buffer + position, buffer + position + length_);
234#if ETL_HAS_ISTRING_REPAIR
243 value_type buffer[MAX_SIZE + 1];
257 typedef iu32string::value_type value_type;
306 ETL_EXPLICIT_STRING_FROM_CHAR
u32string_ext(
const value_type* text, value_type* buffer, size_type buffer_size)
325 u32string_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
328 this->
assign(text, text + count);
336 u32string_ext(size_type count, value_type c, value_type* buffer, size_type buffer_size)
349 template <
typename TIterator>
353 this->
assign(first, last);
356#if ETL_HAS_INITIALIZER_LIST
360 u32string_ext(std::initializer_list<value_type> init, value_type* buffer, size_type buffer_size)
363 this->
assign(init.begin(), init.end());
418#if ETL_HAS_ISTRING_REPAIR
435#if ETL_USING_8BIT_TYPES
437 struct hash<
etl::iu32string>
441 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
442 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
446 template <
size_t SIZE>
447 struct hash<
etl::u32string<SIZE> >
451 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
452 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
457 struct hash<
etl::u32string_ext >
461 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
462 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
470 template<
size_t Array_Size>
479 template<
size_t MAX_SIZE,
size_t SIZE>
String view.
Definition: string_view.h:96
ETL_CONSTEXPR const_iterator begin() const
Returns a const iterator to the beginning of the array.
Definition: string_view.h:193
ETL_CONSTEXPR const_iterator end() const
Returns a const iterator to the end of the array.
Definition: string_view.h:209
Definition: basic_string.h:326
void resize(size_type new_size)
Definition: basic_string.h:456
void assign(const etl::ibasic_string< T > &other)
Definition: basic_string.h:626
pointer data()
Definition: basic_string.h:589
void initialise()
Initialise the string.
Definition: basic_string.h:2289
void repair_buffer(T *p_buffer_)
Fix the internal pointers after a low level memory copy.
Definition: basic_string.h:2302
size_type length() const
Definition: basic_string.h:185
size_type current_size
The current number of elements in the string.
Definition: basic_string.h:311
size_type size() const
Definition: basic_string.h:176
Definition: basic_string.h:98
Definition: u32string.h:251
u32string_ext(const value_type *text, size_type count, value_type *buffer, size_type buffer_size)
Definition: u32string.h:325
u32string_ext & operator=(const u32string_ext &rhs)
Assignment operator.
Definition: u32string.h:380
u32string_ext(const etl::u32string_ext &other, value_type *buffer, size_type buffer_size)
Definition: u32string.h:272
u32string_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition: u32string.h:336
void repair()
Fix the internal pointers after a low level memory copy.
Definition: u32string.h:417
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:350
u32string_ext(const etl::u32string_view &view, 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:294
u32string_ext(const etl::iu32string &other, value_type *buffer, size_type buffer_size)
Definition: u32string.h:282
u32string_ext(value_type *buffer, size_type buffer_size)
Constructor.
Definition: u32string.h:262
Definition: u32string.h:66
u32string(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition: u32string.h:159
u32string()
Constructor.
Definition: u32string.h:79
u32string(const etl::u32string_view &view)
Definition: u32string.h:180
u32string(const etl::iu32string &other, size_type position, size_type length=npos)
Definition: u32string.h:111
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:191
void repair()
Fix the internal pointers after a low level memory copy.
Definition: u32string.h:233
u32string(const etl::iu32string &other)
Definition: u32string.h:99
u32string(size_type count, value_type c)
Definition: u32string.h:145
u32string & operator=(const u32string &rhs)
Assignment operator.
Definition: u32string.h:210
u32string(const value_type *text, size_type count)
Definition: u32string.h:134
#define ETL_ASSERT(b, e)
Definition: error_handler.h:316
enable_if
Definition: type_traits_generator.h:1191
is_integral
Definition: type_traits_generator.h:1001
bitset_ext
Definition: absolute.h:38
etl::string< Array_Size - 1U > make_string(const char(&text)[Array_Size])
Hash function.
Definition: string.h:491
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:500
ETL_CONSTEXPR size_t strlen(const T *t)
Alternative strlen for all character types.
Definition: char_traits.h:267
Character traits for any character type.
Definition: char_traits.h:102