3#ifndef TETL_STRING_BASIC_INPLACE_STRING_HPP
4#define TETL_STRING_BASIC_INPLACE_STRING_HPP
6#include <etl/_algorithm/copy.hpp>
7#include <etl/_algorithm/fill.hpp>
8#include <etl/_algorithm/max.hpp>
9#include <etl/_algorithm/remove.hpp>
10#include <etl/_algorithm/rotate.hpp>
11#include <etl/_algorithm/swap_ranges.hpp>
12#include <etl/_array/array.hpp>
13#include <etl/_contracts/check.hpp>
14#include <etl/_cstring/memset.hpp>
15#include <etl/_iterator/begin.hpp>
16#include <etl/_iterator/data.hpp>
17#include <etl/_iterator/distance.hpp>
18#include <etl/_iterator/end.hpp>
19#include <etl/_iterator/next.hpp>
20#include <etl/_iterator/prev.hpp>
21#include <etl/_iterator/rbegin.hpp>
22#include <etl/_iterator/rend.hpp>
23#include <etl/_iterator/size.hpp>
24#include <etl/_limits/numeric_limits.hpp>
25#include <etl/_string/char_traits.hpp>
26#include <etl/_string/str_replace.hpp>
27#include <etl/_string_view/basic_string_view.hpp>
28#include <etl/_strings/find.hpp>
29#include <etl/_strings/rfind.hpp>
30#include <etl/_type_traits/is_convertible.hpp>
31#include <etl/_type_traits/smallest_size_t.hpp>
32#include <etl/_utility/ignore_unused.hpp>
41template <
typename Char,
etl::size_t Capacity,
typename Traits =
etl::char_traits<Char>>
47 using internal_size_t =
etl::smallest_size_t<Capacity>;
50 using value_type = Char;
51 using size_type =
etl::size_t;
52 using difference_type =
etl::ptrdiff_t;
53 using traits_type = Traits;
54 using pointer = Char*;
55 using const_pointer = Char
const*;
56 using reference = Char&;
57 using const_reference = Char
const&;
58 using iterator = Char*;
59 using const_iterator = Char
const*;
60 using reverse_iterator =
etl::reverse_iterator<iterator>;
61 using const_reverse_iterator =
etl::reverse_iterator<const_iterator>;
70 TETL_PRECONDITION(len <= Capacity);
72 traits_type::copy(_storage.data(), str, len);
88 TETL_PRECONDITION(count <= Capacity);
89 fill(begin(), begin() + count, ch);
90 unsafe_set_size(count);
95 template <
typename InputIt>
96 requires(detail::InputIterator<InputIt>)
116 template <
typename StringView>
117 requires string_view_like<StringView>
122 assign(sv.begin(), sv.end());
127 template <
typename StringView>
128 requires string_view_like<StringView>
150 auto const len = traits_type::length(s);
151 TETL_PRECONDITION(len <= capacity());
167 template <
typename StringView>
168 requires string_view_like<StringView>
178 TETL_PRECONDITION(count <= capacity());
195 *
this = str.substr(pos, count);
203 TETL_PRECONDITION(count <= capacity());
218 template <
typename InputIt>
219 requires(detail::InputIterator<InputIt>)
228 template <
typename StringView>
229 requires string_view_like<StringView>
240 template <
typename StringView>
241 requires string_view_like<StringView>
242 constexpr auto assign(StringView
const& view, size_type pos, size_type count =
npos)
noexcept
251 constexpr auto operator[](size_type index)
noexcept -> reference
253 return unsafe_at(index);
257 constexpr auto operator[](size_type index)
const noexcept -> const_reference
259 return unsafe_at(index);
263 constexpr auto begin()
noexcept -> iterator
281 constexpr auto end()
noexcept -> iterator
283 return etl::next(begin(),
static_cast<ptrdiff_t>(
size()));
289 return etl::next(begin(),
static_cast<ptrdiff_t>(
size()));
302 return reverse_iterator(end());
309 return const_reverse_iterator(end());
323 return reverse_iterator(begin());
328 [[
nodiscard]]
constexpr auto rend()
const noexcept -> const_reverse_iterator
330 return const_reverse_iterator(begin());
343 TETL_PRECONDITION(
not empty());
350 TETL_PRECONDITION(
not empty());
357 TETL_PRECONDITION(
not empty());
358 return *
etl::prev(end());
364 TETL_PRECONDITION(
not empty());
365 return *
etl::prev(end());
383 return _storage.get_size();
407 static constexpr auto reserve(size_type ) ->
void { }
420 return _storage.data();
431 return _storage.data();
453 constexpr auto clear()
noexcept ->
void
464 auto safeCount =
etl::min(count,
size() - index);
465 erase(begin() + index, begin() + index + safeCount);
473 constexpr auto erase(const_iterator position)
noexcept -> iterator
475 return erase(position, position + 1);
482 constexpr auto erase(const_iterator first, const_iterator last)
noexcept -> iterator
484 auto const start =
static_cast<size_type>(
etl::distance(
cbegin(), first));
485 auto const distance =
static_cast<size_type>(
etl::distance(first, last));
486 TETL_PRECONDITION(size() > distance);
487 etl::rotate(begin() + start, begin() + start + distance, end());
488 unsafe_set_size(
size() - distance);
489 return begin() + start;
496 TETL_PRECONDITION(size() < capacity());
504 TETL_PRECONDITION(
not empty());
505 unsafe_set_size(
size() - 1);
512 auto const newSize =
size() + safeCount;
513 etl::fill(end(),
etl::next(begin(),
static_cast<ptrdiff_t>(newSize)), s);
514 unsafe_set_size(newSize);
522 auto const len = traits_type::length(s);
523 return append(s, len);
531 etl::copy(str,
etl::next(str,
static_cast<ptrdiff_t>(safeCount)), end());
532 unsafe_set_size(
size() + safeCount);
537 template <
typename InputIt>
538 requires(detail::InputIterator<InputIt>)
541 for (; first != last; ++first) {
550 return append(str.begin(), str.end());
557 return append(str.substr(pos, count));
562 template <
typename StringView>
563 requires string_view_like<StringView>
567 return append(sv.data(), sv.size());
572 template <
typename StringView>
573 requires string_view_like<StringView>
577 return append(sv.substr(pos, count));
589 return append(1, ch);
600 template <
typename StringView>
601 requires string_view_like<StringView>
610 for (size_type i = 0; i < count; ++i) {
611 insert_impl(begin() + index, &ch, 1);
620 insert_impl(begin() + index, s, traits_type::length(s));
626 constexpr auto insert(size_type
const index, const_pointer s, size_type
const count)
noexcept
629 insert_impl(begin() + index, s, count);
636 insert_impl(begin() + index, str.data(), str.size());
643 size_type
const index,
645 size_type
const indexStr,
646 size_type
const count =
npos
650 auto sv = view_type(str).substr(indexStr, count);
651 insert_impl(begin() + index, sv.data(), sv.size());
685 template <
typename StringView>
686 requires string_view_like<StringView>
690 insert_impl(begin() + pos, sv.data(), sv.size());
697 template <
typename StringView>
698 requires string_view_like<StringView>
700 size_type
const index,
701 StringView
const& view,
702 size_type
const indexStr,
703 size_type
const count =
npos
708 auto sub = sv.substr(indexStr, count);
709 insert_impl(begin() + index, sub.data(), sub.size());
720 template <size_type OtherCapacity>
721 [[nodiscard]]
constexpr auto
734 return sub.compare(str);
742 size_type
const pos1,
743 size_type
const count1,
745 size_type
const pos2,
746 size_type
const count2 =
npos
749 auto const sz1 = count1 >
size() - pos1 ?
size() : count1;
752 auto const sz2 = count2 > str.size() - pos2 ?
size() : count2;
755 return sub1.compare(sub2);
763 return basic_string_view<Char, Traits>{*
this}.compare({s, traits_type::length(s)});
770 [[
nodiscard]]
constexpr auto compare(size_type
const pos, size_type
const count, const_pointer s)
const ->
int
774 return sub.compare({s, traits_type::length(s)});
782 compare(size_type
const pos1, size_type
const count1, const_pointer s, size_type
const count2)
const ->
int
784 auto const sz = count1 >
size() - pos1 ?
size() : count1;
786 return sub.compare({s, count2});
791 template <
typename StringView>
792 requires string_view_like<StringView>
793 [[nodiscard]]
constexpr auto compare(StringView
const& view)
const noexcept ->
int
796 view_type
const sv = view;
797 return view_type(*
this).compare(sv);
802 template <
typename StringView>
803 requires string_view_like<StringView>
804 [[nodiscard]]
constexpr auto compare(size_type pos1, size_type count1, StringView
const& view)
const noexcept ->
int
807 view_type
const sv = view;
808 return view_type(*
this).substr(pos1, count1).compare(sv);
814 template <
typename StringView>
815 requires string_view_like<StringView>
819 StringView
const& view,
821 size_type count2 =
npos
822 )
const noexcept ->
int
825 view_type
const sv = view;
826 return view_type(*
this).substr(pos1, count1).compare(sv.substr(pos2, count2));
869 TETL_PRECONDITION(pos < size());
870 TETL_PRECONDITION(pos + count < size());
872 auto* f = data() + pos;
873 auto* l = data() + pos + count;
874 detail::str_replace(f, l, str.begin(), str.end());
883 auto* f = to_mutable_iterator(first);
884 auto* l = to_mutable_iterator(last);
885 detail::str_replace(f, l, str.begin(), str.end());
893 TETL_PRECONDITION(pos < size());
894 TETL_PRECONDITION(pos2 < str.size());
896 auto* f = data() +
etl::min(pos,
size());
897 auto* l = data() +
etl::min(pos + count,
size());
898 auto const* sf =
etl::next(str.begin(),
static_cast<
etl::ptrdiff_t>(
etl::min(pos2, str.size())));
899 auto const* sl =
etl::next(str.begin(),
static_cast<
etl::ptrdiff_t>(
etl::min(pos2 + count2, str.size())));
900 detail::str_replace(f, l, sf, sl);
906 TETL_PRECONDITION(pos < size());
907 TETL_PRECONDITION(pos + count < size());
909 auto* f = next(data(), min(pos,
size()));
910 auto* l = next(data(), min(pos + count,
size()));
911 detail::str_replace(f, l, str, next(str, count2));
915 constexpr auto replace(const_iterator first, const_iterator last, Char
const* str, size_type count2)
918 auto* f = to_mutable_iterator(first);
919 auto* l = to_mutable_iterator(last);
920 detail::str_replace(f, l, str, next(str, count2));
926 TETL_PRECONDITION(pos < size());
927 TETL_PRECONDITION(pos + count < size());
929 auto* f = next(data(), min(pos,
size()));
930 auto* l = next(data(), min(pos + count,
size()));
931 detail::str_replace(f, l, str, next(str, strlen(str)));
937 auto* f = to_mutable_iterator(first);
938 auto* l = to_mutable_iterator(last);
939 detail::str_replace(f, l, str, next(str, strlen(str)));
955 constexpr auto replace(const_iterator first, const_iterator last, size_type count2, Char ch)
958 auto* f = to_mutable_iterator(first);
959 auto* l =
etl::min(to_mutable_iterator(last), f + count2);
960 detail::str_replace(f, l, ch);
985 constexpr auto copy(pointer destination, size_type count, size_type pos = 0)
const -> size_type
990 auto const* first = data() + pos;
991 auto const* last = first +
etl::min(count,
size() - pos);
992 auto const* dest = destination;
993 auto const* res =
etl::copy(first, last, destination);
994 return static_cast<size_type>(res - dest);
1002 constexpr auto resize(size_type count, Char ch)
noexcept ->
void
1005 unsafe_set_size(count);
1017 constexpr auto resize(size_type count)
noexcept ->
void
1019 resize(count, Char());
1026 auto const thisSize =
size();
1027 auto const maxSize =
static_cast<
etl::ptrdiff_t>(
etl::max(thisSize, other.size()));
1029 etl::swap_ranges(begin(),
etl::next(begin(), maxSize + 1), other.begin());
1030 unsafe_set_size(other.size());
1031 other.unsafe_set_size(thisSize);
1044 return etl::
strings::find<Char, Traits>(*
this, str, pos);
1055 [[
nodiscard]]
constexpr auto find(const_pointer s, size_type pos, size_type count)
const noexcept -> size_type
1068 [[
nodiscard]]
constexpr auto find(const_pointer s, size_type pos = 0)
const noexcept -> size_type
1070 return etl::
strings::find<Char, Traits>(*
this, s, pos);
1081 [[
nodiscard]]
constexpr auto find(Char ch, size_type pos = 0)
const noexcept -> size_type
1098 return etl::
strings::rfind<Char, Traits>(*
this, str, pos);
1113 [[
nodiscard]]
constexpr auto rfind(const_pointer s, size_type pos, size_type count)
const noexcept -> size_type
1115 return etl::
strings::rfind<Char, Traits>(*
this, s, count, pos);
1128 [[
nodiscard]]
constexpr auto rfind(const_pointer s, size_type pos = 0)
const noexcept -> size_type
1130 return etl::
strings::rfind<Char, Traits>(*
this, s, pos);
1143 [[
nodiscard]]
constexpr auto rfind(Char ch, size_type pos = 0)
const noexcept -> size_type
1145 return etl::
strings::rfind<Char, Traits>(*
this, ch, pos);
1155 return find_first_of(str.c_str(), pos, str.size());
1177 return find_first_of(s, pos, traits_type::length(s));
1186 return find_first_of(&ch, pos, 1);
1196 return find_first_of(str.data(), pos, str.size());
1340 [[
nodiscard]]
constexpr auto to_mutable_iterator(const_iterator it) -> iterator
1343 return etl::next(begin(),
static_cast<
etl::ptrdiff_t>(dist));
1346 [[
nodiscard]]
constexpr auto unsafe_at(size_type index)
noexcept -> reference
1348 TETL_PRECONDITION(index < size() + 1);
1349 return *
etl::next(_storage.data(),
static_cast<
etl::ptrdiff_t>(index));
1352 [[
nodiscard]]
constexpr auto unsafe_at(size_type index)
const noexcept -> const_reference
1354 TETL_PRECONDITION(index < size() + 1);
1355 return *
etl::next(_storage.data(),
static_cast<
etl::ptrdiff_t>(index));
1358 constexpr auto unsafe_set_size(size_type
const newSize)
noexcept ->
void
1360 TETL_PRECONDITION(newSize <= Capacity);
1361 _storage.set_size(newSize);
1362 unsafe_at(newSize) = Char(0);
1365 constexpr auto insert_impl(iterator pos, const_pointer text, size_type count) ->
void
1368 auto* currentEnd = end();
1369 append(text, count);
1372 etl::rotate(pos, currentEnd, end());
1375 struct tiny_layout {
1376 constexpr tiny_layout()
noexcept
1378 _buffer[Capacity] = Capacity;
1381 [[nodiscard]]
constexpr auto data()
noexcept
1383 return _buffer.data();
1386 [[nodiscard]]
constexpr auto data()
const noexcept
1388 return _buffer.data();
1391 [[nodiscard]]
constexpr auto get_size()
const noexcept
1393 return Capacity - size_type(_buffer[Capacity]);
1396 constexpr auto set_size(size_t size)
noexcept
1398 return _buffer[Capacity] = Char(Capacity - size);
1402 etl::
array<Char, Capacity + 1> _buffer{};
1405 struct normal_layout {
1406 constexpr normal_layout()
noexcept =
default;
1408 [[nodiscard]]
constexpr auto data()
noexcept
1410 return _buffer.data();
1413 [[nodiscard]]
constexpr auto data()
const noexcept
1415 return _buffer.data();
1418 [[nodiscard]]
constexpr auto get_size()
const noexcept
1420 return size_t(_size);
1423 constexpr auto set_size(size_t size)
noexcept
1425 return _size = internal_size_t(size);
1429 internal_size_t _size{};
1430 etl::
array<Char, Capacity + 1> _buffer{};
1433 using layout_type =
etl::conditional_t<(Capacity < 16), tiny_layout, normal_layout>;
1434 layout_type _storage{};
1438template <
etl::size_t Capacity>
1442template <
etl::size_t Capacity>
1446template <
etl::size_t Capacity>
1450template <
etl::size_t Capacity>
1454template <
etl::size_t Capacity>
1459template <
typename Char,
typename Traits, size_t Capacity1, size_t Capacity2>
1472template <
typename Char,
typename Traits, size_t Capacity>
1473[[nodiscard]]
constexpr auto
1484template <
typename Char,
typename Traits, size_t Capacity>
1495template <
typename Char,
typename Traits, size_t Capacity>
1496[[nodiscard]]
constexpr auto
1507template <
typename Char,
typename Traits, size_t Capacity>
1521template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1527 return lhs.compare(rhs) == 0;
1535template <
typename Char,
typename Traits,
etl::size_t Capacity>
1536[[nodiscard]]
constexpr auto
1539 return lhs.compare(rhs) == 0;
1547template <
typename Char,
typename Traits,
etl::size_t Capacity>
1548[[nodiscard]]
constexpr auto
1551 return rhs.compare(lhs) == 0;
1559template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1565 return lhs.compare(rhs) != 0;
1573template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1574[[nodiscard]]
constexpr auto
1577 return lhs.compare(rhs) != 0;
1585template <
typename Char,
typename Traits,
etl::size_t Capacity>
1586[[nodiscard]]
constexpr auto
1589 return rhs.compare(lhs) != 0;
1596template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1602 return lhs.compare(rhs) < 0;
1609template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1610[[nodiscard]]
constexpr auto
1613 return lhs.compare(rhs) < 0;
1620template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1621[[nodiscard]]
constexpr auto
1624 return rhs.compare(lhs) > 0;
1631template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1637 return lhs.compare(rhs) <= 0;
1644template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1645[[nodiscard]]
constexpr auto
1648 return lhs.compare(rhs) <= 0;
1655template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1656[[nodiscard]]
constexpr auto
1659 return rhs.compare(lhs) >= 0;
1666template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1672 return lhs.compare(rhs) > 0;
1679template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1680[[nodiscard]]
constexpr auto
1683 return lhs.compare(rhs) > 0;
1690template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1691[[nodiscard]]
constexpr auto
1694 return rhs.compare(lhs) < 0;
1701template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1707 return lhs.compare(rhs) >= 0;
1714template <
typename Char,
typename Traits,
etl::size_t Capacity>
1715[[nodiscard]]
constexpr auto
1718 return lhs.compare(rhs) >= 0;
1725template <
typename Char,
typename Traits,
etl::size_t Capacity>
1726[[nodiscard]]
constexpr auto
1729 return rhs.compare(lhs) <= 0;
1734template <
typename Char,
typename Traits,
etl::size_t Capacity>
1744template <
typename Char,
typename Traits,
etl::size_t Capacity,
typename U>
1750 auto it =
etl::remove(begin(c), end(c), value);
1751 auto r =
etl::distance(it, end(c));
1752 c.erase(it, end(c));
1753 return static_cast<return_type>(r);
1758template <
typename Char,
typename Traits,
etl::size_t Capacity,
typename Predicate>
1764 auto it =
etl::remove_if(begin(c), end(c), pred);
1765 auto r =
etl::distance(it, end(c));
1766 c.erase(it, end(c));
1767 return static_cast<return_type>(r);
Definition adjacent_find.hpp:9
constexpr auto operator+(Char const *lhs, basic_inplace_string< Char, Capacity, Traits > const &rhs) noexcept -> basic_inplace_string< Char, Capacity, Traits >
Returns a string containing characters from lhs followed by the characters from rhs.
Definition basic_inplace_string.hpp:1497
constexpr auto operator!=(Char const *lhs, etl::basic_inplace_string< Char, Capacity, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1587
constexpr auto operator>(Char const *lhs, etl::basic_inplace_string< Char, Capacity1, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1692
constexpr auto operator>=(etl::basic_inplace_string< Char, Capacity, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1716
constexpr auto operator+(Char lhs, basic_inplace_string< Char, Capacity, Traits > const &rhs) noexcept -> basic_inplace_string< Char, Capacity, Traits >
Returns a string containing characters from lhs followed by the characters from rhs.
Definition basic_inplace_string.hpp:1508
constexpr auto operator==(etl::basic_inplace_string< Char, Capacity, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1537
constexpr auto operator<=(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1632
constexpr auto operator<=(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1646
constexpr auto operator>(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1681
constexpr auto operator+(basic_inplace_string< Char, Capacity, Traits > const &lhs, Char const *rhs) noexcept -> basic_inplace_string< Char, Capacity, Traits >
Returns a string containing characters from lhs followed by the characters from rhs.
Definition basic_inplace_string.hpp:1474
constexpr auto operator+(basic_inplace_string< Char, Capacity, Traits > const &lhs, Char rhs) noexcept -> basic_inplace_string< Char, Capacity, Traits >
Returns a string containing characters from lhs followed by the characters from rhs.
Definition basic_inplace_string.hpp:1485
constexpr auto operator==(Char const *lhs, etl::basic_inplace_string< Char, Capacity, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1549
constexpr auto operator>(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1667
constexpr auto operator!=(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1575
constexpr auto swap(etl::basic_inplace_string< Char, Capacity, Traits > &lhs, etl::basic_inplace_string< Char, Capacity, Traits > &rhs) noexcept(noexcept(lhs.swap(rhs))) -> void
Specializes the etl::swap algorithm for etl::basic_inplace_string. Swaps the contents of lhs and rhs....
Definition basic_inplace_string.hpp:1735
constexpr auto operator>=(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1702
constexpr auto erase(basic_inplace_string< Char, Capacity, Traits > &c, U const &value) noexcept -> typename basic_inplace_string< Char, Capacity, Traits >::size_type
Erases all elements that compare equal to value from the container.
Definition basic_inplace_string.hpp:1745
constexpr auto operator<(Char const *lhs, etl::basic_inplace_string< Char, Capacity1, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1622
constexpr auto operator+(basic_inplace_string< Char, Capacity1, Traits > const &lhs, basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept -> basic_inplace_string< Char, Capacity1, Traits >
Returns a string containing characters from lhs followed by the characters from rhs.
Definition basic_inplace_string.hpp:1460
constexpr auto operator<=(Char const *lhs, etl::basic_inplace_string< Char, Capacity1, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1657
constexpr auto operator==(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1522
constexpr auto erase_if(basic_inplace_string< Char, Capacity, Traits > &c, Predicate pred) noexcept -> typename basic_inplace_string< Char, Capacity, Traits >::size_type
Erases all elements that satisfy the predicate pred from the container.
Definition basic_inplace_string.hpp:1759
constexpr auto operator!=(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1560
constexpr auto operator>=(Char const *lhs, etl::basic_inplace_string< Char, Capacity, Traits > const &rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1727
constexpr auto operator<(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, etl::basic_inplace_string< Char, Capacity2, Traits > const &rhs) noexcept
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1597
constexpr auto operator<(etl::basic_inplace_string< Char, Capacity1, Traits > const &lhs, Char const *rhs) noexcept -> bool
Compares the contents of a string with another string or a null-terminated array of Char.
Definition basic_inplace_string.hpp:1611
A container that encapsulates fixed size arrays.
Definition array.hpp:49
basic_inplace_string class with fixed size capacity.
Definition basic_inplace_string.hpp:42
constexpr auto operator[](size_type index) const noexcept -> const_reference
Accesses the specified character without bounds checking.
Definition basic_inplace_string.hpp:257
constexpr auto rfind(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the last substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1096
constexpr basic_inplace_string(const_pointer str, size_type const len) noexcept
Character pointer constructor.
Definition basic_inplace_string.hpp:68
constexpr auto operator=(const_pointer s) noexcept -> basic_inplace_string &
Replaces the contents with those of null-terminated character string pointed to by s.
Definition basic_inplace_string.hpp:148
constexpr auto operator[](size_type index) noexcept -> reference
Accesses the specified character without bounds checking.
Definition basic_inplace_string.hpp:251
constexpr auto assign(size_type count, Char ch) noexcept -> basic_inplace_string &
Replaces the contents with count copies of character ch.
Definition basic_inplace_string.hpp:176
constexpr auto find_first_not_of(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the first character not equal to any of the characters in the given character sequence.
Definition basic_inplace_string.hpp:1204
constexpr auto erase(const_iterator position) noexcept -> iterator
Removes the character at position.
Definition basic_inplace_string.hpp:473
constexpr auto insert(size_type const pos, StringView const &view) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then inserts the elements from sv before the element (i...
Definition basic_inplace_string.hpp:687
constexpr auto find_last_not_of(Char c, size_type pos=0) const noexcept -> size_type
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1291
constexpr basic_inplace_string(size_type count, Char ch) noexcept
Constructs the string with count copies of character ch.
Definition basic_inplace_string.hpp:86
constexpr auto c_str() const noexcept -> const_pointer
Returns a pointer to a null-terminated character array.
Definition basic_inplace_string.hpp:440
constexpr auto operator+=(basic_inplace_string const &str) noexcept -> basic_inplace_string &
Appends string str.
Definition basic_inplace_string.hpp:581
constexpr auto operator=(Char ch) noexcept -> basic_inplace_string &
Replaces the contents with character ch.
Definition basic_inplace_string.hpp:159
constexpr auto rfind(const_pointer s, size_type pos, size_type count) const noexcept -> size_type
Finds the last substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1113
static constexpr size_type npos
This is a special value equal to the maximum value representable by the type size_type....
Definition basic_inplace_string.hpp:1337
constexpr auto find_first_of(const_pointer s, size_type pos=0) const -> size_type
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1175
constexpr auto find_first_not_of(Char ch, size_type pos=0) const noexcept -> size_type
Finds the first character not equal to any of the characters in the given character sequence.
Definition basic_inplace_string.hpp:1215
constexpr auto front() const noexcept -> const_reference
Accesses the first character.
Definition basic_inplace_string.hpp:348
constexpr auto find_last_of(Char c, size_type pos=0) const noexcept -> size_type
Finds the last character equal to one of characters in the given character sequence....
Definition basic_inplace_string.hpp:1254
constexpr basic_inplace_string(basic_inplace_string const &) noexcept=default
Defaulted copy constructor.
constexpr auto insert(size_type const index, StringView const &view, size_type const indexStr, size_type const count=npos) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then inserts, before the element (if any) pointed by po...
Definition basic_inplace_string.hpp:699
constexpr auto operator=(StringView const &view) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then replaces the contents with those of the sv.
Definition basic_inplace_string.hpp:169
constexpr auto replace(const_iterator first, const_iterator last, basic_inplace_string const &str) -> basic_inplace_string &
Replaces the part of the string indicated [first, last) with a new string.
Definition basic_inplace_string.hpp:880
constexpr auto crbegin() const noexcept -> const_reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:314
constexpr auto find_last_of(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the last character equal to one of characters in the given character sequence....
Definition basic_inplace_string.hpp:1244
constexpr auto replace(const_iterator first, const_iterator last, size_type count2, Char ch) -> basic_inplace_string &
Definition basic_inplace_string.hpp:955
constexpr auto starts_with(basic_string_view< Char, Traits > sv) const noexcept -> bool
Checks if the string begins with the given prefix.
Definition basic_inplace_string.hpp:830
constexpr auto compare(size_type const pos, size_type const count, const_pointer s) const -> int
Compares a [pos1, pos1+count1) substring of this string to the null-terminated character sequence beg...
Definition basic_inplace_string.hpp:770
constexpr auto find_last_not_of(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1281
constexpr auto rfind(const_pointer s, size_type pos=0) const noexcept -> size_type
Finds the last substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1128
constexpr auto insert(size_type const index, const_pointer s) noexcept -> basic_inplace_string &
Inserts null-terminated character string pointed to by s at the position index.
Definition basic_inplace_string.hpp:618
constexpr auto rbegin() const noexcept -> const_reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:307
constexpr auto find_last_of(Char const *s, size_type pos, size_type count) const -> size_type
Finds the last character equal to one of characters in the given character sequence....
Definition basic_inplace_string.hpp:1263
constexpr auto find(Char ch, size_type pos=0) const noexcept -> size_type
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1081
constexpr auto replace(size_type pos, size_type count, basic_inplace_string const &str) -> basic_inplace_string &
Replaces the part of the string indicated [pos, pos + count) with a new string.
Definition basic_inplace_string.hpp:867
static constexpr auto reserve(size_type) -> void
Reserve is a nop, since the capacity is fixed.
Definition basic_inplace_string.hpp:407
constexpr auto resize(size_type count) noexcept -> void
Resizes the string to contain count characters.
Definition basic_inplace_string.hpp:1017
constexpr auto compare(size_type const pos, size_type const count, basic_inplace_string const &str) const -> int
Compares a [pos, pos+count) substring of this string to str. If count > size() - pos the substring is...
Definition basic_inplace_string.hpp:730
constexpr auto operator+=(StringView const &view) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then appends characters in the string view sv.
Definition basic_inplace_string.hpp:602
constexpr auto append(basic_inplace_string const &str, size_type pos, size_type count=npos) noexcept -> basic_inplace_string &
Appends a substring [ pos, pos + count ) of str.
Definition basic_inplace_string.hpp:554
constexpr auto operator=(basic_inplace_string &&) noexcept -> basic_inplace_string &=default
Defaulted move assignment.
constexpr auto substr(size_type pos=0, size_type count=npos) const -> basic_inplace_string
Returns a substring [pos, pos+count). If the requested substring extends past the end of the string,...
Definition basic_inplace_string.hpp:969
constexpr auto find_first_of(const_pointer s, size_type pos, size_type count) const -> size_type
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1162
constexpr auto assign(InputIt first, InputIt last) noexcept -> basic_inplace_string &
Replaces the contents with copies of the characters in the range [ first , last ).
Definition basic_inplace_string.hpp:220
constexpr basic_inplace_string(const_pointer str) noexcept
Character pointer constructor. Calls traits_type::length.
Definition basic_inplace_string.hpp:77
constexpr auto find_first_not_of(Char const *s, size_type pos, size_type count) const -> size_type
Finds the first character not equal to any of the characters in the given character sequence.
Definition basic_inplace_string.hpp:1235
constexpr auto assign(basic_inplace_string const &str) noexcept -> basic_inplace_string &
Replaces the contents with a copy of str.
Definition basic_inplace_string.hpp:184
constexpr auto assign(StringView const &view) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then replaces the contents with the characters from sv.
Definition basic_inplace_string.hpp:230
constexpr auto back() noexcept -> reference
Accesses the last character.
Definition basic_inplace_string.hpp:355
constexpr auto append(InputIt first, InputIt last) noexcept -> basic_inplace_string &
Appends characters in the range [ first , last ).
Definition basic_inplace_string.hpp:539
constexpr auto ends_with(Char c) const noexcept -> bool
Checks if the string ends with the given prefix.
Definition basic_inplace_string.hpp:854
constexpr auto assign(StringView const &view, size_type pos, size_type count=npos) noexcept -> basic_inplace_string &
Implicitly converts view to a string view sv, then replaces the contents with the characters from the...
Definition basic_inplace_string.hpp:242
constexpr auto operator+=(const_pointer s) noexcept -> basic_inplace_string &
Appends the null-terminated character string pointed to by s.
Definition basic_inplace_string.hpp:593
constexpr auto find_last_of(Char const *s, size_type pos=0) const -> size_type
Finds the last character equal to one of characters in the given character sequence....
Definition basic_inplace_string.hpp:1272
constexpr auto find_last_not_of(Char const *s, size_type pos, size_type count) const -> size_type
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1300
constexpr auto rend() noexcept -> reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:321
constexpr auto begin() noexcept -> iterator
Returns an iterator to the beginning.
Definition basic_inplace_string.hpp:263
constexpr auto erase(size_type index=0, size_type count=npos) noexcept -> basic_inplace_string &
Removes min(count, size() - index) characters starting at index.
Definition basic_inplace_string.hpp:462
constexpr auto insert(size_type const index, const_pointer s, size_type const count) noexcept -> basic_inplace_string &
Inserts the characters in the range [s, s+count) at the position index. The range can contain null ch...
Definition basic_inplace_string.hpp:626
constexpr auto assign(basic_inplace_string const &str, size_type pos, size_type count=npos) noexcept -> basic_inplace_string &
Replaces the contents with a substring [ pos, pos + count ) of str.
Definition basic_inplace_string.hpp:192
constexpr auto ends_with(const_pointer str) const -> bool
Checks if the string ends with the given prefix.
Definition basic_inplace_string.hpp:860
constexpr auto end() noexcept -> iterator
Returns an iterator to the end.
Definition basic_inplace_string.hpp:281
constexpr auto begin() const noexcept -> const_iterator
Returns an const iterator to the beginning.
Definition basic_inplace_string.hpp:269
constexpr auto starts_with(const_pointer s) const -> bool
Checks if the string begins with the given prefix.
Definition basic_inplace_string.hpp:842
constexpr auto cbegin() const noexcept -> const_iterator
Returns an const iterator to the beginning.
Definition basic_inplace_string.hpp:275
constexpr auto append(const_pointer s) noexcept -> basic_inplace_string &
Appends the null-terminated character string pointed to by s. The length of the string is determined ...
Definition basic_inplace_string.hpp:520
constexpr auto contains(Char c) const noexcept -> bool
Checks if the string contains the given substring.
Definition basic_inplace_string.hpp:1321
constexpr auto append(const_pointer str, size_type count) noexcept -> basic_inplace_string &
Appends characters in the range [ str, str + count ). This range can contain null characters.
Definition basic_inplace_string.hpp:528
constexpr auto find(const_pointer s, size_type pos, size_type count) const noexcept -> size_type
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1055
constexpr auto compare(size_type pos1, size_type count1, StringView const &view) const noexcept -> int
Implicitly converts view to a string view sv, then compares a [pos1, pos1+count1) substring of this s...
Definition basic_inplace_string.hpp:804
constexpr auto compare(basic_inplace_string const &str) const noexcept -> int
Compares this string to str.
Definition basic_inplace_string.hpp:714
constexpr auto rfind(Char ch, size_type pos=0) const noexcept -> size_type
Finds the last substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1143
constexpr auto contains(Char const *s) const -> bool
Checks if the string contains the given substring.
Definition basic_inplace_string.hpp:1327
constexpr auto push_back(Char ch) noexcept -> void
Appends the given character ch to the end of the string.
Definition basic_inplace_string.hpp:494
constexpr auto append(size_type const count, Char const s) noexcept -> basic_inplace_string &
Appends count copies of character s.
Definition basic_inplace_string.hpp:509
constexpr auto operator=(basic_inplace_string const &) noexcept -> basic_inplace_string &=default
Defaulted copy assignment.
constexpr auto find_first_of(basic_string_view< Char, traits_type > str, size_type pos=0) const noexcept -> size_type
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1194
constexpr auto replace(size_type pos, size_type count, Char const *str) -> basic_inplace_string &
Definition basic_inplace_string.hpp:924
constexpr auto append(StringView const &view) -> basic_inplace_string &
Implicitly converts view to a string_view sv, then appends all characters from sv.
Definition basic_inplace_string.hpp:564
constexpr auto empty() const noexcept -> bool
Checks whether the string is empty.
Definition basic_inplace_string.hpp:369
constexpr auto compare(const_pointer s) const -> int
Compares this string to the null-terminated character sequence beginning at the character pointed to ...
Definition basic_inplace_string.hpp:761
constexpr auto clear() noexcept -> void
Removes all characters from the string. Sets size to 0 and overrides the buffer with zeros.
Definition basic_inplace_string.hpp:453
constexpr auto pop_back() noexcept -> void
Removes the last character from the string.
Definition basic_inplace_string.hpp:502
constexpr auto find_first_of(Char ch, size_type pos=0) const noexcept -> size_type
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1184
constexpr auto find_first_of(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1152
constexpr auto data() noexcept -> pointer
Returns a pointer to the underlying array serving as character storage. The pointer is such that the ...
Definition basic_inplace_string.hpp:418
constexpr auto back() const noexcept -> const_reference
Accesses the last character.
Definition basic_inplace_string.hpp:362
static constexpr bool string_view_like
Definition basic_inplace_string.hpp:45
constexpr auto length() const noexcept -> size_type
Returns the number of characters.
Definition basic_inplace_string.hpp:387
constexpr auto front() noexcept -> reference
Accesses the first character.
Definition basic_inplace_string.hpp:341
constexpr auto find(const_pointer s, size_type pos=0) const noexcept -> size_type
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1068
constexpr basic_inplace_string(basic_inplace_string const &other, size_type pos, size_type count)
Constructs the string with a substring [pos, pos+count) of other.
Definition basic_inplace_string.hpp:103
constexpr auto append(StringView const &view, size_type pos, size_type count=npos) -> basic_inplace_string &
Implicitly converts view to a string_view sv then appends the characters from the subview [ pos,...
Definition basic_inplace_string.hpp:574
constexpr auto swap(basic_inplace_string &other) noexcept -> void
Exchanges the contents of the string with those of other. All iterators and references may be invalid...
Definition basic_inplace_string.hpp:1024
constexpr auto insert(size_type const index, basic_inplace_string const &str, size_type const indexStr, size_type const count=npos) noexcept -> basic_inplace_string &
Inserts a string, obtained by str.substr(index_str, count) at the position index.
Definition basic_inplace_string.hpp:642
constexpr auto full() const noexcept -> bool
Checks whether the string is full. i.e. size() == capacity()
Definition basic_inplace_string.hpp:375
constexpr auto assign(const_pointer s) noexcept -> basic_inplace_string &
Replaces the contents with those of null-terminated character string pointed to by s.
Definition basic_inplace_string.hpp:210
static constexpr auto shrink_to_fit() -> void
Shrink to fit is a nop, since the capacity is fixed.
Definition basic_inplace_string.hpp:410
constexpr auto ends_with(basic_string_view< Char, Traits > sv) const noexcept -> bool
Checks if the string ends with the given prefix.
Definition basic_inplace_string.hpp:848
constexpr auto max_size() const noexcept -> size_type
Returns the number of characters that can be held in allocated storage, NOT including the null termin...
Definition basic_inplace_string.hpp:401
constexpr auto operator+=(Char ch) noexcept -> basic_inplace_string &
Appends character ch.
Definition basic_inplace_string.hpp:587
constexpr auto compare(size_type pos1, size_type count1, StringView const &view, size_type pos2, size_type count2=npos) const noexcept -> int
Implicitly converts view to a string view sv, then compares a [pos1, pos1+count1) substring of this s...
Definition basic_inplace_string.hpp:816
constexpr auto end() const noexcept -> const_iterator
Returns an const iterator to the end.
Definition basic_inplace_string.hpp:287
constexpr auto starts_with(Char c) const noexcept -> bool
Checks if the string begins with the given prefix.
Definition basic_inplace_string.hpp:836
constexpr auto find_first_not_of(Char const *s, size_type pos) const -> size_type
Finds the first character not equal to any of the characters in the given character sequence.
Definition basic_inplace_string.hpp:1225
constexpr auto replace(const_iterator first, const_iterator last, Char const *str, size_type count2) -> basic_inplace_string &
Definition basic_inplace_string.hpp:915
constexpr auto replace(size_type pos, size_type count, Char const *str, size_type count2) -> basic_inplace_string &
Definition basic_inplace_string.hpp:904
constexpr basic_inplace_string()=default
Default constructor.
constexpr auto assign(const_pointer s, size_type count) noexcept -> basic_inplace_string &
Replaces the contents with copies of the characters in the range [ s, s + count )....
Definition basic_inplace_string.hpp:201
constexpr basic_inplace_string(basic_inplace_string const &other, size_type pos)
Constructs the string with a substring [pos, other.size()).
Definition basic_inplace_string.hpp:109
constexpr basic_inplace_string(StringView const &view, size_type pos, size_type n)
Implicitly converts view to a string view sv, then initializes the string with the subrange [ pos,...
Definition basic_inplace_string.hpp:129
constexpr auto compare(size_type const pos1, size_type const count1, basic_inplace_string const &str, size_type const pos2, size_type const count2=npos) const -> int
Compares a [pos1, pos1+count1) substring of this string to a substring [pos2, pos2+count2) of str....
Definition basic_inplace_string.hpp:741
constexpr auto compare(basic_inplace_string< Char, OtherCapacity, traits_type > const &str) const noexcept -> int
Compares this string to str with other capacity.
Definition basic_inplace_string.hpp:722
constexpr auto crend() const noexcept -> const_reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:335
constexpr auto erase(const_iterator first, const_iterator last) noexcept -> iterator
Removes the characters in the range [first, last).
Definition basic_inplace_string.hpp:482
constexpr auto insert(size_type const index, basic_inplace_string const &str) noexcept -> basic_inplace_string &
Inserts string str at the position index.
Definition basic_inplace_string.hpp:634
constexpr auto replace(size_type pos, size_type count, basic_inplace_string const &str, size_type pos2, size_type count2=npos) -> basic_inplace_string &
Definition basic_inplace_string.hpp:890
constexpr auto resize(size_type count, Char ch) noexcept -> void
Resizes the string to contain count characters.
Definition basic_inplace_string.hpp:1002
constexpr operator basic_string_view< Char, traits_type >() const noexcept
Returns a etl::basic_string_view.
Definition basic_inplace_string.hpp:446
constexpr auto insert(size_type const index, size_type const count, Char const ch) noexcept -> basic_inplace_string &
Inserts count copies of character ch at the position index.
Definition basic_inplace_string.hpp:608
constexpr auto data() const noexcept -> const_pointer
Returns a pointer to the underlying array serving as character storage. The pointer is such that the ...
Definition basic_inplace_string.hpp:429
constexpr auto compare(size_type const pos1, size_type const count1, const_pointer s, size_type const count2) const -> int
Compares a [pos1, pos1+count1) substring of this string to the characters in the range [s,...
Definition basic_inplace_string.hpp:782
constexpr auto compare(StringView const &view) const noexcept -> int
Implicitly converts view to a string view sv, then compares the content of this string to sv.
Definition basic_inplace_string.hpp:793
constexpr basic_inplace_string(StringView const &view) noexcept
Implicitly converts view to a string view sv, then initializes the string with the contents of sv.
Definition basic_inplace_string.hpp:118
constexpr auto contains(etl::basic_string_view< Char, Traits > sv) const noexcept -> bool
Checks if the string contains the given substring.
Definition basic_inplace_string.hpp:1315
constexpr auto rend() const noexcept -> const_reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:328
constexpr auto find_last_not_of(Char const *s, size_type pos=0) const -> size_type
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_inplace_string.hpp:1309
constexpr auto append(basic_inplace_string const &str) noexcept -> basic_inplace_string &
Appends string str.
Definition basic_inplace_string.hpp:548
constexpr auto size() const noexcept -> size_type
Returns the number of characters.
Definition basic_inplace_string.hpp:381
constexpr auto cend() const noexcept -> const_iterator
Returns an const iterator to the end.
Definition basic_inplace_string.hpp:293
constexpr auto capacity() const noexcept -> size_type
Returns the number of characters that can be held in allocated storage, NOT including the null termin...
Definition basic_inplace_string.hpp:394
constexpr basic_inplace_string(nullptr_t)=delete
constexpr auto copy(pointer destination, size_type count, size_type pos=0) const -> size_type
Copies a substring [pos, pos+count) to character string pointed to by dest. If the requested substrin...
Definition basic_inplace_string.hpp:985
constexpr auto replace(const_iterator first, const_iterator last, Char const *str) -> basic_inplace_string &
Definition basic_inplace_string.hpp:935
constexpr basic_inplace_string(InputIt first, InputIt last) noexcept
Constructs the string with the contents of the range [ first, last). Fails silently if input length i...
Definition basic_inplace_string.hpp:97
constexpr auto rbegin() noexcept -> reverse_iterator
Returns a reverse iterator to the first character of the reversed string. It corresponds to the last ...
Definition basic_inplace_string.hpp:300
constexpr basic_inplace_string(basic_inplace_string &&) noexcept=default
Defaulted move constructor.
constexpr auto operator=(nullptr_t) -> basic_inplace_string &=delete
constexpr auto find(basic_inplace_string const &str, size_type pos=0) const noexcept -> size_type
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_inplace_string.hpp:1042
The class template basic_string_view describes an object that can refer to a constant contiguous sequ...
Definition basic_string_view.hpp:35
static constexpr auto max() noexcept -> unsigned long
Definition numeric_limits.hpp:811
Definition numeric_limits.hpp:18