31 #ifndef ETL_BASIC_STRING_INCLUDED
32 #define ETL_BASIC_STRING_INCLUDED
60 #ifdef ETL_COMPILER_GCC
61 #pragma GCC diagnostic push
62 #pragma GCC diagnostic ignored "-Wunused-variable"
83 string_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
84 :
exception(reason_, file_name_, line_number_)
97 string_empty(string_type file_name_, numeric_type line_number_)
98 :
string_exception(ETL_ERROR_TEXT(
"string:empty", ETL_FILE
"A"), file_name_, line_number_)
112 :
string_exception(ETL_ERROR_TEXT(
"string:bounds", ETL_FILE
"B"), file_name_, line_number_)
126 :
string_exception(ETL_ERROR_TEXT(
"string:iterator", ETL_FILE
"C"), file_name_, line_number_)
140 :
string_exception(ETL_ERROR_TEXT(
"string:iterator", ETL_FILE
"D"), file_name_, line_number_)
153 typedef size_t size_type;
155 #if ETL_CPP11_SUPPORTED
227 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
257 #if ETL_STRING_CLEAR_AFTER_USE_ENABLED
286 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
309 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED || ETL_STRING_CLEAR_AFTER_USE_ENABLED
319 template <
typename T>
326 typedef T value_type;
327 typedef T& reference;
328 typedef const T& const_reference;
330 typedef const T* const_pointer;
332 typedef const T* const_iterator;
333 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
334 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
336 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
369 const_iterator
end()
const
398 return reverse_iterator(
end());
407 return const_reverse_iterator(
end());
416 return reverse_iterator(
begin());
423 const_reverse_iterator
rend()
const
425 return const_reverse_iterator(
begin());
434 return const_reverse_iterator(
cend());
441 const_reverse_iterator
crend()
const
443 return const_reverse_iterator(
cbegin());
465 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
468 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
474 new_size = etl::min(new_size,
CAPACITY);
479 etl::fill(p_buffer +
current_size, p_buffer + new_size, value);
483 p_buffer[new_size] = 0;
513 reference
at(size_type i)
525 const_reference
at(size_type i)
const
594 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
599 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
605 #if ETL_STRING_CLEAR_AFTER_USE_ENABLED
624 if (sublength == npos)
626 sublength = other.
size() - subposition;
633 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
638 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
644 #if ETL_STRING_CLEAR_AFTER_USE_ENABLED
666 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
669 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
683 void assign(const_pointer other, size_type length_)
687 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
690 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
695 length_ = etl::min(length_,
CAPACITY);
697 etl::copy_n(other, length_,
begin());
710 template <
typename TIterator>
711 void assign(TIterator first, TIterator last)
713 #if defined(ETL_DEBUG)
714 difference_type d = etl::distance(first, last);
727 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
730 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
746 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
749 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
756 etl::fill_n(
begin(), n, value);
783 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
786 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
813 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
818 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
879 template <
class TIterator>
891 iterator
insert(const_iterator position, T value)
894 iterator insert_position =
const_cast<iterator
>(position);
899 if (position !=
end())
903 etl::copy_backward(insert_position,
end() - 1,
end());
904 *insert_position = value;
909 *insert_position = value;
916 if (position !=
end())
919 etl::copy_backward(insert_position,
end() - 1,
end());
920 *insert_position = value;
923 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
926 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
934 return insert_position;
943 void insert(const_iterator position, size_type n, T value)
951 iterator insert_position =
const_cast<iterator
>(position);
952 const size_type start = etl::distance(
cbegin(), position);
957 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
960 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
972 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
975 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
982 etl::fill(insert_position,
end(), value);
987 const size_type shift_amount = n;
988 const size_type to_position = start + shift_amount;
989 const size_type remaining_characters =
current_size - start;
990 const size_type max_shift_characters =
CAPACITY - start - shift_amount;
991 const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
994 if ((start + shift_amount + remaining_characters) >
CAPACITY)
998 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1001 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1011 etl::copy_backward(insert_position, insert_position + characters_to_shift,
begin() + to_position + characters_to_shift);
1012 etl::fill(insert_position, insert_position + shift_amount, value);
1025 template <
class TIterator>
1026 void insert(iterator position, TIterator first, TIterator last)
1033 const size_type start = etl::distance(
begin(), position);
1034 const size_type n = etl::distance(first, last);
1039 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1042 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1054 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1057 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1065 while (position !=
end())
1067 *position++ = *first++;
1073 const size_type shift_amount = n;
1074 const size_type to_position = start + shift_amount;
1075 const size_type remaining_characters =
current_size - start;
1076 const size_type max_shift_characters =
CAPACITY - start - shift_amount;
1077 const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
1080 if ((start + shift_amount + remaining_characters) >
CAPACITY)
1084 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1087 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1097 etl::copy_backward(position, position + characters_to_shift,
begin() + to_position + characters_to_shift);
1099 while (first != last)
1101 *position++ = *first++;
1119 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1124 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1145 if ((sublength == npos) || (subposition + sublength > str.
size()))
1147 sublength = str.
size() - subposition;
1152 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1157 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1216 length_ = etl::min(length_,
size() - position);
1230 etl::copy(i_element + 1,
end(), i_element);
1244 iterator
erase(iterator first, iterator last)
1251 etl::copy(last,
end(), first);
1252 size_type n_delete = etl::distance(first, last);
1275 size_type
copy(pointer s, size_type len, size_type pos = 0)
1277 if ((pos + len >
size()))
1279 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1282 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1288 size_type endpos = etl::min(pos + len,
size());
1290 for (size_type i = pos; i < endpos; ++i)
1295 return endpos - pos;
1310 const_iterator iposition = etl::search(
begin() + pos,
end(), str.
begin(), str.
end());
1312 if (iposition ==
end())
1318 return etl::distance(
begin(), iposition);
1327 size_type
find(const_pointer s, size_type pos = 0)
const
1329 #if defined(ETL_DEBUG)
1338 if (iposition ==
end())
1344 return etl::distance(
begin(), iposition);
1354 size_type
find(const_pointer s, size_type pos, size_type n)
const
1356 #if defined(ETL_DEBUG)
1363 const_iterator iposition = etl::search(
begin() + pos,
end(), s, s + n);
1365 if (iposition ==
end())
1371 return etl::distance(
begin(), iposition);
1380 size_type
find(T c, size_type position = 0)
const
1382 const_iterator i = etl::find(
begin() + position,
end(), c);
1386 return etl::distance(
begin(), i);
1406 if (position >=
size())
1411 position =
size() - position;
1413 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), str.
rbegin(), str.
rend());
1415 if (iposition ==
rend())
1430 size_type
rfind(const_pointer s, size_type position = npos)
const
1439 if (position >=
size())
1444 position =
size() - position;
1446 const_reverse_iterator srbegin(s + len);
1447 const_reverse_iterator srend(s);
1449 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), srbegin, srend);
1451 if (iposition ==
rend())
1457 return size() - len - etl::distance(
rbegin(), iposition);
1466 size_type
rfind(const_pointer s, size_type position, size_type length_)
const
1468 if (length_ >
size())
1473 if (position >=
size())
1478 position =
size() - position;
1480 const_reverse_iterator srbegin(s + length_);
1481 const_reverse_iterator srend(s);
1483 const_reverse_iterator iposition = etl::search(
rbegin() + position,
rend(), srbegin, srend);
1485 if (iposition ==
rend())
1491 return size() - length_ - etl::distance(
rbegin(), iposition);
1500 size_type
rfind(T c, size_type position = npos)
const
1502 if (position >=
size())
1507 position =
size() - position;
1509 const_reverse_iterator i = etl::find(
rbegin() + position,
rend(), c);
1513 return size() - etl::distance(
rbegin(), i) - 1;
1532 length_ = etl::min(length_,
size() - position);
1535 erase(position, length_);
1552 iterator first_ =
const_cast<iterator
>(first);
1553 iterator last_ =
const_cast<iterator
>(last);
1556 erase(first_, last_);
1561 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1566 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1584 length_ = etl::min(length_,
size() - position);
1585 sublength = etl::min(sublength, str.
size() - subposition);
1588 erase(position, length_);
1591 insert(position, str, subposition, sublength);
1593 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
1598 #if defined(ETL_STRING_TRUNCATION_IS_ERROR)
1615 length_ = etl::min(length_,
size() - position);
1618 erase(position, length_);
1632 iterator first_ =
const_cast<iterator
>(first);
1633 iterator last_ =
const_cast<iterator
>(last);
1636 erase(first_, last_);
1652 length_ = etl::min(length_,
size() - position);
1655 erase(position, length_);
1669 iterator first_ =
const_cast<iterator
>(first);
1670 iterator last_ =
const_cast<iterator
>(last);
1673 erase(first_, last_);
1676 insert(first_, s, s + n);
1689 length_ = etl::min(length_,
size() - position);
1692 erase(position, length_);
1706 iterator first_ =
const_cast<iterator
>(first);
1707 iterator last_ =
const_cast<iterator
>(last);
1710 erase(first_, last_);
1721 template <
typename TIterator>
1725 iterator first_ =
const_cast<iterator
>(first);
1726 iterator last_ =
const_cast<iterator
>(last);
1729 erase(first_, last_);
1732 insert(first_, first_replace, last_replace);
1745 str.p_buffer + str.
size());
1756 length_ = etl::min(length_,
size() - position);
1758 return compare(p_buffer + position,
1759 p_buffer + position + length_,
1761 str.p_buffer + str.
size());
1767 int compare(size_type position, size_type length_,
const ibasic_string& str, size_type subposition, size_type sublength)
const
1773 length_ = etl::min(length_,
size() - position);
1774 sublength = etl::min(sublength, str.
size() - subposition);
1776 return compare(p_buffer + position,
1777 p_buffer + position + length_,
1778 str.p_buffer + subposition,
1779 str.p_buffer + subposition + sublength);
1796 int compare(size_type position, size_type length_, const_pointer s)
const
1798 return compare(p_buffer + position,
1799 p_buffer + position + length_,
1807 int compare(size_type position, size_type length_, const_pointer s, size_type n)
const
1809 return compare(p_buffer + position,
1810 p_buffer + position + length_,
1843 if (position <
size())
1845 for (size_type i = position; i <
size(); ++i)
1847 for (size_type j = 0; j < n; ++j)
1849 if (p_buffer[i] == s[j])
1867 if (position <
size())
1869 for (size_type i = position; i <
size(); ++i)
1871 if (p_buffer[i] == c)
1907 size_type
find_last_of(const_pointer s, size_type position, size_type n)
const
1914 position = etl::min(position,
size() - 1);
1916 const_reverse_iterator it =
rbegin() +
size() - position - 1;
1918 while (it !=
rend())
1920 for (size_type j = 0; j < n; ++j)
1922 if (p_buffer[position] == s[j])
1947 position = etl::min(position,
size() - 1);
1949 const_reverse_iterator it =
rbegin() +
size() - position - 1;
1951 while (it !=
rend())
1953 if (p_buffer[position] == c)
1993 if (position <
size())
1995 for (size_type i = position; i <
size(); ++i)
1999 for (size_type j = 0; j < n; ++j)
2001 if (p_buffer[i] == s[j])
2024 if (position <
size())
2026 for (size_type i = position; i <
size(); ++i)
2028 if (p_buffer[i] != c)
2071 position = etl::min(position,
size() - 1);
2073 const_reverse_iterator it =
rbegin() +
size() - position - 1;
2075 while (it !=
rend())
2079 for (size_type j = 0; j < n; ++j)
2081 if (p_buffer[position] == s[j])
2109 position = etl::min(position,
size() - 1);
2111 const_reverse_iterator it =
rbegin() +
size() - position - 1;
2113 while (it !=
rend())
2115 if (p_buffer[position] != c)
2175 append(size_type(1), rhs);
2180 #ifdef ETL_ISTRING_REPAIR_ENABLE
2184 virtual void repair() = 0;
2206 #if ETL_STRING_TRUNCATION_CHECKS_ENABLED
2216 p_buffer = p_buffer_;
2224 int compare(const_pointer first1, const_pointer last1, const_pointer first2, const_pointer last2)
const
2226 while ((first1 != last1) && (first2 != last2))
2228 if (*first1 < *first2)
2233 else if (*first1 > *first2)
2244 if ((first1 == last1) && (first2 == last2))
2249 else if (first1 == last1)
2266 #if ETL_STRING_CLEAR_AFTER_USE_ENABLED
2287 #if defined(ETL_POLYMORPHIC_STRINGS) || defined(ETL_POLYMORPHIC_CONTAINERS)
2295 #if ETL_STRING_CLEAR_AFTER_USE_ENABLED
2311 template <
typename T>
2324 template <
typename T>
2337 template <
typename T>
2351 template <
typename T>
2354 return !(lhs == rhs);
2364 template <
typename T>
2367 return !(lhs == rhs);
2377 template <
typename T>
2380 return !(lhs == rhs);
2390 template <
typename T>
2393 return etl::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end());
2403 template <
typename T>
2416 template <
typename T>
2430 template <
typename T>
2443 template <
typename T>
2456 template <
typename T>
2470 template <
typename T>
2473 return !(lhs > rhs);
2483 template <
typename T>
2486 return !(lhs > rhs);
2496 template <
typename T>
2499 return !(lhs > rhs);
2510 template <
typename T>
2513 return !(lhs < rhs);
2523 template <
typename T>
2526 return !(lhs < rhs);
2536 template <
typename T>
2539 return !(lhs < rhs);
2545 #ifdef ETL_COMPILER_GCC
2546 #pragma GCC diagnostic pop
ETL_CONSTEXPR14 flags< T, MASK > & set() ETL_NOEXCEPT
Set the bits.
Definition: flags.h:104
ETL_CONSTEXPR bool test() const ETL_NOEXCEPT
Tests bits.
Definition: flags.h:89
Definition: basic_string.h:321
int compare(size_type position, size_type length_, const ibasic_string &str) const
Compare position / length with string.
Definition: basic_string.h:1751
etl::ibasic_string< T > & insert(size_type position, const_pointer s, size_type n)
Definition: basic_string.h:1185
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 'subpsotion' of 'sublength'.
Definition: basic_string.h:1578
size_type find_last_of(const_pointer s, size_type position=npos) const
Definition: basic_string.h:1896
size_type rfind(const_pointer s, size_type position=npos) const
Definition: basic_string.h:1430
etl::ibasic_string< T > & insert(size_type position, const_pointer s)
Definition: basic_string.h:1171
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:1629
size_type find_last_not_of(const_pointer s, size_type position=npos) const
Definition: basic_string.h:2053
size_type find(const_pointer s, size_type pos=0) const
Definition: basic_string.h:1327
const_reverse_iterator rbegin() const
Definition: basic_string.h:405
etl::ibasic_string< T > & insert(size_type position, const etl::ibasic_string< T > &str, size_type subposition, size_type sublength)
Definition: basic_string.h:1140
reference operator[](size_type i)
Definition: basic_string.h:492
void assign(const etl::ibasic_string< T > &other, size_type subposition, size_type sublength)
Definition: basic_string.h:622
etl::ibasic_string< T > & insert(size_type position, const etl::ibasic_string< T > &str)
Definition: basic_string.h:1113
etl::ibasic_string< T > & insert(size_type position, size_type n, value_type c)
Definition: basic_string.h:1199
ibasic_string & operator+=(const ibasic_string &rhs)
+= operator.
Definition: basic_string.h:2153
size_type find_last_of(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:1886
size_type find_first_of(value_type c, size_type position=0) const
Definition: basic_string.h:1865
size_type find(T c, size_type position=0) const
Definition: basic_string.h:1380
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:1703
ibasic_string & operator=(const ibasic_string &rhs)
Assignment operator.
Definition: basic_string.h:2130
void pop_back()
Definition: basic_string.h:797
size_type rfind(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:1399
etl::ibasic_string< T > & erase(size_type position, size_type length_=npos)
Definition: basic_string.h:1213
size_type find_first_of(const ibasic_string< T > &str, size_type position=0) const
Definition: basic_string.h:1820
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:1647
const_reference back() const
Definition: basic_string.h:562
const_iterator begin() const
Definition: basic_string.h:351
const_pointer data() const
Definition: basic_string.h:580
ibasic_string & append(const ibasic_string &str, size_type subposition, size_type sublength=npos)
Definition: basic_string.h:833
size_type find_last_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:1907
reverse_iterator rbegin()
Definition: basic_string.h:396
void resize(size_type new_size)
Definition: basic_string.h:451
size_type find_last_not_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:2064
size_type find_first_not_of(const_pointer s, size_type position=0) const
Definition: basic_string.h:1980
size_type rfind(T c, size_type position=npos) const
Definition: basic_string.h:1500
size_type copy(pointer s, size_type len, size_type pos=0)
Definition: basic_string.h:1275
int compare(const value_type *s) const
Compare with C string.
Definition: basic_string.h:1785
int compare(size_type position, size_type length_, const_pointer s) const
Compare position / length with C string.
Definition: basic_string.h:1796
const_reference at(size_type i) const
Definition: basic_string.h:525
void clear()
Clears the string.
Definition: basic_string.h:764
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:1767
reverse_iterator rend()
Definition: basic_string.h:414
iterator erase(iterator i_element)
Definition: basic_string.h:1228
const_reverse_iterator crend() const
Definition: basic_string.h:441
reference at(size_type i)
Definition: basic_string.h:513
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:1722
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:1610
void insert(iterator position, TIterator first, TIterator last)
Definition: basic_string.h:1026
~ibasic_string()
Destructor.
Definition: basic_string.h:2293
size_type find(const_pointer s, size_type pos, size_type n) const
Definition: basic_string.h:1354
size_type find_first_of(const_pointer s, size_type position=0) const
Definition: basic_string.h:1830
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:1666
iterator begin()
Definition: basic_string.h:342
iterator end()
Definition: basic_string.h:360
void assign(TIterator first, TIterator last)
Definition: basic_string.h:711
void insert(const_iterator position, size_type n, T value)
Definition: basic_string.h:943
size_type find(const ibasic_string< T > &str, size_type pos=0) const
Definition: basic_string.h:1303
void push_back(T value)
Definition: basic_string.h:774
size_type find_first_not_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:1991
void assign(size_type n, T value)
Definition: basic_string.h:742
const_reverse_iterator crbegin() const
Definition: basic_string.h:432
iterator insert(const_iterator position, T value)
Definition: basic_string.h:891
ibasic_string(T *p_buffer_, size_type MAX_SIZE_)
Constructor.
Definition: basic_string.h:2192
const_reverse_iterator rend() const
Definition: basic_string.h:423
size_type find_last_not_of(const ibasic_string< T > &str, size_type position=npos) const
Definition: basic_string.h:2043
void assign(const etl::ibasic_string< T > &other)
Definition: basic_string.h:590
ibasic_string & append(TIterator first, TIterator last)
Definition: basic_string.h:880
const_iterator cend() const
Definition: basic_string.h:387
const_pointer c_str() const
Return a pointer to a C string.
Definition: basic_string.h:1264
void assign(const_pointer other, size_type length_)
Definition: basic_string.h:683
void resize(size_type new_size, T value)
Definition: basic_string.h:461
const_reference front() const
Definition: basic_string.h:544
pointer data()
Definition: basic_string.h:571
size_type find_first_not_of(value_type c, size_type position=0) const
Definition: basic_string.h:2022
size_type find_first_not_of(const ibasic_string< T > &str, size_type position=0) const
Definition: basic_string.h:1970
size_type find_last_of(value_type c, size_type position=npos) const
Definition: basic_string.h:1940
ibasic_string & append(const T *str, size_type n)
Definition: basic_string.h:857
ibasic_string & replace(const_iterator first, const_iterator last, const ibasic_string &str)
Definition: basic_string.h:1549
reference front()
Definition: basic_string.h:535
reference back()
Definition: basic_string.h:553
const_iterator cbegin() const
Definition: basic_string.h:378
void initialise()
Initialise the string.
Definition: basic_string.h:2201
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:1684
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:1807
size_type rfind(const_pointer s, size_type position, size_type length_) const
Definition: basic_string.h:1466
size_type find_first_of(const_pointer s, size_type position, size_type n) const
Definition: basic_string.h:1841
int compare(const ibasic_string &str) const
Compare with string.
Definition: basic_string.h:1740
ibasic_string & append(const T *str)
Definition: basic_string.h:846
const_iterator end() const
Definition: basic_string.h:369
ibasic_string & replace(size_type position, size_type length_, const ibasic_string &str)
Definition: basic_string.h:1527
iterator erase(iterator first, iterator last)
Definition: basic_string.h:1244
void repair_buffer(T *p_buffer_)
Fix the internal pointers after a low level memory copy.
Definition: basic_string.h:2214
ibasic_string & append(size_type n, T c)
Definition: basic_string.h:868
ibasic_string & append(const ibasic_string &str)
Definition: basic_string.h:809
void assign(const_pointer other)
Definition: basic_string.h:657
Definition: basic_string.h:150
void set_secure()
Sets the 'secure' flag to the requested state.
Definition: basic_string.h:261
bool is_secure() const
Gets the 'secure' state flag.
Definition: basic_string.h:269
const size_type CAPACITY
The maximum number of elements in the string.
Definition: basic_string.h:307
bool full() const
Definition: basic_string.h:195
~string_base()
Destructor.
Definition: basic_string.h:299
ETL_DEPRECATED bool truncated() const
Definition: basic_string.h:234
void set_truncated(bool status)
Sets the 'truncated' flag.
Definition: basic_string.h:290
size_type max_size() const
Definition: basic_string.h:213
string_base(size_type max_size_)
Constructor.
Definition: basic_string.h:280
void clear_truncated()
Clears the 'truncated' flag.
Definition: basic_string.h:251
size_type length() const
Definition: basic_string.h:177
size_type current_size
The current number of elements in the string.
Definition: basic_string.h:306
size_type available() const
Definition: basic_string.h:222
bool empty() const
Definition: basic_string.h:186
size_type capacity() const
Definition: basic_string.h:204
bool is_truncated() const
Definition: basic_string.h:243
size_type size() const
Definition: basic_string.h:168
Definition: basic_string.h:94
Definition: basic_string.h:80
Definition: basic_string.h:122
Definition: basic_string.h:108
Definition: basic_string.h:136
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
exception(string_type reason_, string_type file_, numeric_type line_)
Constructor.
Definition: exception.h:67
Definition: exception.h:47
Definition: integral_limits.h:54
void memory_clear_range(volatile T *begin, size_t n)
Definition: memory.h:1827
Definition: absolute.h:37
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
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:594
size_t strlen(const T *t)
Alternative strlen for all character types.
Definition: char_traits.h:247
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:582
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:606
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:621