31#ifndef ETL_STRING_INCLUDED
32#define ETL_STRING_INCLUDED
47 inline namespace literals
51 inline constexpr etl::string_view operator ""_sv(
const char* str,
size_t length)
noexcept
66 template <
size_t MAX_SIZE_>
74 typedef istring::value_type value_type;
75 typedef istring::size_type size_type;
77 static ETL_CONSTANT
size_t MAX_SIZE =
MAX_SIZE_;
129 ETL_EXPLICIT_STRING_FROM_CHAR
string(
const value_type* text)
141 string(
const value_type* text,
size_t count)
145 this->
assign(text, text + count);
166 template <
typename TIterator>
171 this->
assign(first, last);
174#if ETL_HAS_INITIALIZER_LIST
178 string(std::initializer_list<value_type>
init)
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
typename string<MAX_SIZE_>::size_type string<MAX_SIZE_>::MAX_SIZE;
296 typedef istring::value_type value_type;
297 typedef istring::size_type size_type;
303 :
istring(buffer, buffer_size - 1U)
313 :
istring(buffer, buffer_size - 1U)
324 :
istring(buffer, buffer_size - 1U)
337 :
istring(buffer, buffer_size - 1U)
349 string_ext(
const char* text,
char* buffer, size_type buffer_size)
350 :
istring(buffer, buffer_size - 1U)
369 string_ext(
const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
370 :
istring(buffer, buffer_size - 1U)
373 this->
assign(text, text + count);
381 string_ext(size_type count, value_type
c, value_type* buffer, size_type buffer_size)
382 :
istring(buffer, buffer_size - 1U)
393 :
istring(buffer, buffer_size - 1U)
404 template <
typename TIterator>
406 :
istring(buffer, buffer_size - 1U)
408 this->
assign(first, last);
411#if ETL_HAS_INITIALIZER_LIST
415 string_ext(std::initializer_list<value_type>
init, value_type* buffer, size_type buffer_size)
416 :
istring(buffer, buffer_size - 1U)
471#if ETL_HAS_ISTRING_REPAIR
472 virtual void repair() ETL_OVERRIDE
490#if ETL_USING_8BIT_TYPES
492 struct hash<
etl::istring>
496 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
497 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
501 template <
size_t SIZE>
502 struct hash<
etl::string<SIZE> >
506 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
507 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
512 struct hash<
etl::string_ext>
516 return etl::private_hash::generic_hash<size_t>(
reinterpret_cast<const uint8_t*
>(text.
data()),
517 reinterpret_cast<const uint8_t*
>(text.
data() + text.
size()));
525 template<
size_t Array_Size>
534 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
string_ext(const etl::istring &other, value_type *buffer, size_type buffer_size, size_type position, size_type length=npos)
Definition string.h:336
string_ext(value_type *buffer, size_type buffer_size)
Constructor.
Definition string.h:302
string_ext(const etl::string_ext &other, value_type *buffer, size_type buffer_size)
Definition string.h:312
string_ext(const etl::string_view &view, value_type *buffer, size_type buffer_size)
Definition string.h:392
string_ext(const char *text, char *buffer, size_type buffer_size)
Definition string.h:349
string_ext(size_type count, value_type c, value_type *buffer, size_type buffer_size)
Definition string.h:381
string_ext(const etl::istring &other, value_type *buffer, size_type buffer_size)
Definition string.h:323
void repair()
Fix the internal pointers after a low level memory copy.
Definition string.h:474
string_ext(const value_type *text, size_type count, value_type *buffer, size_type buffer_size)
Definition string.h:369
string_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 string.h:405
string_ext & operator=(const string_ext &rhs)
Assignment operator.
Definition string.h:425
Definition basic_string.h:115
etl::string< MAX_SIZE_ > substr(size_type position=0, size_type length_=npos) const
Definition string.h:202
void repair()
Fix the internal pointers after a low level memory copy.
Definition string.h:271
string()
Constructor.
Definition string.h:82
string(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition string.h:167
string(const etl::string_view &view)
Definition string.h:190
string(const etl::string< MAX_SIZE_ > &other)
Definition string.h:92
string(const etl::istring &other)
Definition string.h:103
string & operator=(const string &rhs)
Assignment operator.
Definition string.h:221
string(const etl::istring &other, size_t position, size_t length=npos)
Definition string.h:116
string(const value_type *text, size_t count)
Definition string.h:141
ETL_EXPLICIT_STRING_FROM_CHAR string(const value_type *text)
Definition string.h:129
string(size_type count, value_type c)
Definition string.h:153
#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