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>>
48 using internal_size_t =
etl::smallest_size_t<Capacity>;
51 using value_type = Char;
52 using size_type =
etl::size_t;
53 using difference_type =
etl::ptrdiff_t;
54 using traits_type = Traits;
55 using pointer = Char*;
56 using const_pointer = Char
const*;
57 using reference = Char&;
58 using const_reference = Char
const&;
59 using iterator = Char*;
60 using const_iterator = Char
const*;
61 using reverse_iterator =
etl::reverse_iterator<iterator>;
62 using const_reverse_iterator =
etl::reverse_iterator<const_iterator>;
71 TETL_PRECONDITION(len <= Capacity);
73 traits_type::copy(_storage.data(), str, len);
89 TETL_PRECONDITION(count <= Capacity);
90 fill(begin(), begin() + count, ch);
91 unsafe_set_size(count);
96 template <
typename InputIt>
97 requires(detail::InputIterator<InputIt>)
117 template <
typename StringView>
118 requires string_view_like<StringView>
123 assign(sv.begin(), sv.end());
128 template <
typename StringView>
129 requires string_view_like<StringView>
151 auto const len = traits_type::length(s);
152 TETL_PRECONDITION(len <= capacity());
168 template <
typename StringView>
169 requires string_view_like<StringView>
179 TETL_PRECONDITION(count <= capacity());
196 *
this = str.substr(pos, count);
204 TETL_PRECONDITION(count <= capacity());
219 template <
typename InputIt>
220 requires(detail::InputIterator<InputIt>)
229 template <
typename StringView>
230 requires string_view_like<StringView>
241 template <
typename StringView>
242 requires string_view_like<StringView>
243 constexpr auto assign(StringView
const& view, size_type pos, size_type count =
npos)
noexcept
252 constexpr auto operator[](size_type index)
noexcept -> reference
254 return unsafe_at(index);
258 constexpr auto operator[](size_type index)
const noexcept -> const_reference
260 return unsafe_at(index);
264 constexpr auto begin()
noexcept -> iterator
282 constexpr auto end()
noexcept -> iterator
284 return etl::next(begin(),
static_cast<ptrdiff_t>(
size()));
290 return etl::next(begin(),
static_cast<ptrdiff_t>(
size()));
303 return reverse_iterator(end());
310 return const_reverse_iterator(end());
324 return reverse_iterator(begin());
329 [[
nodiscard]]
constexpr auto rend()
const noexcept -> const_reverse_iterator
331 return const_reverse_iterator(begin());
344 TETL_PRECONDITION(
not empty());
351 TETL_PRECONDITION(
not empty());
358 TETL_PRECONDITION(
not empty());
359 return *
etl::prev(end());
365 TETL_PRECONDITION(
not empty());
366 return *
etl::prev(end());
384 return _storage.get_size();
408 static constexpr auto reserve(size_type ) ->
void { }
421 return _storage.data();
432 return _storage.data();
454 constexpr auto clear()
noexcept ->
void
465 auto safeCount =
etl::min(count,
size() - index);
466 erase(begin() + index, begin() + index + safeCount);
474 constexpr auto erase(const_iterator position)
noexcept -> iterator
476 return erase(position, position + 1);
483 constexpr auto erase(const_iterator first, const_iterator last)
noexcept -> iterator
485 auto const start =
static_cast<size_type>(
etl::distance(
cbegin(), first));
486 auto const distance =
static_cast<size_type>(
etl::distance(first, last));
487 TETL_PRECONDITION(size() > distance);
488 etl::rotate(begin() + start, begin() + start + distance, end());
489 unsafe_set_size(
size() - distance);
490 return begin() + start;
497 TETL_PRECONDITION(size() < capacity());
505 TETL_PRECONDITION(
not empty());
506 unsafe_set_size(
size() - 1);
513 auto const newSize =
size() + safeCount;
514 etl::fill(end(),
etl::next(begin(),
static_cast<ptrdiff_t>(newSize)), s);
515 unsafe_set_size(newSize);
523 auto const len = traits_type::length(s);
524 return append(s, len);
532 etl::copy(str,
etl::next(str,
static_cast<ptrdiff_t>(safeCount)), end());
533 unsafe_set_size(
size() + safeCount);
538 template <
typename InputIt>
539 requires(detail::InputIterator<InputIt>)
542 for (; first != last; ++first) {
551 return append(str.begin(), str.end());
558 return append(str.substr(pos, count));
563 template <
typename StringView>
564 requires string_view_like<StringView>
568 return append(sv.data(), sv.size());
573 template <
typename StringView>
574 requires string_view_like<StringView>
578 return append(sv.substr(pos, count));
590 return append(1, ch);
601 template <
typename StringView>
602 requires string_view_like<StringView>
611 for (size_type i = 0; i < count; ++i) {
612 insert_impl(begin() + index, &ch, 1);
621 insert_impl(begin() + index, s, traits_type::length(s));
627 constexpr auto insert(size_type
const index, const_pointer s, size_type
const count)
noexcept
630 insert_impl(begin() + index, s, count);
637 insert_impl(begin() + index, str.data(), str.size());
644 size_type
const index,
646 size_type
const indexStr,
647 size_type
const count =
npos
651 auto sv = view_type(str).substr(indexStr, count);
652 insert_impl(begin() + index, sv.data(), sv.size());
686 template <
typename StringView>
687 requires string_view_like<StringView>
691 insert_impl(begin() + pos, sv.data(), sv.size());
698 template <
typename StringView>
699 requires string_view_like<StringView>
701 size_type
const index,
702 StringView
const& view,
703 size_type
const indexStr,
704 size_type
const count =
npos
709 auto sub = sv.substr(indexStr, count);
710 insert_impl(begin() + index, sub.data(), sub.size());
721 template <size_type OtherCapacity>
722 [[nodiscard]]
constexpr auto
735 return sub.compare(str);
743 size_type
const pos1,
744 size_type
const count1,
746 size_type
const pos2,
747 size_type
const count2 =
npos
750 auto const sz1 = count1 >
size() - pos1 ?
size() : count1;
753 auto const sz2 = count2 > str.size() - pos2 ?
size() : count2;
756 return sub1.compare(sub2);
764 return basic_string_view<Char, Traits>{*
this}.compare({s, traits_type::length(s)});
771 [[
nodiscard]]
constexpr auto compare(size_type
const pos, size_type
const count, const_pointer s)
const ->
int
775 return sub.compare({s, traits_type::length(s)});
783 compare(size_type
const pos1, size_type
const count1, const_pointer s, size_type
const count2)
const ->
int
785 auto const sz = count1 >
size() - pos1 ?
size() : count1;
787 return sub.compare({s, count2});
792 template <
typename StringView>
793 requires string_view_like<StringView>
794 [[nodiscard]]
constexpr auto compare(StringView
const& view)
const noexcept ->
int
797 view_type
const sv = view;
798 return view_type(*
this).compare(sv);
803 template <
typename StringView>
804 requires string_view_like<StringView>
805 [[nodiscard]]
constexpr auto compare(size_type pos1, size_type count1, StringView
const& view)
const noexcept ->
int
808 view_type
const sv = view;
809 return view_type(*
this).substr(pos1, count1).compare(sv);
815 template <
typename StringView>
816 requires string_view_like<StringView>
820 StringView
const& view,
822 size_type count2 =
npos
823 )
const noexcept ->
int
826 view_type
const sv = view;
827 return view_type(*
this).substr(pos1, count1).compare(sv.substr(pos2, count2));
870 TETL_PRECONDITION(pos < size());
871 TETL_PRECONDITION(pos + count < size());
873 auto* f = data() + pos;
874 auto* l = data() + pos + count;
875 detail::str_replace(f, l, str.begin(), str.end());
884 auto* f = to_mutable_iterator(first);
885 auto* l = to_mutable_iterator(last);
886 detail::str_replace(f, l, str.begin(), str.end());
894 TETL_PRECONDITION(pos < size());
895 TETL_PRECONDITION(pos2 < str.size());
897 auto* f = data() +
etl::min(pos,
size());
898 auto* l = data() +
etl::min(pos + count,
size());
899 auto const* sf =
etl::next(str.begin(),
static_cast<
etl::ptrdiff_t>(
etl::min(pos2, str.size())));
900 auto const* sl =
etl::next(str.begin(),
static_cast<
etl::ptrdiff_t>(
etl::min(pos2 + count2, str.size())));
901 detail::str_replace(f, l, sf, sl);
907 TETL_PRECONDITION(pos < size());
908 TETL_PRECONDITION(pos + count < size());
910 auto* f = next(data(), min(pos,
size()));
911 auto* l = next(data(), min(pos + count,
size()));
912 detail::str_replace(f, l, str, next(str, count2));
916 constexpr auto replace(const_iterator first, const_iterator last, Char
const* str, size_type count2)
919 auto* f = to_mutable_iterator(first);
920 auto* l = to_mutable_iterator(last);
921 detail::str_replace(f, l, str, next(str, count2));
927 TETL_PRECONDITION(pos < size());
928 TETL_PRECONDITION(pos + count < size());
930 auto* f = next(data(), min(pos,
size()));
931 auto* l = next(data(), min(pos + count,
size()));
932 detail::str_replace(f, l, str, next(str, strlen(str)));
938 auto* f = to_mutable_iterator(first);
939 auto* l = to_mutable_iterator(last);
940 detail::str_replace(f, l, str, next(str, strlen(str)));
956 constexpr auto replace(const_iterator first, const_iterator last, size_type count2, Char ch)
959 auto* f = to_mutable_iterator(first);
960 auto* l =
etl::min(to_mutable_iterator(last), f + count2);
961 detail::str_replace(f, l, ch);
986 constexpr auto copy(pointer destination, size_type count, size_type pos = 0)
const -> size_type
991 auto const* first = data() + pos;
992 auto const* last = first +
etl::min(count,
size() - pos);
993 auto const* dest = destination;
994 auto const* res =
etl::copy(first, last, destination);
995 return static_cast<size_type>(res - dest);
1003 constexpr auto resize(size_type count, Char ch)
noexcept ->
void
1006 unsafe_set_size(count);
1018 constexpr auto resize(size_type count)
noexcept ->
void
1020 resize(count, Char());
1027 auto const thisSize =
size();
1028 auto const maxSize =
static_cast<
etl::ptrdiff_t>(
etl::max(thisSize, other.size()));
1030 etl::swap_ranges(begin(),
etl::next(begin(), maxSize + 1), other.begin());
1031 unsafe_set_size(other.size());
1032 other.unsafe_set_size(thisSize);
1045 return etl::
strings::find<Char, Traits>(*
this, str, pos);
1056 [[
nodiscard]]
constexpr auto find(const_pointer s, size_type pos, size_type count)
const noexcept -> size_type
1069 [[
nodiscard]]
constexpr auto find(const_pointer s, size_type pos = 0)
const noexcept -> size_type
1071 return etl::
strings::find<Char, Traits>(*
this, s, pos);
1082 [[
nodiscard]]
constexpr auto find(Char ch, size_type pos = 0)
const noexcept -> size_type
1099 return etl::
strings::rfind<Char, Traits>(*
this, str, pos);
1114 [[
nodiscard]]
constexpr auto rfind(const_pointer s, size_type pos, size_type count)
const noexcept -> size_type
1116 return etl::
strings::rfind<Char, Traits>(*
this, s, count, pos);
1129 [[
nodiscard]]
constexpr auto rfind(const_pointer s, size_type pos = 0)
const noexcept -> size_type
1131 return etl::
strings::rfind<Char, Traits>(*
this, s, pos);
1144 [[
nodiscard]]
constexpr auto rfind(Char ch, size_type pos = 0)
const noexcept -> size_type
1146 return etl::
strings::rfind<Char, Traits>(*
this, ch, pos);
1156 return find_first_of(str.c_str(), pos, str.size());
1178 return find_first_of(s, pos, traits_type::length(s));
1187 return find_first_of(&ch, pos, 1);
1197 return find_first_of(str.data(), pos, str.size());
1341 [[
nodiscard]]
constexpr auto to_mutable_iterator(const_iterator it) -> iterator
1344 return etl::next(begin(),
static_cast<
etl::ptrdiff_t>(dist));
1347 [[
nodiscard]]
constexpr auto unsafe_at(size_type index)
noexcept -> reference
1349 TETL_PRECONDITION(index < size() + 1);
1350 return *
etl::next(_storage.data(),
static_cast<
etl::ptrdiff_t>(index));
1353 [[
nodiscard]]
constexpr auto unsafe_at(size_type index)
const noexcept -> const_reference
1355 TETL_PRECONDITION(index < size() + 1);
1356 return *
etl::next(_storage.data(),
static_cast<
etl::ptrdiff_t>(index));
1359 constexpr auto unsafe_set_size(size_type
const newSize)
noexcept ->
void
1361 TETL_PRECONDITION(newSize <= Capacity);
1362 _storage.set_size(newSize);
1363 unsafe_at(newSize) = Char(0);
1366 constexpr auto insert_impl(iterator pos, const_pointer text, size_type count) ->
void
1369 auto* currentEnd = end();
1370 append(text, count);
1373 etl::rotate(pos, currentEnd, end());
1376 struct tiny_layout {
1377 constexpr tiny_layout()
noexcept
1379 _buffer[Capacity] = Capacity;
1382 [[nodiscard]]
constexpr auto data()
noexcept
1384 return _buffer.data();
1387 [[nodiscard]]
constexpr auto data()
const noexcept
1389 return _buffer.data();
1392 [[nodiscard]]
constexpr auto get_size()
const noexcept
1394 return Capacity - size_type(_buffer[Capacity]);
1397 constexpr auto set_size(size_t size)
noexcept
1399 return _buffer[Capacity] = Char(Capacity - size);
1403 etl::
array<Char, Capacity + 1> _buffer{};
1406 struct normal_layout {
1407 constexpr normal_layout()
noexcept =
default;
1409 [[nodiscard]]
constexpr auto data()
noexcept
1411 return _buffer.data();
1414 [[nodiscard]]
constexpr auto data()
const noexcept
1416 return _buffer.data();
1419 [[nodiscard]]
constexpr auto get_size()
const noexcept
1421 return size_t(_size);
1424 constexpr auto set_size(size_t size)
noexcept
1426 return _size = internal_size_t(size);
1430 internal_size_t _size{};
1431 etl::
array<Char, Capacity + 1> _buffer{};
1434 using layout_type =
etl::conditional_t<(Capacity < 16), tiny_layout, normal_layout>;
1435 layout_type _storage{};
1439template <
etl::size_t Capacity>
1443template <
etl::size_t Capacity>
1447template <
etl::size_t Capacity>
1451template <
etl::size_t Capacity>
1455template <
etl::size_t Capacity>
1460template <
typename Char,
typename Traits, size_t Capacity1, size_t Capacity2>
1473template <
typename Char,
typename Traits, size_t Capacity>
1474[[nodiscard]]
constexpr auto
1485template <
typename Char,
typename Traits, size_t Capacity>
1496template <
typename Char,
typename Traits, size_t Capacity>
1497[[nodiscard]]
constexpr auto
1508template <
typename Char,
typename Traits, size_t Capacity>
1522template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1528 return lhs.compare(rhs) == 0;
1536template <
typename Char,
typename Traits,
etl::size_t Capacity>
1537[[nodiscard]]
constexpr auto
1540 return lhs.compare(rhs) == 0;
1548template <
typename Char,
typename Traits,
etl::size_t Capacity>
1549[[nodiscard]]
constexpr auto
1552 return rhs.compare(lhs) == 0;
1560template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1566 return lhs.compare(rhs) != 0;
1574template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1575[[nodiscard]]
constexpr auto
1578 return lhs.compare(rhs) != 0;
1586template <
typename Char,
typename Traits,
etl::size_t Capacity>
1587[[nodiscard]]
constexpr auto
1590 return rhs.compare(lhs) != 0;
1597template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1603 return lhs.compare(rhs) < 0;
1610template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1611[[nodiscard]]
constexpr auto
1614 return lhs.compare(rhs) < 0;
1621template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1622[[nodiscard]]
constexpr auto
1625 return rhs.compare(lhs) > 0;
1632template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1638 return lhs.compare(rhs) <= 0;
1645template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1646[[nodiscard]]
constexpr auto
1649 return lhs.compare(rhs) <= 0;
1656template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1657[[nodiscard]]
constexpr auto
1660 return rhs.compare(lhs) >= 0;
1667template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1673 return lhs.compare(rhs) > 0;
1680template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1681[[nodiscard]]
constexpr auto
1684 return lhs.compare(rhs) > 0;
1691template <
typename Char,
typename Traits,
etl::size_t Capacity1>
1692[[nodiscard]]
constexpr auto
1695 return rhs.compare(lhs) < 0;
1702template <
typename Char,
typename Traits,
etl::size_t Capacity1,
etl::size_t Capacity2>
1708 return lhs.compare(rhs) >= 0;
1715template <
typename Char,
typename Traits,
etl::size_t Capacity>
1716[[nodiscard]]
constexpr auto
1719 return lhs.compare(rhs) >= 0;
1726template <
typename Char,
typename Traits,
etl::size_t Capacity>
1727[[nodiscard]]
constexpr auto
1730 return rhs.compare(lhs) <= 0;
1735template <
typename Char,
typename Traits,
etl::size_t Capacity>
1745template <
typename Char,
typename Traits,
etl::size_t Capacity,
typename U>
1751 auto it =
etl::remove(begin(c), end(c), value);
1752 auto r =
etl::distance(it, end(c));
1753 c.erase(it, end(c));
1754 return static_cast<return_type>(r);
1759template <
typename Char,
typename Traits,
etl::size_t Capacity,
typename Predicate>
1765 auto it =
etl::remove_if(begin(c), end(c), pred);
1766 auto r =
etl::distance(it, end(c));
1767 c.erase(it, end(c));
1768 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:1498
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:1588
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:1693
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:1717
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:1509
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:1538
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:1633
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:1647
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:1682
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:1475
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:1486
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:1550
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:1668
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:1576
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:1736
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:1703
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:1746
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:1623
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:1461
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:1658
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:1523
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:1760
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:1561
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:1728
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:1598
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:1612
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:258
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:1097
constexpr basic_inplace_string(const_pointer str, size_type const len) noexcept
Character pointer constructor.
Definition basic_inplace_string.hpp:69
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:149
constexpr auto operator[](size_type index) noexcept -> reference
Accesses the specified character without bounds checking.
Definition basic_inplace_string.hpp:252
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:177
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:1205
constexpr auto erase(const_iterator position) noexcept -> iterator
Removes the character at position.
Definition basic_inplace_string.hpp:474
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:688
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:1292
constexpr basic_inplace_string(size_type count, Char ch) noexcept
Constructs the string with count copies of character ch.
Definition basic_inplace_string.hpp:87
constexpr auto c_str() const noexcept -> const_pointer
Returns a pointer to a null-terminated character array.
Definition basic_inplace_string.hpp:441
constexpr auto operator+=(basic_inplace_string const &str) noexcept -> basic_inplace_string &
Appends string str.
Definition basic_inplace_string.hpp:582
constexpr auto operator=(Char ch) noexcept -> basic_inplace_string &
Replaces the contents with character ch.
Definition basic_inplace_string.hpp:160
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:1114
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:1338
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:1176
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:1216
constexpr auto front() const noexcept -> const_reference
Accesses the first character.
Definition basic_inplace_string.hpp:349
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:1255
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:700
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:170
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:881
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:315
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:1245
constexpr auto replace(const_iterator first, const_iterator last, size_type count2, Char ch) -> basic_inplace_string &
Definition basic_inplace_string.hpp:956
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:831
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:771
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:1282
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:1129
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:619
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:308
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:1264
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:1082
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:868
static constexpr auto reserve(size_type) -> void
Reserve is a nop, since the capacity is fixed.
Definition basic_inplace_string.hpp:408
constexpr auto resize(size_type count) noexcept -> void
Resizes the string to contain count characters.
Definition basic_inplace_string.hpp:1018
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:731
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:603
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:555
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:970
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:1163
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:221
constexpr basic_inplace_string(const_pointer str) noexcept
Character pointer constructor. Calls traits_type::length.
Definition basic_inplace_string.hpp:78
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:1236
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:185
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:231
constexpr auto back() noexcept -> reference
Accesses the last character.
Definition basic_inplace_string.hpp:356
constexpr auto append(InputIt first, InputIt last) noexcept -> basic_inplace_string &
Appends characters in the range [ first , last ).
Definition basic_inplace_string.hpp:540
constexpr auto ends_with(Char c) const noexcept -> bool
Checks if the string ends with the given prefix.
Definition basic_inplace_string.hpp:855
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:243
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:594
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:1273
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:1301
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:322
constexpr auto begin() noexcept -> iterator
Returns an iterator to the beginning.
Definition basic_inplace_string.hpp:264
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:463
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:627
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:193
constexpr auto ends_with(const_pointer str) const -> bool
Checks if the string ends with the given prefix.
Definition basic_inplace_string.hpp:861
constexpr auto end() noexcept -> iterator
Returns an iterator to the end.
Definition basic_inplace_string.hpp:282
constexpr auto begin() const noexcept -> const_iterator
Returns an const iterator to the beginning.
Definition basic_inplace_string.hpp:270
constexpr auto starts_with(const_pointer s) const -> bool
Checks if the string begins with the given prefix.
Definition basic_inplace_string.hpp:843
constexpr auto cbegin() const noexcept -> const_iterator
Returns an const iterator to the beginning.
Definition basic_inplace_string.hpp:276
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:521
constexpr auto contains(Char c) const noexcept -> bool
Checks if the string contains the given substring.
Definition basic_inplace_string.hpp:1322
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:529
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:1056
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:805
constexpr auto compare(basic_inplace_string const &str) const noexcept -> int
Compares this string to str.
Definition basic_inplace_string.hpp:715
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:1144
constexpr auto contains(Char const *s) const -> bool
Checks if the string contains the given substring.
Definition basic_inplace_string.hpp:1328
constexpr auto push_back(Char ch) noexcept -> void
Appends the given character ch to the end of the string.
Definition basic_inplace_string.hpp:495
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:510
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:1195
constexpr auto replace(size_type pos, size_type count, Char const *str) -> basic_inplace_string &
Definition basic_inplace_string.hpp:925
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:565
constexpr auto empty() const noexcept -> bool
Checks whether the string is empty.
Definition basic_inplace_string.hpp:370
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:762
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:454
constexpr auto pop_back() noexcept -> void
Removes the last character from the string.
Definition basic_inplace_string.hpp:503
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:1185
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:1153
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:419
constexpr auto back() const noexcept -> const_reference
Accesses the last character.
Definition basic_inplace_string.hpp:363
static constexpr bool string_view_like
Definition basic_inplace_string.hpp:44
constexpr auto length() const noexcept -> size_type
Returns the number of characters.
Definition basic_inplace_string.hpp:388
constexpr auto front() noexcept -> reference
Accesses the first character.
Definition basic_inplace_string.hpp:342
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:1069
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:104
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:575
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:1025
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:643
constexpr auto full() const noexcept -> bool
Checks whether the string is full. i.e. size() == capacity()
Definition basic_inplace_string.hpp:376
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:211
static constexpr auto shrink_to_fit() -> void
Shrink to fit is a nop, since the capacity is fixed.
Definition basic_inplace_string.hpp:411
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:849
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:402
constexpr auto operator+=(Char ch) noexcept -> basic_inplace_string &
Appends character ch.
Definition basic_inplace_string.hpp:588
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:817
constexpr auto end() const noexcept -> const_iterator
Returns an const iterator to the end.
Definition basic_inplace_string.hpp:288
constexpr auto starts_with(Char c) const noexcept -> bool
Checks if the string begins with the given prefix.
Definition basic_inplace_string.hpp:837
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:1226
constexpr auto replace(const_iterator first, const_iterator last, Char const *str, size_type count2) -> basic_inplace_string &
Definition basic_inplace_string.hpp:916
constexpr auto replace(size_type pos, size_type count, Char const *str, size_type count2) -> basic_inplace_string &
Definition basic_inplace_string.hpp:905
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:202
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:110
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:130
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:742
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:723
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:336
constexpr auto erase(const_iterator first, const_iterator last) noexcept -> iterator
Removes the characters in the range [first, last).
Definition basic_inplace_string.hpp:483
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:635
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:891
constexpr auto resize(size_type count, Char ch) noexcept -> void
Resizes the string to contain count characters.
Definition basic_inplace_string.hpp:1003
constexpr operator basic_string_view< Char, traits_type >() const noexcept
Returns a etl::basic_string_view.
Definition basic_inplace_string.hpp:447
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:609
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:430
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:783
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:794
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:119
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:1316
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:329
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:1310
constexpr auto append(basic_inplace_string const &str) noexcept -> basic_inplace_string &
Appends string str.
Definition basic_inplace_string.hpp:549
constexpr auto size() const noexcept -> size_type
Returns the number of characters.
Definition basic_inplace_string.hpp:382
constexpr auto cend() const noexcept -> const_iterator
Returns an const iterator to the end.
Definition basic_inplace_string.hpp:294
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:395
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:986
constexpr auto replace(const_iterator first, const_iterator last, Char const *str) -> basic_inplace_string &
Definition basic_inplace_string.hpp:936
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:98
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:301
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:1043
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