31#ifndef ETL_BASIC_STRING_INCLUDED
32#define ETL_BASIC_STRING_INCLUDED
73 string_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
74 :
exception(reason_, file_name_, line_number_)
87 string_empty(string_type file_name_, numeric_type line_number_)
88 :
string_exception(ETL_ERROR_TEXT(
"string:empty", ETL_BASIC_STRING_FILE_ID
"A"), file_name_, line_number_)
102 :
string_exception(ETL_ERROR_TEXT(
"string:bounds", ETL_BASIC_STRING_FILE_ID
"B"), file_name_, line_number_)
116 :
string_exception(ETL_ERROR_TEXT(
"string:iterator", ETL_BASIC_STRING_FILE_ID
"C"), file_name_, line_number_)
130 :
string_exception(ETL_ERROR_TEXT(
"string:iterator", ETL_BASIC_STRING_FILE_ID
"D"), file_name_, line_number_)
139 namespace private_basic_string
142 template <
typename T =
void>
147 typedef size_t size_type;
155 template <
typename T>
158 template <
typename T>
161 template <
typename T>
170 typedef size_t size_type;
235#if ETL_HAS_STRING_TRUNCATION_CHECKS
265#if ETL_HAS_STRING_CLEAR_AFTER_USE
294#if ETL_HAS_STRING_TRUNCATION_CHECKS
314#if ETL_HAS_STRING_TRUNCATION_CHECKS || ETL_HAS_STRING_CLEAR_AFTER_USE
324 template <
typename T>
331 typedef T value_type;
332 typedef T& reference;
333 typedef const T& const_reference;
335 typedef const T* const_pointer;
337 typedef const T* const_iterator;
338 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
339 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
341 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
374 const_iterator
end()
const
403 return reverse_iterator(
end());
412 return const_reverse_iterator(
end());
421 return reverse_iterator(
begin());
428 const_reverse_iterator
rend()
const
430 return const_reverse_iterator(
begin());
439 return const_reverse_iterator(
cend());
446 const_reverse_iterator
crend()
const
448 return const_reverse_iterator(
cbegin());
470#if ETL_HAS_STRING_TRUNCATION_CHECKS
473#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
479 new_size = etl::min(new_size,
CAPACITY);
484 etl::fill(p_buffer +
current_size, p_buffer + new_size, value);
488 p_buffer[new_size] = 0;
499 new_size = etl::min(new_size,
CAPACITY);
502 p_buffer[new_size] = 0;
531 reference
at(size_type i)
543 const_reference
at(size_type i)
const
630#if ETL_HAS_STRING_TRUNCATION_CHECKS
635#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
641#if ETL_HAS_STRING_CLEAR_AFTER_USE
660 if (sublength == npos)
662 sublength = other.
size() - subposition;
669#if ETL_HAS_STRING_TRUNCATION_CHECKS
674#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
680#if ETL_HAS_STRING_CLEAR_AFTER_USE
702#if ETL_HAS_STRING_TRUNCATION_CHECKS
705#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
719 void assign(const_pointer other, size_type length_)
723#if ETL_HAS_STRING_TRUNCATION_CHECKS
726#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
731 length_ = etl::min(length_,
CAPACITY);
733 etl::copy_n(other, length_,
begin());
746 template <
typename TIterator>
747 void assign(TIterator first, TIterator last)
749#if ETL_IS_DEBUG_BUILD
750 difference_type d = etl::distance(first, last);
763#if ETL_HAS_STRING_TRUNCATION_CHECKS
766#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
782#if ETL_HAS_STRING_TRUNCATION_CHECKS
785#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
792 etl::fill_n(
begin(), n, value);
819#if ETL_HAS_STRING_TRUNCATION_CHECKS
822#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
849#if ETL_HAS_STRING_TRUNCATION_CHECKS
854#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
915 template <
class TIterator>
927 iterator
insert(const_iterator position, T value)
935 if (position !=
end())
939 etl::copy_backward(insert_position,
end() - 1,
end());
940 *insert_position = value;
945 *insert_position = value;
952 if (position !=
end())
955 etl::copy_backward(insert_position,
end() - 1,
end());
956 *insert_position = value;
959#if ETL_HAS_STRING_TRUNCATION_CHECKS
962#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
970 return insert_position;
979 iterator
insert(const_iterator position, size_type n, T value)
990 const size_type start = etl::distance(
cbegin(), position);
995#if ETL_HAS_STRING_TRUNCATION_CHECKS
998#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1010#if ETL_HAS_STRING_TRUNCATION_CHECKS
1013#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1020 etl::fill(insert_position,
end(), value);
1025 const size_type shift_amount = n;
1026 const size_type to_position = start + shift_amount;
1027 const size_type remaining_characters =
current_size - start;
1028 const size_type max_shift_characters =
CAPACITY - start - shift_amount;
1029 const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
1032 if ((start + shift_amount + remaining_characters) >
CAPACITY)
1036#if ETL_HAS_STRING_TRUNCATION_CHECKS
1039#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1049 etl::copy_backward(insert_position, insert_position + characters_to_shift,
begin() + to_position + characters_to_shift);
1050 etl::fill(insert_position, insert_position + shift_amount, value);
1065 template <
typename TIterator>
1066 iterator
insert(const_iterator position, TIterator first, TIterator last)
1075 const size_type start = etl::distance(
begin(), position_);
1076 const size_type n = etl::distance(first, last);
1081#if ETL_HAS_STRING_TRUNCATION_CHECKS
1084#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1096#if ETL_HAS_STRING_TRUNCATION_CHECKS
1099#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1107 while (position_ !=
end())
1109 *position_++ = *first++;
1115 const size_type shift_amount = n;
1116 const size_type to_position = start + shift_amount;
1117 const size_type remaining_characters =
current_size - start;
1118 const size_type max_shift_characters =
CAPACITY - start - shift_amount;
1119 const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
1122 if ((start + shift_amount + remaining_characters) >
CAPACITY)
1126#if ETL_HAS_STRING_TRUNCATION_CHECKS
1129#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1139 etl::copy_backward(position_, position_ + characters_to_shift,
begin() + to_position + characters_to_shift);
1141 while (first != last)
1143 *position_++ = *first++;
1163#if ETL_HAS_STRING_TRUNCATION_CHECKS
1168#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1189 if ((sublength == npos) || (subposition + sublength > str.
size()))
1191 sublength = str.
size() - subposition;
1196#if ETL_HAS_STRING_TRUNCATION_CHECKS
1201#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1260 length_ = etl::min(length_,
size() - position);
1274 etl::copy(i_element + 1,
end(), i_element);
1285 iterator
erase(const_iterator i_element)
1289 etl::copy(i_element_ + 1,
end(), i_element_);
1303 iterator
erase(const_iterator first, const_iterator last)
1308 if (first_ == last_)
1313 etl::copy(last_,
end(), first_);
1314 size_type n_delete = etl::distance(first_, last_);
1337 size_type
copy(pointer dest, size_type count, size_type pos = 0)
const
1343 count = etl::min(count,
size() - pos);
1347 count =
size() - pos;
1350 etl::copy_n(p_buffer + pos, count, dest);
1372 const_iterator iposition = etl::search(
begin() + pos,
end(), str.
begin(), str.
end());
1374 if (iposition ==
end())
1380 return etl::distance(
begin(), iposition);
1389 size_type
find(const_pointer s, size_type pos = 0)
const
1391#if ETL_IS_DEBUG_BUILD
1400 if (iposition ==
end())
1406 return etl::distance(
begin(), iposition);
1416 size_type
find(const_pointer s, size_type pos, size_type n)
const
1418#if ETL_IS_DEBUG_BUILD
1425 const_iterator iposition = etl::search(
begin() + pos,
end(), s, s + n);
1427 if (iposition ==
end())
1433 return etl::distance(
begin(), iposition);
1442 size_type
find(T c, size_type position = 0)
const
1444 const_iterator i = etl::find(
begin() + position,
end(), c);
1448 return etl::distance(
begin(), i);
1468 if (position >=
size())
1473 position =
size() - position;
1475 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), str.
rbegin(), str.
rend());
1477 if (iposition ==
rend())
1492 size_type
rfind(const_pointer s, size_type position = npos)
const
1501 if (position >=
size())
1506 position =
size() - position;
1508 const_reverse_iterator srbegin(s + len);
1509 const_reverse_iterator srend(s);
1511 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), srbegin, srend);
1513 if (iposition ==
rend())
1519 return size() - len - etl::distance(
rbegin(), iposition);
1528 size_type
rfind(const_pointer s, size_type position, size_type length_)
const
1530 if (length_ >
size())
1535 if (position >=
size())
1540 position =
size() - position;
1542 const_reverse_iterator srbegin(s + length_);
1543 const_reverse_iterator srend(s);
1545 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), srbegin, srend);
1547 if (iposition ==
rend())
1553 return size() - length_ - etl::distance(
rbegin(), iposition);
1562 size_type
rfind(T c, size_type position = npos)
const
1564 if (position >=
size())
1569 position =
size() - position;
1571 const_reverse_iterator i = etl::find(
rbegin() + position,
rend(), c);
1575 return size() - etl::distance(
rbegin(), i) - 1;
1594 length_ = etl::min(length_,
size() - position);
1597 erase(position, length_);
1618 erase(first_, last_);
1623#if ETL_HAS_STRING_TRUNCATION_CHECKS
1628#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1646 length_ = etl::min(length_,
size() - position);
1647 sublength = etl::min(sublength, str.
size() - subposition);
1650 erase(position, length_);
1653 insert(position, str, subposition, sublength);
1655#if ETL_HAS_STRING_TRUNCATION_CHECKS
1660#if ETL_HAS_ERROR_ON_STRING_TRUNCATION
1677 length_ = etl::min(length_,
size() - position);
1680 erase(position, length_);
1698 erase(first_, last_);
1714 length_ = etl::min(length_,
size() - position);
1717 erase(position, length_);
1735 erase(first_, last_);
1738 insert(first_, s, s + n);
1751 length_ = etl::min(length_,
size() - position);
1754 erase(position, length_);
1772 erase(first_, last_);
1783 template <
typename TIterator>
1791 erase(first_, last_);
1794 insert(first_, first_replace, last_replace);
1807 str.p_buffer + str.
size());
1818 length_ = etl::min(length_,
size() - position);
1820 return compare(p_buffer + position,
1821 p_buffer + position + length_,
1823 str.p_buffer + str.
size());
1829 int compare(size_type position, size_type length_,
const ibasic_string& str, size_type subposition, size_type sublength)
const
1835 length_ = etl::min(length_,
size() - position);
1836 sublength = etl::min(sublength, str.
size() - subposition);
1838 return compare(p_buffer + position,
1839 p_buffer + position + length_,
1840 str.p_buffer + subposition,
1841 str.p_buffer + subposition + sublength);
1858 int compare(size_type position, size_type length_, const_pointer s)
const
1860 return compare(p_buffer + position,
1861 p_buffer + position + length_,
1869 int compare(size_type position, size_type length_, const_pointer s, size_type n)
const
1871 return compare(p_buffer + position,
1872 p_buffer + position + length_,
1905 if (position <
size())
1907 for (size_type i = position; i <
size(); ++i)
1909 for (size_type j = 0; j < n; ++j)
1911 if (p_buffer[i] == s[j])
1929 if (position <
size())
1931 for (size_type i = position; i <
size(); ++i)
1933 if (p_buffer[i] == c)
1969 size_type
find_last_of(const_pointer s, size_type position, size_type n)
const
1976 position = etl::min(position,
size() - 1);
1978 const_reverse_iterator it =
rbegin() +
size() - position - 1;
1980 while (it !=
rend())
1982 for (size_type j = 0; j < n; ++j)
1984 if (p_buffer[position] == s[j])
2009 position = etl::min(position,
size() - 1);
2011 const_reverse_iterator it =
rbegin() +
size() - position - 1;
2013 while (it !=
rend())
2015 if (p_buffer[position] == c)
2055 if (position <
size())
2057 for (size_type i = position; i <
size(); ++i)
2061 for (size_type j = 0; j < n; ++j)
2063 if (p_buffer[i] == s[j])
2086 if (position <
size())
2088 for (size_type i = position; i <
size(); ++i)
2090 if (p_buffer[i] != c)
2133 position = etl::min(position,
size() - 1);
2135 const_reverse_iterator it =
rbegin() +
size() - position - 1;
2137 while (it !=
rend())
2141 for (size_type j = 0; j < n; ++j)
2143 if (p_buffer[position] == s[j])
2171 position = etl::min(position,
size() - 1);
2173 const_reverse_iterator it =
rbegin() +
size() - position - 1;
2175 while (it !=
rend())
2177 if (p_buffer[position] != c)
2237 append(size_type(1), rhs);
2242#if ETL_HAS_ISTRING_REPAIR
2246 virtual void repair() = 0;
2254#if ETL_HAS_STRING_TRUNCATION_CHECKS
2267#if ETL_HAS_STRING_TRUNCATION_CHECKS
2294#if ETL_HAS_STRING_TRUNCATION_CHECKS
2304 p_buffer = p_buffer_;
2312 int compare(const_pointer first1, const_pointer last1, const_pointer first2, const_pointer last2)
const
2314 while ((first1 != last1) && (first2 != last2))
2316 if (*first1 < *first2)
2321 else if (*first1 > *first2)
2332 if ((first1 == last1) && (first2 == last2))
2337 else if (first1 == last1)
2354#if ETL_HAS_STRING_CLEAR_AFTER_USE
2375#if defined(ETL_POLYMORPHIC_STRINGS) || defined(ETL_POLYMORPHIC_CONTAINERS) || defined(ETL_ISTRING_REPAIR_ENABLE)
2383#if ETL_HAS_STRING_CLEAR_AFTER_USE
2398 return const_cast<iterator
>(itr);
2409 template <
typename T>
2422 template <
typename T>
2435 template <
typename T>
2448 template <
typename T>
2451 return !(lhs == rhs);
2461 template <
typename T>
2464 return !(lhs == rhs);
2474 template <
typename T>
2477 return !(lhs == rhs);
2487 template <
typename T>
2490 return etl::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end());
2500 template <
typename T>
2513 template <
typename T>
2527 template <
typename T>
2540 template <
typename T>
2553 template <
typename T>
2567 template <
typename T>
2570 return !(lhs > rhs);
2580 template <
typename T>
2583 return !(lhs > rhs);
2593 template <
typename T>
2596 return !(lhs > rhs);
2607 template <
typename T>
2610 return !(lhs < rhs);
2620 template <
typename T>
2623 return !(lhs < rhs);
2633 template <
typename T>
2636 return !(lhs < rhs);
ETL_CONSTEXPR14 flags< T, MASK > & set() ETL_NOEXCEPT
Set the bits.
Definition: flags.h:102
ETL_CONSTEXPR bool test() const ETL_NOEXCEPT
Tests bits.
Definition: flags.h:87
Definition: basic_string.h:326
int compare(size_type position, size_type length_, const ibasic_string &str) const
Compare position / length with string.
Definition: basic_string.h:1813
ibasic_string & append(TIterator first, TIterator last)
Definition: basic_string.h:916
size_type find_last_of(const_pointer s, size_type position=npos) const
Definition: basic_string.h:1958
size_type rfind(const_pointer s, size_type position=npos) const
Definition: basic_string.h:1492
etl::ibasic_string< T > & insert(size_type position, const etl::ibasic_string< T > &str)
Definition: basic_string.h:1157
ibasic_string & append(const T *str)
Definition: basic_string.h:882
size_type find_last_not_of(const_pointer s, size_type position=npos) const
Definition: basic_string.h:2115
size_type find(const_pointer s, size_type pos=0) const
Definition: basic_string.h:1389
ibasic_string & operator=(const ibasic_string &rhs)
Assignment operator.
Definition: basic_string.h:2192
ibasic_string & append(const ibasic_string &str, size_type subposition, size_type sublength=npos)
Definition: basic_string.h:869
const_reverse_iterator rbegin() const
Definition: basic_string.h:410
reference operator[](size_type i)
Definition: basic_string.h:510
void assign(const etl::ibasic_string< T > &other, size_type subposition, size_type sublength)
Definition: basic_string.h:658
pointer data_end()
Definition: basic_string.h:607
iterator erase(const_iterator first, const_iterator last)
Definition: basic_string.h:1303
iterator insert(const_iterator position, TIterator first, TIterator last)
Definition: basic_string.h:1066
size_type find_last_of(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:1948
size_type find_first_of(value_type c, size_type position=0) const
Definition: basic_string.h:1927
size_type find(T c, size_type position=0) const
Definition: basic_string.h:1442
void pop_back()
Definition: basic_string.h:833
size_type rfind(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:1461
void initialize_free_space()
Clears the free space to string terminator value.
Definition: basic_string.h:2252
ibasic_string & replace(size_type position, size_type length_, const_pointer s, size_type n)
Replace characters from 'position' of 'length' with 'n' characters from pointed to string.
Definition: basic_string.h:1709
iterator to_iterator(const_iterator itr) const
Convert from const_iterator to iterator.
Definition: basic_string.h:2396
ibasic_string & replace(size_type position, size_type length_, size_type n, value_type c)
Replace characters from 'position' of 'length' with 'n' copies of 'c'.
Definition: basic_string.h:1746
ibasic_string & replace(const_iterator first, const_iterator last, const ibasic_string &str)
Definition: basic_string.h:1611
size_type find_first_of(const ibasic_string< T > &str, size_type position=0) const
Definition: basic_string.h:1882
const_reference back() const
Definition: basic_string.h:580
const_iterator begin() const
Definition: basic_string.h:356
const_pointer data() const
Definition: basic_string.h:598
size_type find_last_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:1969
reverse_iterator rbegin()
Definition: basic_string.h:401
ibasic_string & replace(const_iterator first, const_iterator last, TIterator first_replace, TIterator last_replace)
Replace characters from 'first' of 'last' with characters from 'first_replace' to 'last_replace'.
Definition: basic_string.h:1784
void resize(size_type new_size)
Definition: basic_string.h:456
size_type find_last_not_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:2126
size_type find_first_not_of(const_pointer s, size_type position=0) const
Definition: basic_string.h:2042
size_type rfind(T c, size_type position=npos) const
Definition: basic_string.h:1562
etl::ibasic_string< T > & erase(size_type position, size_type length_=npos)
Definition: basic_string.h:1257
int compare(const value_type *s) const
Compare with C string.
Definition: basic_string.h:1847
int compare(size_type position, size_type length_, const_pointer s) const
Compare position / length with C string.
Definition: basic_string.h:1858
iterator insert(const_iterator position, size_type n, T value)
Definition: basic_string.h:979
const_reference at(size_type i) const
Definition: basic_string.h:543
void clear()
Clears the string.
Definition: basic_string.h:800
int compare(size_type position, size_type length_, const ibasic_string &str, size_type subposition, size_type sublength) const
Compare position / length with string / subposition / sublength.
Definition: basic_string.h:1829
reverse_iterator rend()
Definition: basic_string.h:419
iterator erase(iterator i_element)
Definition: basic_string.h:1272
const_reverse_iterator crend() const
Definition: basic_string.h:446
reference at(size_type i)
Definition: basic_string.h:531
~ibasic_string()
Destructor.
Definition: basic_string.h:2381
ibasic_string & replace(const_iterator first, const_iterator last, const_pointer s)
Replace characters from 'first' 'last' with pointed to string.
Definition: basic_string.h:1691
size_type find(const_pointer s, size_type pos, size_type n) const
Definition: basic_string.h:1416
size_type find_first_of(const_pointer s, size_type position=0) const
Definition: basic_string.h:1892
ibasic_string & replace(size_type position, size_type length_, const ibasic_string &str, size_type subposition, size_type sublength)
Replace characters from 'position' of 'length' with 'str' from 'subposition' of 'sublength'.
Definition: basic_string.h:1640
iterator begin()
Definition: basic_string.h:347
iterator end()
Definition: basic_string.h:365
ibasic_string & replace(const_iterator first, const_iterator last, size_type n, value_type c)
Replace characters from 'first' of 'last' with 'n' copies of 'c'.
Definition: basic_string.h:1765
ibasic_string & replace(const_iterator first, const_iterator last, const_pointer s, size_type n)
Replace characters from 'first' to 'last' with 'n' characters from pointed to string.
Definition: basic_string.h:1728
void assign(TIterator first, TIterator last)
Definition: basic_string.h:747
etl::ibasic_string< T > & insert(size_type position, const etl::ibasic_string< T > &str, size_type subposition, size_type sublength)
Definition: basic_string.h:1184
size_type find(const ibasic_string< T > &str, size_type pos=0) const
Definition: basic_string.h:1365
void push_back(T value)
Definition: basic_string.h:810
size_type find_first_not_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:2053
void assign(size_type n, T value)
Definition: basic_string.h:778
const_reverse_iterator crbegin() const
Definition: basic_string.h:437
iterator insert(const_iterator position, T value)
Definition: basic_string.h:927
etl::ibasic_string< T > & insert(size_type position, const_pointer s, size_type n)
Definition: basic_string.h:1229
ibasic_string & replace(size_type position, size_type length_, const ibasic_string &str)
Definition: basic_string.h:1589
ibasic_string(T *p_buffer_, size_type MAX_SIZE_)
Constructor.
Definition: basic_string.h:2280
etl::ibasic_string< T > & insert(size_type position, size_type n, value_type c)
Definition: basic_string.h:1243
const_reverse_iterator rend() const
Definition: basic_string.h:428
size_type find_last_not_of(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:2105
const_pointer data_end() const
Definition: basic_string.h:616
void assign(const etl::ibasic_string< T > &other)
Definition: basic_string.h:626
const_iterator cend() const
Definition: basic_string.h:392
const_pointer c_str() const
Return a pointer to a C string.
Definition: basic_string.h:1326
void assign(const_pointer other, size_type length_)
Definition: basic_string.h:719
void resize(size_type new_size, T value)
Definition: basic_string.h:466
const_reference front() const
Definition: basic_string.h:562
pointer data()
Definition: basic_string.h:589
size_type find_first_not_of(value_type c, size_type position=0) const
Definition: basic_string.h:2084
ibasic_string & append(size_type n, T c)
Definition: basic_string.h:904
size_type find_first_not_of(const ibasic_string< T > &str, size_type position=0) const
Definition: basic_string.h:2032
size_type find_last_of(value_type c, size_type position=npos) const
Definition: basic_string.h:2002
size_type copy(pointer dest, size_type count, size_type pos=0) const
Definition: basic_string.h:1337
ibasic_string & append(const ibasic_string &str)
Definition: basic_string.h:845
ibasic_string & replace(size_type position, size_type length_, const_pointer s)
Replace characters from 'position' of 'length' with pointed to string.
Definition: basic_string.h:1672
reference front()
Definition: basic_string.h:553
reference back()
Definition: basic_string.h:571
const_iterator cbegin() const
Definition: basic_string.h:383
void initialise()
Initialise the string.
Definition: basic_string.h:2289
ibasic_string & operator+=(const ibasic_string &rhs)
+= operator.
Definition: basic_string.h:2215
void trim_to_terminator()
Definition: basic_string.h:2265
void uninitialized_resize(size_type new_size)
Definition: basic_string.h:497
ibasic_string & append(const T *str, size_type n)
Definition: basic_string.h:893
int compare(size_type position, size_type length_, const_pointer s, size_type n) const
Compare position / length with C string / n.
Definition: basic_string.h:1869
size_type rfind(const_pointer s, size_type position, size_type length_) const
Definition: basic_string.h:1528
size_type find_first_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:1903
int compare(const ibasic_string &str) const
Compare with string.
Definition: basic_string.h:1802
const_iterator end() const
Definition: basic_string.h:374
iterator erase(const_iterator i_element)
Definition: basic_string.h:1285
etl::ibasic_string< T > & insert(size_type position, const_pointer s)
Definition: basic_string.h:1215
void repair_buffer(T *p_buffer_)
Fix the internal pointers after a low level memory copy.
Definition: basic_string.h:2302
void assign(const_pointer other)
Definition: basic_string.h:693
Definition: basic_string.h:144
Definition: basic_string.h:167
void set_secure()
Sets the 'secure' flag to the requested state.
Definition: basic_string.h:269
bool is_secure() const
Gets the 'secure' state flag.
Definition: basic_string.h:277
const size_type CAPACITY
The maximum number of elements in the string.
Definition: basic_string.h:312
bool full() const
Definition: basic_string.h:203
~string_base()
Destructor.
Definition: basic_string.h:307
ETL_DEPRECATED bool truncated() const
Definition: basic_string.h:242
void set_truncated(bool status)
Sets the 'truncated' flag.
Definition: basic_string.h:298
size_type max_size() const
Definition: basic_string.h:221
string_base(size_type max_size_)
Constructor.
Definition: basic_string.h:288
void clear_truncated()
Clears the 'truncated' flag.
Definition: basic_string.h:259
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 available() const
Definition: basic_string.h:230
bool empty() const
Definition: basic_string.h:194
size_type capacity() const
Definition: basic_string.h:212
bool is_truncated() const
Definition: basic_string.h:251
size_type size() const
Definition: basic_string.h:176
Definition: basic_string.h:84
Definition: basic_string.h:70
Definition: basic_string.h:112
Definition: basic_string.h:98
Definition: basic_string.h:126
#define ETL_ASSERT(b, e)
Definition: error_handler.h:316
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition: exception.h:69
Definition: exception.h:47
Definition: integral_limits.h:468
void memory_clear_range(volatile T *begin, size_t n)
Definition: memory.h:1999
bitset_ext
Definition: absolute.h:38
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:684
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:696
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:645
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
ETL_CONSTEXPR size_t strlen(const T *t)
Alternative strlen for all character types.
Definition: char_traits.h:267
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:657
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:672