xtd 0.2.0
Loading...
Searching...
No Matches
basic_string_builder.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../basic_string.hpp"
8#include "../environment.hpp"
12#include <iterator>
15namespace xtd {
17 namespace text {
35 template<class char_t, class traits_t = std::char_traits<char_t>, class allocator_t = xtd::collections::generic::helpers::allocator<char_t >>
36 class basic_string_builder final : public object, public xtd::iequatable<basic_string_builder<char_t, traits_t, allocator_t>> {
37 public:
39
43 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
45 using traits_type = typename base_type::traits_type;
47 using value_type = typename base_type::value_type;
49 using allocator_type = typename base_type::allocator_type;
51 using size_type = typename base_type::size_type;
53 using difference_type = typename base_type::difference_type;
55 using reference = typename base_type::reference;
57 using const_reference = typename base_type::const_reference;
59 using pointer = typename base_type::pointer;
61 using const_pointer = typename base_type::const_pointer;
64 using iterator = typename base_type::iterator;
67 using const_iterator = typename base_type::const_iterator;
69 using reverse_iterator = typename base_type::reverse_iterator;
71 using const_reverse_iterator = typename base_type::const_reverse_iterator;
73
75
85 inline static constexpr size_type npos = base_type::npos;
86
95 static inline constexpr xtd::size bpos = 0;
96
113 static inline constexpr xtd::size epos = npos - 1;
115
117
125 basic_string_builder() = default;
137 basic_string_builder(xtd::size capacity) {this->capacity(capacity);}
152 basic_string_builder(xtd::size capacity, xtd::size max_capacity) : max_capacity_{max_capacity} {this->capacity(capacity);}
161 basic_string_builder(const xtd::basic_string<value_type>& value) : chars_(value.chars()) {}
173 basic_string_builder(const xtd::basic_string<value_type>& value, xtd::size capacity) : chars_(value.chars()) {this->capacity(capacity);}
190 basic_string_builder(const xtd::basic_string<value_type>& value, xtd::size start_index, xtd::size length, xtd::size capacity) : chars_(value.substring(start_index, length).chars()) {this->capacity(capacity);}
191
194 explicit basic_string_builder(const allocator_type & allocator) noexcept : chars_(allocator) {}
195
198 basic_string_builder(const basic_string_builder & str) noexcept : chars_(str.chars_) {}
202 basic_string_builder(const basic_string_builder & str, const allocator_type & allocator) noexcept : chars_(str.chars_, allocator) {}
203
210 chars_ = base_type(str.chars_, index);
211 }
217 basic_string_builder(const basic_string_builder & str, xtd::size index, const allocator_type & allocator) {
219 chars_ = base_type(str.chars_, index, allocator);
220 }
221
229 chars_ = base_type(str.chars_, index, count);
230 }
237 basic_string_builder(const basic_string_builder & str, xtd::size index, xtd::size count, const allocator_type & allocator) {
239 chars_ = base_type(str.chars_, index, count, allocator);
240 }
241
244 basic_string_builder(basic_string_builder&& str) noexcept : chars_(std::move(str.chars_)) {}
248 basic_string_builder(basic_string_builder&& str, const allocator_type & allocator) noexcept : chars_(std::move(str.chars_), allocator) {}
249
253 basic_string_builder(xtd::size count, value_type character) : chars_(count, character) {}
258 basic_string_builder(xtd::size count, value_type character, const allocator_type & allocator) : chars_(count, character, allocator) {}
259
263 basic_string_builder(value_type character, xtd::size count) : chars_(count, character) {}
268 basic_string_builder(value_type character, xtd::size count, const allocator_type & allocator) : chars_(count, character, allocator) {}
269
272 basic_string_builder(const_pointer str) { // Can't be explicit by design.
274 chars_ = base_type(str);
275 }
279 basic_string_builder(const_pointer str, const allocator_type & allocator) {
281 chars_ = base_type(str, allocator);
282 }
283
286 basic_string_builder(const_pointer str, xtd::size count) {
288 chars_ = base_type(str, count);
289 }
294 basic_string_builder(const_pointer str, xtd::size count, const allocator_type & allocator) : chars_(allocator) {
296 chars_ = base_type(str, count);
297 }
298
301 basic_string_builder(const std::basic_string<value_type>& str) noexcept : chars_(str) {}; // Can't be explicit by design.
305 basic_string_builder(const std::basic_string<value_type>& str, const allocator_type & allocator) noexcept : chars_(str, allocator) {}
306
310 template<class input_iterator_t>
311 basic_string_builder(input_iterator_t first, input_iterator_t last) : chars_(first, last) {}
316 template<class input_iterator_t>
317 basic_string_builder(input_iterator_t first, input_iterator_t last, const allocator_type & allocator) : chars_(first, last, allocator) {}
318
321 basic_string_builder(std::initializer_list<value_type> il) : chars_(il) {}
322
326 basic_string_builder(std::initializer_list<value_type> il, const allocator_type & allocator) : chars_(il, allocator) {}
328
330
335 const_reference back() const {return operator[](size() - 1);}
339 reference back() {return operator[](size() - 1);}
340
343 const_iterator begin() const {return chars_.begin();}
346 iterator begin() {return chars_.begin();}
347
356 const_pointer c_str() const noexcept {return chars_.c_str();}
357
360 size_type capacity() const noexcept {return chars_.capacity();}
363 basic_string_builder & capacity(size_type value) {
364 reserve(value);
365 return *this;
366 }
367
370 const_iterator cbegin() const {return chars_.cbegin();}
371
374 const base_type & chars() const noexcept {return chars_;}
375
378 base_type & chars() noexcept {return chars_;}
379
382 const_iterator cend() const {return chars_.cend();}
383
391 const_pointer data() const noexcept {return chars_.data();}
399 pointer data() noexcept {return chars_.data();}
400
403 bool empty() const noexcept {return chars_.empty();}
404
407 const_iterator end() const {return chars_.end();}
410 iterator end() {return chars_.end();}
411
415 const_reference front() const {return operator[](0);}
419 reference front() {return operator[](0);}
420
428 size_type length() const noexcept {return chars_.size();}
438 basic_string_builder & length(size_type value) noexcept {
439 if (value != length()) resize(value);
440 return *this;
441 }
442
445 size_type max_capacity() const noexcept {return max_capacity_;}
446
449 size_type max_size() const noexcept {return chars_.max_size();}
450
453 size_type size() const noexcept {return chars_.size();}
455
457
478 basic_string_builder & append(const xtd::basic_string<char_t>& value) {return append(basic_string_builder {value});}
510 basic_string_builder & append(const xtd::basic_string<char_t>& value, size_type start_index, size_type count) {return append(basic_string_builder {value, start_index, count});}
529 basic_string_builder & append(xtd::boolean value) {return append_format("{}", value);}
549 basic_string_builder & append(xtd::byte value) {return append_format("{}", value);}
568 basic_string_builder & append(xtd::decimal value) {return append_format("{}", value);}
587 basic_string_builder & append(double value) {return append_format("{}", value);}
606 basic_string_builder & append(xtd::single value) {return append_format("{}", value);}
625 basic_string_builder & append(xtd::int16 value) {return append_format("{}", value);}
644 basic_string_builder & append(xtd::int32 value) {return append_format("{}", value);}
663 basic_string_builder & append(xtd::int64 value) {return append_format("{}", value);}
683 basic_string_builder & append(xtd::sbyte value) {return append_format("{}", value);}
702 basic_string_builder & append(xtd::uint16 value) {return append_format("{}", value);}
721 basic_string_builder & append(xtd::uint32 value) {return append_format("{}", value);}
740 basic_string_builder & append(xtd::uint64 value) {return append_format("{}", value);}
763 basic_string_builder & append(value_type value) {return append(1_z, value);}
783 basic_string_builder & append(value_type value, size_type repeat_count) {return append(repeat_count, value);}
784
786 basic_string_builder & append(xtd::slong value) {return append_format("{}", value);}
787 basic_string_builder & append(xtd::ulong value) {return append_format("{}", value);}
789
800 template<class object_t>
801 basic_string_builder & append(object_t value) {return append_format("{}", value);}
811 basic_string_builder & append(size_type count, value_type ch) {return append(basic_string_builder(count, ch));}
820 basic_string_builder & append(const basic_string_builder & str) {return append(str, 0, str.length());}
832 basic_string_builder & append(const basic_string_builder & str, size_type pos) {return append(str, pos, str.length() - pos);}
845 basic_string_builder & append(const basic_string_builder & str, size_type pos, size_type count) {
847 if (pos > str.size() || pos + count > str.length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
848 chars_.append(str.chars_, pos, count);
849 return *this;
850 }
861 basic_string_builder & append(const_pointer s, size_type count) {return append(basic_string_builder {s, count});}
870 basic_string_builder & append(const_pointer s) {return append(basic_string_builder {s});}
879 template<class input_iterator_t>
880 basic_string_builder & append(input_iterator_t first, input_iterator_t last) {
882 return append(basic_string_builder {first, last});
883 }
892 basic_string_builder & append(std::initializer_list<value_type> ilist) {return append(basic_string_builder {ilist});}
893
913 template<class ...args_t>
914 basic_string_builder & append_format(const xtd::basic_string<char_t>& format, args_t&& ... args) {return append(xtd::basic_string<char_t>::format(format, std::forward<args_t>(args)...));}
915
924 template<class collection_t>
925 basic_string_builder & append_join(const xtd::basic_string<char_t>& separator, const collection_t& values) {return append(xtd::basic_string<char_t>::join(separator, values));}
934 template<class collection_t>
935 basic_string_builder & append_join(value_type separator, const collection_t& values) {return append(xtd::basic_string<char_t>::join(xtd::basic_string<char_t>(1, separator), values));}
936
938 template<class value_t>
939 basic_string_builder & append_join(const xtd::basic_string<char_t>& separator, const std::initializer_list<value_t>& values) {return append_join(separator, xtd::array<value_t>(values));}
940 template<class value_t>
941 basic_string_builder & append_join(value_type separator, const std::initializer_list<value_t>& values) {return append_join(separator, xtd::array<value_t>(values));}
943
958 basic_string_builder & append_line(const xtd::basic_string<char_t>& value) {return append(value).append_line();}
959
963 const_reference at(size_type pos) const {return operator [](pos);}
967 reference at(size_type pos) {return operator [](pos);}
968
974 chars_.clear();
975 return *this;
976 }
977
996 int32 compare(const basic_string_builder & str) const {return chars_.compare(str);}
1018 int32 compare(size_type pos1, size_type count1, const basic_string_builder & str) const {return chars_.compare(pos1, count1, str);}
1042 int32 compare(size_type pos1, size_type count1, const basic_string_builder & str, size_type pos2) const {return chars_.compare(pos1, count1, str, pos2);}
1067 int32 compare(size_type pos1, size_type count1, const basic_string_builder & str, size_type pos2, size_type count2) const {return chars_.compare(pos1, count1, str, pos2, count2);}
1086 int32 compare(const_pointer s) const {return chars_.compare(s);}
1108 int32 compare(size_type pos1, size_type count1, const_pointer s) const {return chars_.compare(pos1, count1, s);}
1131 int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const {return chars_.compare(pos1, count1, s, count2);}
1132
1138 size_type copy(pointer dest, size_type count) const {
1140 return chars_.copy(dest, count);
1141 }
1142
1148 size_type copy(pointer dest, size_type count, size_type pos) const {
1150 return chars_.copy(dest, count, pos);
1151 }
1152
1161 void copy_to(xtd::size source_index, xtd::array<value_type>& destination, xtd::size destination_index, xtd::size destination_count) const {
1162 if (source_index > length() || source_index + destination_count > length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1163 if (destination_index >= destination.size() || destination_index + destination_count > destination.size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1164 copy(destination.data() + destination_index, destination_count, source_index);
1165 }
1166
1170 bool equals(const object & obj) const noexcept override {return dynamic_cast<const basic_string_builder*>(&obj) && equals(static_cast<const basic_string_builder&>(obj));}
1175 bool equals(const basic_string_builder & value) const noexcept override {return chars_ == value.chars_;}
1176
1182 size_type ensure_capacity(size_type capacity) {
1183 if (this->capacity() < capacity) this->capacity(capacity);
1184 return this->capacity();
1185 }
1186
1191 chars_.erase();
1192 return *this;
1193 }
1194
1198 basic_string_builder & erase(size_type index) {
1200 chars_.erase(index);
1201 return *this;
1202 }
1203
1208 basic_string_builder & erase(size_type index, size_type count) {
1210 chars_.erase(index, count);
1211 return *this;
1212 }
1213
1218 iterator erase(const_iterator position) {return chars_.erase(position);}
1225 iterator erase(const_iterator first, const_iterator last) {return chars_.erase(first, last);}
1226
1230 size_type find(const basic_string_builder & str) const {return chars_.find(str);}
1236 size_type find(const basic_string_builder & str, size_type pos) const {return chars_.find(str, pos);}
1244 size_type find(const_pointer s, size_type pos, size_type count) const {return chars_.find(s, pos, count);}
1250 size_type find(const_pointer s) const {return chars_.find(s);}
1257 size_type find(const_pointer s, size_type pos) const {return chars_.find(s, pos);}
1262 size_type find(value_type ch) const {return chars_.find(ch);}
1268 size_type find(value_type ch, size_type pos) const {return chars_.find(ch, pos);}
1269
1274 size_type find_first_of(const basic_string_builder & str) const {return chars_.find_first_of(str);}
1280 size_type find_first_of(const basic_string_builder & str, size_type pos) const {return chars_.find_first_of(str, pos);}
1288 size_type find_first_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_first_of(s, pos, count);}
1294 size_type find_first_of(const_pointer s) const {return chars_.find_first_of(s);}
1301 size_type find_first_of(const_pointer s, size_type pos) const {return chars_.find_first_of(s, pos);}
1306 size_type find_first_of(value_type ch) const {return chars_.find_first_of(ch);}
1312 size_type find_first_of(value_type ch, size_type pos) const {return chars_.find_first_of(ch, pos);}
1313
1318 size_type find_first_not_of(const basic_string_builder & str) const {return chars_.find_first_not_of(str);}
1324 size_type find_first_not_of(const basic_string_builder & str, size_type pos) const {return chars_.find_first_not_of(str, pos);}
1332 size_type find_first_not_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_first_not_of(s, pos, count);}
1338 size_type find_first_not_of(const_pointer s) const {return chars_.find_first_not_of(s);}
1345 size_type find_first_not_of(const_pointer s, size_type pos) const {return chars_.find_first_not_of(s, pos);}
1350 size_type find_first_not_of(value_type ch) const {return chars_.find_first_not_of(ch);}
1356 size_type find_first_not_of(value_type ch, size_type pos) const {return chars_.find_first_not_of(ch, pos);}
1357
1362 size_type find_last_of(const basic_string_builder & str) const {return chars_.find_last_of(str);}
1368 size_type find_last_of(const basic_string_builder & str, size_type pos) const {return chars_.find_last_of(str, pos);}
1376 size_type find_last_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_last_of(s, pos, count);}
1382 size_type find_last_of(const_pointer s) const {return chars_.find_last_of(s);}
1389 size_type find_last_of(const_pointer s, size_type pos) const {return chars_.find_last_of(s, pos);}
1394 size_type find_last_of(value_type ch) const {return chars_.find_last_of(ch);}
1400 size_type find_last_of(value_type ch, size_type pos) const {return chars_.find_last_of(ch, pos);}
1401
1406 size_type find_last_not_of(const basic_string_builder & str) const {return chars_.find_last_not_of(str);}
1412 size_type find_last_not_of(const basic_string_builder & str, size_type pos) const {return chars_.find_last_not_of(str, pos);}
1420 size_type find_last_not_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_last_not_of(s, pos, count);}
1426 size_type find_last_not_of(const_pointer s) const {return chars_.find_last_not_of(s);}
1433 size_type find_last_not_of(const_pointer s, size_type pos) const {return chars_.find_last_not_of(s, pos);}
1438 size_type find_last_not_of(value_type ch) const {return chars_.find_last_not_of(ch);}
1444 size_type find_last_not_of(value_type ch, size_type pos) const {return chars_.find_last_not_of(ch, pos);}
1445
1448 allocator_type get_allocator() const {return chars_.get_allocator();}
1449
1452 virtual const base_type & get_base_type() const noexcept {return chars_;}
1453
1456 xtd::size get_hash_code() const noexcept override {return xtd::hash_code::combine(chars_);}
1457
1467 basic_string_builder & insert(size_type index, const xtd::basic_string<char_t>& value) {return insert(index, basic_string_builder {value}, 0, value.length());}
1478 basic_string_builder & insert(size_type index, const xtd::basic_string<char_t>& value, size_type count) {return insert(index, basic_string_builder {value}, 0, count);}
1488 basic_string_builder & insert(size_type index, xtd::boolean value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1498 basic_string_builder & insert(size_type index, xtd::byte value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1508 basic_string_builder & insert(size_type index, xtd::decimal value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1518 basic_string_builder & insert(size_type index, double value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1528 basic_string_builder & insert(size_type index, xtd::single value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1538 basic_string_builder & insert(size_type index, xtd::int16 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1548 basic_string_builder & insert(size_type index, xtd::int32 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1558 basic_string_builder & insert(size_type index, xtd::int64 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1568 basic_string_builder & insert(size_type index, xtd::sbyte value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1578 basic_string_builder & insert(size_type index, xtd::uint16 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1588 basic_string_builder & insert(size_type index, xtd::uint32 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1598 basic_string_builder & insert(size_type index, xtd::uint64 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1608 basic_string_builder & insert(size_type index, value_type value) {return insert(index, 1, value);}
1619 basic_string_builder & insert(size_type index, value_type value, size_type repeat_count) {return insert(index, repeat_count, value);}
1620
1622 basic_string_builder & insert(size_type index, xtd::slong value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1623 basic_string_builder & insert(size_type index, xtd::ulong value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1625
1636 template<class object_t>
1637 basic_string_builder & insert(size_type index, object_t value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1645 basic_string_builder & insert(size_type index, size_type count, value_type ch) {
1648 chars_.insert(index, count, ch);
1649 return *this;
1650 }
1651
1657 basic_string_builder & insert(size_type index, const_pointer s) {return insert(index, basic_string_builder(s));}
1665 basic_string_builder & insert(size_type index, const_pointer s, size_type count) {return insert(index, basic_string_builder(s, count));}
1672 basic_string_builder & insert(size_type index, const basic_string_builder & str) {return insert(index, str, 0, str.length());}
1681 basic_string_builder & insert(size_type index, const basic_string_builder & str, size_type s_index, size_type count) {
1684 if (s_index > str.size() || s_index + count > str.length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1685 chars_.insert(index, str.chars_, s_index, count);
1686 return *this;
1687 }
1688
1695 basic_string_builder & insert(size_type index, const basic_string_builder & str, size_type s_index) {return insert(index, str.chars_, s_index, str.length() - s_index);}
1702 iterator insert(const_iterator pos, value_type ch) {return insert(pos, 1, ch);}
1710 iterator insert(const_iterator pos, size_type count, value_type ch) {
1711 if (static_cast<size_type>(std::distance(cbegin(), pos)) > length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1713 return chars_.insert(pos, count, ch);
1714 }
1723 template<class input_iterator_t>
1724 iterator insert(const_iterator pos, input_iterator_t first, input_iterator_t last) {
1727 return chars_.insert(pos, first, last);
1728 }
1735 iterator insert(const_iterator pos, std::initializer_list<value_type> ilist) {
1737 return chars_.insert(pos, ilist);
1738 }
1739
1742 void pop_back() {chars_.pop_back();}
1743
1746 void push_back(value_type ch) {chars_.push_back(ch);}
1747
1755 basic_string_builder & remove(size_type start_index, size_type length) {return erase(start_index, length);}
1756
1762 basic_string_builder & replace(value_type old_char, value_type new_char) noexcept {return replace(old_char, new_char, 0, length());}
1770 basic_string_builder & replace(value_type old_char, value_type new_char, size_type start_index, size_type count) {return replace(xtd::basic_string<char_t>(1, old_char), xtd::basic_string<char_t>(1, new_char), start_index, count);}
1777 basic_string_builder & replace(const xtd::basic_string<char_t>& old_value, const xtd::basic_string<char_t>& new_value) noexcept {return replace(old_value, new_value, 0, length());}
1786 basic_string_builder & replace(const xtd::basic_string<char_t>& old_value, const xtd::basic_string<char_t>& new_value, size_type start_index, size_type count) {
1788 auto old_size = old_value.length();
1789 auto new_size = new_value.length();
1790 auto index = xtd::size {0};
1791 while (true) {
1792 index = find(old_value, index);
1793 if (index == npos || index >= start_index + count) break;
1794 if (index >= start_index) {
1795 if (old_size == new_size) replace(index, old_size, new_value);
1796 else {
1797 erase(index, old_value.length());
1798 insert(index, new_value);
1799 }
1800 }
1801 index += new_value.length();
1802 }
1803 return *this;
1804 }
1805
1812 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str) {
1814 chars_.replace(pos, count, str);
1815 return *this;
1816 }
1824 basic_string_builder & replace(const_iterator first, const_iterator last, const basic_string_builder & str) {
1825 chars_.replace(first, last, str);
1826 return *this;
1827 }
1828
1835 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str, size_type pos2) {
1838 chars_.replace(pos, count, str, pos2);
1839 return *this;
1840 }
1841
1849 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str, size_type pos2, size_type count2) {
1851 if (pos2 > str.size() || pos2 + count2 > str.size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1852 chars_.replace(pos, count, str, pos2, count2);
1853 return *this;
1854 }
1855
1862 basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr, size_type count2) {
1864 chars_.replace(pos, count, cstr, count2);
1865 return *this;
1866 }
1867
1876 basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr, size_type count2) {
1877 chars_.replace(first, last, cstr, count2);
1878 return *this;
1879 }
1886 basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr) {
1887 chars_.replace(pos, count, cstr);
1888 return *this;
1889 }
1896 basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr) {
1897 chars_.replace(first, last, cstr);
1898 return *this;
1899 }
1900
1906 basic_string_builder & replace(size_type pos, size_type count, size_type count2, value_type ch) {
1908 chars_.replace(pos, count, count2, ch);
1909 return *this;
1910 }
1911
1918 basic_string_builder & replace(const_iterator first, const_iterator last, size_type count2, value_type ch) {
1919 chars_.replace(first, last, count2, ch);
1920 return *this;
1921 }
1930 template<class input_iterator_t>
1931 basic_string_builder & replace(const_iterator first, const_iterator last, input_iterator_t first2, input_iterator_t last2) {
1932 chars_.replace(first, last, first2, last2);
1933 return *this;
1934 }
1935
1942 basic_string_builder & replace(const_iterator first, const_iterator last, std::initializer_list<value_type> ilist) {
1943 chars_.replace(first, last, ilist);
1944 return *this;
1945 }
1946
1952 void reserve(size_type new_cap) {
1954 if (new_cap <= capacity()) return;
1955 chars_.reserve(new_cap);
1956 }
1957
1962 void resize(size_type count) {chars_.resize(count);}
1968 void resize(size_type count, value_type ch) {chars_.resize(count, ch);}
1969
1973 size_type rfind(const basic_string_builder & str) const {return chars_.rfind(str);}
1979 size_type rfind(const basic_string_builder & str, size_type pos) const {return chars_.rfind(str, pos);}
1987 size_type rfind(const_pointer s, size_type pos, size_type count) const {return chars_.rfind(s, pos, count);}
1993 size_type rfind(const_pointer s) const {return chars_.rfind(s);}
2000 size_type rfind(const_pointer s, size_type pos) const {return chars_.rfind(s, pos);}
2005 size_type rfind(value_type ch) const {return chars_.rfind(ch);}
2011 size_type rfind(value_type ch, size_type pos) const {return chars_.rfind(ch, pos);}
2012
2016 void shrink_to_fit() {chars_.shrink_to_fit();}
2017
2022 basic_string_builder substr() const {return chars_.substr();}
2028 basic_string_builder substr(size_type pos) const {
2030 return chars_.substr(pos);
2031 }
2032
2038 basic_string_builder substr(size_type pos, size_type count) const {
2040 return chars_.substr(pos, count);
2041 }
2042
2045 void swap(basic_string_builder & other) noexcept {chars_.swap(other.chars_);}
2046
2050 //xtd::string to_string() const noexcept override {return __xtd_convert_to_string<char>(chars_);}
2051 xtd::string to_string() const noexcept override {return xtd::string {chars_};}
2053
2055
2057
2059
2061
2067 const_reference operator [](xtd::size index) const {
2069 return chars_[index == epos ? length() - 1 : index];
2070 }
2071
2075 reference operator [](xtd::size index) {
2077 return chars_[index == epos ? length() - 1 : index];
2078 }
2079
2082 operator const base_type & () const noexcept {return chars_;}
2085 operator base_type & () noexcept {return chars_;}
2086
2091 chars_ = str.chars_;
2092 return *this;
2093 }
2094
2099 chars_ = std::move(str.chars_);
2100 return *this;
2101 }
2102
2106 basic_string_builder& operator =(const std::basic_string<value_type>& str) noexcept {
2107 chars_ = str;
2108 return *this;
2109 }
2110
2114 basic_string_builder& operator =(std::basic_string<value_type>&& str) noexcept {
2115 chars_ = std::move(str);
2116 return *this;
2117 }
2118
2123 chars_ = str;
2124 return *this;
2125 }
2126
2131 chars_ = std::move(str);
2132 return *this;
2133 }
2134
2139 basic_string_builder& operator =(const_pointer str) {
2141 chars_ = str;
2142 return *this;
2143 }
2144
2148 basic_string_builder& operator =(value_type character) {
2149 chars_ = character;
2150 return *this;
2151 }
2152
2156 basic_string_builder& operator =(const std::initializer_list<value_type>& il) {
2157 chars_ = il;
2158 return *this;
2159 }
2160
2165 chars_ += str.chars_;
2166 return *this;
2167 }
2168
2173 chars_ += std::move(str.chars_);
2174 str.chars_.clear();
2175 return *this;
2176 }
2177
2181 basic_string_builder & operator +=(const_pointer str) {
2183 chars_ += str;
2184 return *this;
2185 }
2186
2191 chars_ += ch;
2192 return *this;
2193 }
2194
2200 auto result = lhs;
2201 result += rhs;
2202 return result;
2203 }
2204
2210 auto result = std::move(lhs);
2211 result += std::move(rhs);
2212 return result;
2213 }
2214
2220 auto result = std::move(lhs);
2221 result += rhs;
2222 return result;
2223 }
2224
2230 auto result = lhs;
2231 result += std::move(rhs);
2232 return result;
2233 }
2234
2239 friend basic_string_builder operator +(const basic_string_builder & lhs, const_pointer rhs) {
2240 auto result = lhs;
2241 result += rhs;
2242 return result;
2243 }
2244
2249 friend basic_string_builder operator +(basic_string_builder&& lhs, const_pointer rhs) {
2250 auto result = std::move(lhs);
2251 result += rhs;
2252 return result;
2253 }
2254
2259 friend basic_string_builder operator +(const_pointer lhs, const basic_string_builder & rhs) {
2260 return lhs + rhs.chars_;
2261 }
2262
2267 friend basic_string_builder operator +(const_pointer lhs, basic_string_builder&& rhs) {
2268 return lhs + std::move(rhs).chars_;
2269 }
2270
2276 auto result = lhs;
2277 result += rhs;
2278 return result;
2279 }
2280
2286 auto result = std::move(lhs);
2287 result += rhs;
2288 return result;
2289 }
2290
2295 friend basic_string_builder operator +(value_type lhs, const basic_string_builder & rhs) {
2296 auto result = basic_string_builder(1, lhs);
2297 result += rhs;
2298 return result;
2299 }
2300
2306 auto result = basic_string_builder(1, lhs);
2307 result += std::move(rhs);
2308 return result;
2309 }
2310
2319 //friend std::basic_ostream<char>& operator <<(std::basic_ostream<char>& stream, const basic_string_builder& str) {return stream << str.to_string().chars_;}
2320 friend std::basic_ostream<char>& operator <<(std::basic_ostream<char>& stream, const basic_string_builder & str) {return stream << xtd::basic_string<char>(str.chars()).chars();}
2327 friend std::basic_ostream<xtd::wchar>& operator <<(std::basic_ostream<xtd::wchar>& stream, const basic_string_builder & str) {return stream << xtd::basic_string<xtd::wchar>(str.chars()).chars();}
2328
2337 friend std::basic_istream<char>& operator >>(std::basic_istream<char>& stream, basic_string_builder & str) {
2338 auto s = std::basic_string<char> {};
2339 stream >> s;
2340 str = xtd::basic_string<value_type>(s).chars();
2341 return stream;
2342 }
2343
2351 friend std::basic_istream<xtd::wchar>& operator >>(std::basic_istream<xtd::wchar>& stream, basic_string_builder & str) {
2352 auto s = std::basic_string<xtd::wchar> {};
2353 stream >> s;
2354 str = xtd::basic_string<value_type>(s).chars();
2355 return stream;
2356 }
2357
2358
2359 private:
2360 base_type chars_;
2361 size_type max_capacity_ = chars_.max_size();
2362 };
2363 }
2364}
Contains xtd::argument_exception exception.
Contains xtd::argument_out_of_range_exception exception.
Contains xtd::basic_string class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:63
virtual pointer data() noexcept
Returns pointer to the underlying array serving as element storage.
Definition basic_array.hpp:144
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.hpp:70
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
object()=default
Create a new instance of the ultimate base class object.
Represents a mutable string of characters. This class cannot be inherited.
Definition basic_string_builder.hpp:36
size_type find_first_of(const basic_string_builder &str, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1280
size_type find_first_of(value_type ch, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1312
basic_string_builder & operator+=(const basic_string_builder &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string_builder.hpp:2164
size_type find_last_not_of(value_type ch) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1438
iterator erase(const_iterator position)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1218
bool equals(const basic_string_builder &value) const noexcept override
Determines whether this instance and another specified xtd::text::basic_string_builder object have th...
Definition basic_string_builder.hpp:1175
basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder &str, size_type pos2)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1835
size_type find_first_of(const_pointer s) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1294
basic_string_builder & replace(const_iterator first, const_iterator last, input_iterator_t first2, input_iterator_t last2)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1931
size_type find_first_of(const basic_string_builder &str) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1274
basic_string_builder & insert(size_type index, xtd::uint16 value)
Inserts the string representation of a specified 16-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.hpp:1578
size_type find_last_of(const basic_string_builder &str) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1362
basic_string_builder substr() const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string_builder.hpp:2022
size_type find_first_of(value_type ch) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1306
basic_string_builder & insert(size_type index, double value)
Inserts the string representation of a specified double into this instance at the specified character...
Definition basic_string_builder.hpp:1518
size_type find(value_type ch) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.hpp:1262
friend std::basic_istream< char > & operator>>(std::basic_istream< char > &stream, basic_string_builder &str)
Input stream operator. Behaves as a FormattedInputFunction. After constructing and checking the sentr...
Definition basic_string_builder.hpp:2337
basic_string_builder & operator=(const basic_string_builder &str) noexcept
Copy assignment operator. Replaces the contents with a copy of the contents of str.
Definition basic_string_builder.hpp:2090
basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr, size_type count2)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1862
size_type find_first_not_of(value_type ch, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1356
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string_builder.hpp:1452
size_type rfind(value_type ch) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::tex...
Definition basic_string_builder.hpp:2005
size_type find_first_not_of(value_type ch) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1350
basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1896
size_type find_last_not_of(const_pointer s) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1426
basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder &str, size_type pos2, size_type count2)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1849
size_type find(const_pointer s, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.hpp:1257
size_type find_last_of(value_type ch) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1394
basic_string_builder & insert(size_type index, xtd::decimal value)
Inserts the string representation of a specified 8decimal into this instance at the specified charact...
Definition basic_string_builder.hpp:1508
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string_builder.hpp:2067
void shrink_to_fit()
Requests the removal of unused capacity.
Definition basic_string_builder.hpp:2016
basic_string_builder substr(size_type pos, size_type count) const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string_builder.hpp:2038
iterator erase(const_iterator first, const_iterator last)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1225
size_type find_last_of(const_pointer s) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1382
basic_string_builder & insert(size_type index, value_type value, size_type repeat_count)
Inserts a specified number of copies of the string representation of a Unicode character to this inst...
Definition basic_string_builder.hpp:1619
size_type find_last_not_of(value_type ch, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1444
basic_string_builder & insert(size_type index, size_type count, value_type ch)
Inserts characters into the string.
Definition basic_string_builder.hpp:1645
size_type rfind(const basic_string_builder &str, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string_builder.hpp:1979
size_type find_first_of(const_pointer s, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1301
size_type find_first_not_of(const_pointer s) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1338
size_type find_first_not_of(const_pointer s, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1345
size_type find_last_not_of(const basic_string_builder &str) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1406
basic_string_builder & erase()
Removes specified characters from the string.
Definition basic_string_builder.hpp:1190
size_type find_first_of(const_pointer s, size_type pos, size_type count) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.hpp:1288
size_type find_last_of(const_pointer s, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1389
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string_builder.
Definition basic_string_builder.hpp:1456
size_type find_first_not_of(const basic_string_builder &str, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1324
basic_string_builder & insert(size_type index, const basic_string_builder &str, size_type s_index, size_type count)
Inserts characters into the string.
Definition basic_string_builder.hpp:1681
size_type copy(pointer dest, size_type count, size_type pos) const
Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substr...
Definition basic_string_builder.hpp:1148
size_type find_last_of(const basic_string_builder &str, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1368
basic_string_builder & insert(size_type index, xtd::boolean value)
Inserts the string representation of a boolean value into this instance at the specified character po...
Definition basic_string_builder.hpp:1488
size_type find_first_not_of(const basic_string_builder &str) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1318
basic_string_builder & insert(size_type index, value_type value)
Inserts the string representation of a specified Unicode character into this instance at the specifie...
Definition basic_string_builder.hpp:1608
basic_string_builder & replace(const_iterator first, const_iterator last, const basic_string_builder &str)
Replaces, within a substring of this instance, all occurrences of a specified string with another spe...
Definition basic_string_builder.hpp:1824
size_type find_last_not_of(const basic_string_builder &str, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1412
basic_string_builder & insert(size_type index, xtd::uint64 value)
Inserts the string representation of a specified 64-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.hpp:1598
size_type find(const_pointer s, size_type pos, size_type count) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.hpp:1244
xtd::string to_string() const noexcept override
Converts the value of this instance to a xtd::text::basic_string_builder <char>.
Definition basic_string_builder.hpp:2051
friend std::basic_ostream< char > & operator<<(std::basic_ostream< char > &stream, const basic_string_builder &str)
Output stream operator. Behaves as a FormattedOutputFunction. After constructing and checking the sen...
Definition basic_string_builder.hpp:2320
basic_string_builder & replace(const xtd::basic_string< char_t > &old_value, const xtd::basic_string< char_t > &new_value) noexcept
Inserts characters into the string.
Definition basic_string_builder.hpp:1777
basic_string_builder & insert(size_type index, object_t value)
Inserts the string representation of a specified object into this instance at the specified character...
Definition basic_string_builder.hpp:1637
basic_string_builder & insert(size_type index, xtd::int32 value)
Inserts the string representation of a specified 32-bit signed integer into this instance at the spec...
Definition basic_string_builder.hpp:1548
basic_string_builder & replace(size_type pos, size_type count, size_type count2, value_type ch)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1906
size_type rfind(const_pointer s, size_type pos, size_type count) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string_builder.hpp:1987
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string_builder.hpp:1131
size_type find_last_not_of(const_pointer s, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1433
void swap(basic_string_builder &other) noexcept
Exchanges the contents of the string with those of other. All iterators and references may be invalid...
Definition basic_string_builder.hpp:2045
size_type find(const_pointer s) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.hpp:1250
basic_string_builder substr(size_type pos) const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string_builder.hpp:2028
basic_string_builder & erase(size_type index)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1198
void copy_to(xtd::size source_index, xtd::array< value_type > &destination, xtd::size destination_index, xtd::size destination_count) const
Copies the characters from a specified segment of this instance to a specified segment of a destinati...
Definition basic_string_builder.hpp:1161
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string_builder.hpp:1448
basic_string_builder & insert(size_type index, xtd::byte value)
Inserts the string representation of a specified 8-bit unsigned integer into this instance at the spe...
Definition basic_string_builder.hpp:1498
basic_string_builder & erase(size_type index, size_type count)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1208
size_type ensure_capacity(size_type capacity)
Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specifi...
Definition basic_string_builder.hpp:1182
basic_string_builder & insert(size_type index, xtd::sbyte value)
Inserts the string representation of a specified 8-bit signed integer into this instance at the speci...
Definition basic_string_builder.hpp:1568
basic_string_builder & insert(size_type index, const xtd::basic_string< char_t > &value, size_type count)
Inserts one or more copies of a specified string into this instance at the specified character positi...
Definition basic_string_builder.hpp:1478
size_type find(const basic_string_builder &str, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.hpp:1236
size_type find_first_not_of(const_pointer s, size_type pos, size_type count) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1332
size_type find(value_type ch, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.hpp:1268
friend basic_string_builder operator+(const basic_string_builder &lhs, const basic_string_builder &rhs)
Addition operator. Returns a string containing characters from lhs followed by the characters from rh...
Definition basic_string_builder.hpp:2199
basic_string_builder & insert(size_type index, const xtd::basic_string< char_t > &value)
Inserts a string into this instance at the specified character position.
Definition basic_string_builder.hpp:1467
size_type rfind(value_type ch, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string_builder.hpp:2011
size_type find_last_not_of(const_pointer s, size_type pos, size_type count) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string_builder.hpp:1420
size_type find(const basic_string_builder &str) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.hpp:1230
size_type copy(pointer dest, size_type count) const
Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substr...
Definition basic_string_builder.hpp:1138
basic_string_builder & insert(size_type index, xtd::uint32 value)
Inserts the string representation of a specified 32-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.hpp:1588
basic_string_builder & insert(size_type index, xtd::int64 value)
Inserts the string representation of a specified 64-bit signed integer into this instance at the spec...
Definition basic_string_builder.hpp:1558
basic_string_builder & insert(size_type index, xtd::int16 value)
Inserts the string representation of a specified 16-bit signed integer into this instance at the spec...
Definition basic_string_builder.hpp:1538
basic_string_builder & insert(size_type index, xtd::single value)
Inserts the string representation of a specified single into this instance at the specified character...
Definition basic_string_builder.hpp:1528
size_type find_last_of(const_pointer s, size_type pos, size_type count) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1376
size_type find_last_of(value_type ch, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.hpp:1400
bool equals(const object &obj) const noexcept override
Determines whether this instance and a specified object, which must also be a xtd::text::basic_string...
Definition basic_string_builder.hpp:1170
size_type rfind(const basic_string_builder &str) const
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.hpp:1973
Contains xtd::environment class.
xtd::string format(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:20
@ index_out_of_range
The index is out of range.
Definition exception_case.hpp:59
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
@ null_pointer
The pointer is null.
Definition exception_case.hpp:77
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
constexpr xtd::size npos
Represents a value that is not a valid position in a collection.
Definition npos.hpp:26
constexpr xtd::size epos
Represents the index of the last valid element in a collection.
Definition epos.hpp:33
constexpr xtd::size bpos
Represents the index of the firsy valid element in a collection.
Definition bpos.hpp:25
std::int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.hpp:27
null_ptr null
Represents a null pointer value.
std::int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
bool boolean
Represents a boolean.
Definition boolean.hpp:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.hpp:27
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
std::uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
std::int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
std::uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
std::uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
float single
Represents a single-precision floating-point number.
Definition single.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
@ clear
The CLEAR key.
Definition console_key.hpp:26
@ s
The S key.
Definition console_key.hpp:124
@ separator
The Separator key.
Definition console_key.hpp:172
@ insert
The INS (INSERT) key.
Definition console_key.hpp:62
size_type
Specifies how rows or columns of user interface (UI) elements should be sized relative to their conta...
Definition size_type.hpp:22
Contains xtd::index_out_of_range_exception exception.
virtual bool remove(const type_t &item)=0
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const_reference front() const
Gets the first element.
Definition read_only_span.hpp:218
const_iterator begin() const
Returns an iterator to the beginning.
Definition read_only_span.hpp:183
const_iterator cbegin() const
Returns an iterator to the beginning.
Definition read_only_span.hpp:187
read_only_span< type_t, count > first() const
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:282
const_iterator end() const
Returns an iterator to the end.
Definition read_only_span.hpp:213
read_only_span< type_t, count > last() const
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:307
const_iterator cend() const
Returns an iterator to the end.
Definition read_only_span.hpp:190
const_reference at(size_type pos) const
Gets the specified element with bounds checking.
Definition read_only_span.hpp:255
constexpr size_type length() const noexcept
Returns the length of the current read_only_span.
Definition read_only_span.hpp:229
const_reference back() const
Gets the last element.
Definition read_only_span.hpp:176
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::null_pointer_exception exception.
Contains xtd numeric literals.