xtd 0.2.0
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
78 inline static constexpr size_type npos = base_type::npos;
80
82
90 basic_string_builder() = default;
102 basic_string_builder(xtd::size capacity) {this->capacity(capacity);}
117 basic_string_builder(xtd::size capacity, xtd::size max_capacity) : max_capacity_{max_capacity} {this->capacity(capacity);}
126 basic_string_builder(const xtd::basic_string<value_type>& value) : chars_(value.chars()) {}
138 basic_string_builder(const xtd::basic_string<value_type>& value, xtd::size capacity) : chars_(value.chars()) {this->capacity(capacity);}
155 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);}
156
159 explicit basic_string_builder(const allocator_type & allocator) noexcept : chars_(allocator) {}
160
163 basic_string_builder(const basic_string_builder & str) noexcept : chars_(str.chars_) {}
167 basic_string_builder(const basic_string_builder & str, const allocator_type & allocator) noexcept : chars_(str.chars_, allocator) {}
168
175 chars_ = base_type(str.chars_, index);
176 }
182 basic_string_builder(const basic_string_builder & str, xtd::size index, const allocator_type & allocator) {
184 chars_ = base_type(str.chars_, index, allocator);
185 }
186
194 chars_ = base_type(str.chars_, index, count);
195 }
202 basic_string_builder(const basic_string_builder & str, xtd::size index, xtd::size count, const allocator_type & allocator) {
204 chars_ = base_type(str.chars_, index, count, allocator);
205 }
206
209 basic_string_builder(basic_string_builder&& str) noexcept : chars_(std::move(str.chars_)) {}
213 basic_string_builder(basic_string_builder&& str, const allocator_type & allocator) noexcept : chars_(std::move(str.chars_), allocator) {}
214
218 basic_string_builder(xtd::size count, value_type character) : chars_(count, character) {}
223 basic_string_builder(xtd::size count, value_type character, const allocator_type & allocator) : chars_(count, character, allocator) {}
224
228 basic_string_builder(value_type character, xtd::size count) : chars_(count, character) {}
233 basic_string_builder(value_type character, xtd::size count, const allocator_type & allocator) : chars_(count, character, allocator) {}
234
237 basic_string_builder(const_pointer str) { // Can't be explicit by design.
239 chars_ = base_type(str);
240 }
244 basic_string_builder(const_pointer str, const allocator_type & allocator) {
246 chars_ = base_type(str, allocator);
247 }
248
251 basic_string_builder(const_pointer str, xtd::size count) {
253 chars_ = base_type(str, count);
254 }
259 basic_string_builder(const_pointer str, xtd::size count, const allocator_type & allocator) : chars_(allocator) {
261 chars_ = base_type(str, count);
262 }
263
266 basic_string_builder(const std::basic_string<value_type>& str) noexcept : chars_(str) {}; // Can't be explicit by design.
270 basic_string_builder(const std::basic_string<value_type>& str, const allocator_type & allocator) noexcept : chars_(str, allocator) {}
271
275 template<class input_iterator_t>
276 basic_string_builder(input_iterator_t first, input_iterator_t last) : chars_(first, last) {}
281 template<class input_iterator_t>
282 basic_string_builder(input_iterator_t first, input_iterator_t last, const allocator_type & allocator) : chars_(first, last, allocator) {}
283
286 basic_string_builder(std::initializer_list<value_type> il) : chars_(il) {}
287
291 basic_string_builder(std::initializer_list<value_type> il, const allocator_type & allocator) : chars_(il, allocator) {}
293
295
300 const_reference back() const {return operator[](size() - 1);}
304 reference back() {return operator[](size() - 1);}
305
308 const_iterator begin() const {return chars_.begin();}
311 iterator begin() {return chars_.begin();}
312
321 const_pointer c_str() const noexcept {return chars_.c_str();}
322
325 size_type capacity() const noexcept {return chars_.capacity();}
328 basic_string_builder & capacity(size_type value) {
329 reserve(value);
330 return *this;
331 }
332
335 const_iterator cbegin() const {return chars_.cbegin();}
336
339 const base_type & chars() const noexcept {return chars_;}
340
343 base_type & chars() noexcept {return chars_;}
344
347 const_iterator cend() const {return chars_.cend();}
348
356 const_pointer data() const noexcept {return chars_.data();}
364 pointer data() noexcept {return chars_.data();}
365
368 bool empty() const noexcept {return chars_.empty();}
369
372 const_iterator end() const {return chars_.end();}
375 iterator end() {return chars_.end();}
376
380 const_reference front() const {return operator[](0);}
384 reference front() {return operator[](0);}
385
393 size_type length() const noexcept {return chars_.size();}
403 basic_string_builder & length(size_type value) noexcept {
404 if (value != length()) resize(value);
405 return *this;
406 }
407
410 size_type max_capacity() const noexcept {return max_capacity_;}
411
414 size_type max_size() const noexcept {return chars_.max_size();}
415
418 size_type size() const noexcept {return chars_.size();}
420
422
443 basic_string_builder & append(const xtd::basic_string<char_t>& value) {return append(basic_string_builder {value});}
475 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});}
494 basic_string_builder & append(xtd::boolean value) {return append_format("{}", value);}
514 basic_string_builder & append(xtd::byte value) {return append_format("{}", value);}
533 basic_string_builder & append(xtd::decimal value) {return append_format("{}", value);}
552 basic_string_builder & append(double value) {return append_format("{}", value);}
571 basic_string_builder & append(xtd::single value) {return append_format("{}", value);}
590 basic_string_builder & append(xtd::int16 value) {return append_format("{}", value);}
609 basic_string_builder & append(xtd::int32 value) {return append_format("{}", value);}
628 basic_string_builder & append(xtd::int64 value) {return append_format("{}", value);}
648 basic_string_builder & append(xtd::sbyte value) {return append_format("{}", value);}
667 basic_string_builder & append(xtd::uint16 value) {return append_format("{}", value);}
686 basic_string_builder & append(xtd::uint32 value) {return append_format("{}", value);}
705 basic_string_builder & append(xtd::uint64 value) {return append_format("{}", value);}
728 basic_string_builder & append(value_type value) {return append(1_z, value);}
748 basic_string_builder & append(value_type value, size_type repeat_count) {return append(repeat_count, value);}
749
751 basic_string_builder & append(xtd::slong value) {return append_format("{}", value);}
752 basic_string_builder & append(xtd::ulong value) {return append_format("{}", value);}
754
765 template<class object_t>
766 basic_string_builder & append(object_t value) {return append_format("{}", value);}
776 basic_string_builder & append(size_type count, value_type ch) {return append(basic_string_builder(count, ch));}
785 basic_string_builder & append(const basic_string_builder & str) {return append(str, 0, str.length());}
797 basic_string_builder & append(const basic_string_builder & str, size_type pos) {return append(str, pos, str.length() - pos);}
810 basic_string_builder & append(const basic_string_builder & str, size_type pos, size_type count) {
812 if (pos > str.size() || pos + count > str.length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);;
813 chars_.append(str.chars_, pos, count);
814 return *this;
815 }
826 basic_string_builder & append(const_pointer s, size_type count) {return append(basic_string_builder {s, count});}
835 basic_string_builder & append(const_pointer s) {return append(basic_string_builder {s});}
844 template<class input_iterator_t>
845 basic_string_builder & append(input_iterator_t first, input_iterator_t last) {
847 return append(basic_string_builder {first, last});
848 }
857 basic_string_builder & append(std::initializer_list<value_type> ilist) {return append(basic_string_builder {ilist});}
858
878 template<class ...args_t>
879 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)...));}
880
889 template<class collection_t>
890 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));}
899 template<class collection_t>
900 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));}
901
903 template<class value_t>
904 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));}
905 template<class value_t>
906 basic_string_builder & append_join(value_type separator, const std::initializer_list<value_t>& values) {return append_join(separator, xtd::array<value_t>(values));}
908
923 basic_string_builder & append_line(const xtd::basic_string<char_t>& value) {return append(value).append_line();}
924
928 const_reference at(size_type pos) const {return operator [](pos);}
932 reference at(size_type pos) {return operator [](pos);}
933
939 chars_.clear();
940 return *this;
941 }
942
961 int32 compare(const basic_string_builder & str) const {return chars_.compare(str);}
983 int32 compare(size_type pos1, size_type count1, const basic_string_builder & str) const {return chars_.compare(pos1, count1, str);}
1007 int32 compare(size_type pos1, size_type count1, const basic_string_builder & str, size_type pos2) const {return chars_.compare(pos1, count1, str, pos2);}
1032 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);}
1051 int32 compare(const_pointer s) const {return chars_.compare(s);}
1073 int32 compare(size_type pos1, size_type count1, const_pointer s) const {return chars_.compare(pos1, count1, s);}
1096 int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const {return chars_.compare(pos1, count1, s, count2);}
1097
1103 size_type copy(pointer dest, size_type count) const {
1105 return chars_.copy(dest, count);
1106 }
1107
1113 size_type copy(pointer dest, size_type count, size_type pos) const {
1115 return chars_.copy(dest, count, pos);
1116 }
1117
1126 void copy_to(xtd::size source_index, xtd::array<value_type>& destination, xtd::size destination_index, xtd::size destination_count) const {
1127 if (source_index > length() || source_index + destination_count > length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);;
1128 if (destination_index >= destination.size() || destination_index + destination_count > destination.size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);;
1129 copy(destination.data() + destination_index, destination_count, source_index);
1130 }
1131
1135 bool equals(const object & obj) const noexcept override {return dynamic_cast<const basic_string_builder*>(&obj) && equals(static_cast<const basic_string_builder&>(obj));}
1140 bool equals(const basic_string_builder & value) const noexcept override {return chars_ == value.chars_;}
1141
1147 size_type ensure_capacity(size_type capacity) {
1148 if (this->capacity() < capacity) this->capacity(capacity);
1149 return this->capacity();
1150 }
1151
1156 chars_.erase();
1157 return *this;
1158 }
1159
1163 basic_string_builder & erase(size_type index) {
1165 chars_.erase(index);
1166 return *this;
1167 }
1168
1173 basic_string_builder & erase(size_type index, size_type count) {
1175 chars_.erase(index, count);
1176 return *this;
1177 }
1178
1183 iterator erase(const_iterator position) {return chars_.erase(position);}
1190 iterator erase(const_iterator first, const_iterator last) {return chars_.erase(first, last);}
1191
1195 size_type find(const basic_string_builder & str) const {return chars_.find(str);}
1201 size_type find(const basic_string_builder & str, size_type pos) const {return chars_.find(str, pos);}
1209 size_type find(const_pointer s, size_type pos, size_type count) const {return chars_.find(s, pos, count);}
1215 size_type find(const_pointer s) const {return chars_.find(s);}
1222 size_type find(const_pointer s, size_type pos) const {return chars_.find(s, pos);}
1227 size_type find(value_type ch) const {return chars_.find(ch);}
1233 size_type find(value_type ch, size_type pos) const {return chars_.find(ch, pos);}
1234
1239 size_type find_first_of(const basic_string_builder & str) const {return chars_.find_first_of(str);}
1245 size_type find_first_of(const basic_string_builder & str, size_type pos) const {return chars_.find_first_of(str, pos);}
1253 size_type find_first_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_first_of(s, pos, count);}
1259 size_type find_first_of(const_pointer s) const {return chars_.find_first_of(s);}
1266 size_type find_first_of(const_pointer s, size_type pos) const {return chars_.find_first_of(s, pos);}
1271 size_type find_first_of(value_type ch) const {return chars_.find_first_of(ch);}
1277 size_type find_first_of(value_type ch, size_type pos) const {return chars_.find_first_of(ch, pos);}
1278
1283 size_type find_first_not_of(const basic_string_builder & str) const {return chars_.find_first_not_of(str);}
1289 size_type find_first_not_of(const basic_string_builder & str, size_type pos) const {return chars_.find_first_not_of(str, pos);}
1297 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);}
1303 size_type find_first_not_of(const_pointer s) const {return chars_.find_first_not_of(s);}
1310 size_type find_first_not_of(const_pointer s, size_type pos) const {return chars_.find_first_not_of(s, pos);}
1315 size_type find_first_not_of(value_type ch) const {return chars_.find_first_not_of(ch);}
1321 size_type find_first_not_of(value_type ch, size_type pos) const {return chars_.find_first_not_of(ch, pos);}
1322
1327 size_type find_last_of(const basic_string_builder & str) const {return chars_.find_last_of(str);}
1333 size_type find_last_of(const basic_string_builder & str, size_type pos) const {return chars_.find_last_of(str, pos);}
1341 size_type find_last_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_last_of(s, pos, count);}
1347 size_type find_last_of(const_pointer s) const {return chars_.find_last_of(s);}
1354 size_type find_last_of(const_pointer s, size_type pos) const {return chars_.find_last_of(s, pos);}
1359 size_type find_last_of(value_type ch) const {return chars_.find_last_of(ch);}
1365 size_type find_last_of(value_type ch, size_type pos) const {return chars_.find_last_of(ch, pos);}
1366
1371 size_type find_last_not_of(const basic_string_builder & str) const {return chars_.find_last_not_of(str);}
1377 size_type find_last_not_of(const basic_string_builder & str, size_type pos) const {return chars_.find_last_not_of(str, pos);}
1385 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);}
1391 size_type find_last_not_of(const_pointer s) const {return chars_.find_last_not_of(s);}
1398 size_type find_last_not_of(const_pointer s, size_type pos) const {return chars_.find_last_not_of(s, pos);}
1403 size_type find_last_not_of(value_type ch) const {return chars_.find_last_not_of(ch);}
1409 size_type find_last_not_of(value_type ch, size_type pos) const {return chars_.find_last_not_of(ch, pos);}
1410
1413 allocator_type get_allocator() const {return chars_.get_allocator();}
1414
1417 virtual const base_type & get_base_type() const noexcept {return chars_;}
1418
1421 xtd::size get_hash_code() const noexcept override {return xtd::hash_code::combine(chars_);}
1422
1432 basic_string_builder & insert(size_type index, const xtd::basic_string<char_t>& value) {return insert(index, basic_string_builder {value}, 0, value.length());}
1443 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);}
1453 basic_string_builder & insert(size_type index, xtd::boolean value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1463 basic_string_builder & insert(size_type index, xtd::byte value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1473 basic_string_builder & insert(size_type index, xtd::decimal value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1483 basic_string_builder & insert(size_type index, double value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1493 basic_string_builder & insert(size_type index, xtd::single value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1503 basic_string_builder & insert(size_type index, xtd::int16 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1513 basic_string_builder & insert(size_type index, xtd::int32 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1523 basic_string_builder & insert(size_type index, xtd::int64 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1533 basic_string_builder & insert(size_type index, xtd::sbyte value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1543 basic_string_builder & insert(size_type index, xtd::uint16 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1553 basic_string_builder & insert(size_type index, xtd::uint32 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1563 basic_string_builder & insert(size_type index, xtd::uint64 value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1573 basic_string_builder & insert(size_type index, value_type value) {return insert(index, 1, value);}
1584 basic_string_builder & insert(size_type index, value_type value, size_type repeat_count) {return insert(index, repeat_count, value);}
1585
1587 basic_string_builder & insert(size_type index, xtd::slong value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1588 basic_string_builder & insert(size_type index, xtd::ulong value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1590
1601 template<class object_t>
1602 basic_string_builder & insert(size_type index, object_t value) {return insert(index, xtd::basic_string<char_t>::format("{}", value));}
1610 basic_string_builder & insert(size_type index, size_type count, value_type ch) {
1613 chars_.insert(index, count, ch);
1614 return *this;
1615 }
1616
1622 basic_string_builder & insert(size_type index, const_pointer s) {return insert(index, basic_string_builder(s));}
1630 basic_string_builder & insert(size_type index, const_pointer s, size_type count) {return insert(index, basic_string_builder(s, count));}
1637 basic_string_builder & insert(size_type index, const basic_string_builder & str) {return insert(index, str, 0, str.length());}
1646 basic_string_builder & insert(size_type index, const basic_string_builder & str, size_type s_index, size_type count) {
1649 if (s_index > str.size() || s_index + count > str.length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);;
1650 chars_.insert(index, str.chars_, s_index, count);
1651 return *this;
1652 }
1653
1660 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);}
1667 iterator insert(const_iterator pos, value_type ch) {return insert(pos, 1, ch);}
1675 iterator insert(const_iterator pos, size_type count, value_type ch) {
1676 if (static_cast<size_type>(std::distance(cbegin(), pos)) > length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1678 return chars_.insert(pos, count, ch);
1679 }
1688 template<class input_iterator_t>
1689 iterator insert(const_iterator pos, input_iterator_t first, input_iterator_t last) {
1692 return chars_.insert(pos, first, last);
1693 }
1700 iterator insert(const_iterator pos, std::initializer_list<value_type> ilist) {
1702 return chars_.insert(pos, ilist);
1703 }
1704
1707 void pop_back() {chars_.pop_back();}
1708
1711 void push_back(value_type ch) {chars_.push_back(ch);}
1712
1720 basic_string_builder & remove(size_type start_index, size_type length) {return erase(start_index, length);}
1721
1727 basic_string_builder & replace(value_type old_char, value_type new_char) noexcept {return replace(old_char, new_char, 0, length());}
1735 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);}
1742 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());}
1751 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) {
1753 auto old_size = old_value.size();
1754 auto new_size = new_value.size();
1755 auto index = xtd::size {0};
1756 while (true) {
1757 index = find(old_value, index);
1758 if (index == npos || index >= start_index + count) break;
1759 if (index >= start_index) {
1760 if (old_size == new_size) replace(index, old_size, new_value);
1761 else {
1762 erase(index, old_value.size());
1763 insert(index, new_value);
1764 }
1765 }
1766 index += new_value.size();
1767 }
1768 return *this;
1769 }
1770
1777 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str) {
1779 chars_.replace(pos, count, str);
1780 return *this;
1781 }
1789 basic_string_builder & replace(const_iterator first, const_iterator last, const basic_string_builder & str) {
1790 chars_.replace(first, last, str);
1791 return *this;
1792 }
1793
1800 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str, size_type pos2) {
1803 chars_.replace(pos, count, str, pos2);
1804 return *this;
1805 }
1806
1814 basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder & str, size_type pos2, size_type count2) {
1816 if (pos2 > str.size() || pos2 + count2 > str.size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range);
1817 chars_.replace(pos, count, str, pos2, count2);
1818 return *this;
1819 }
1820
1827 basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr, size_type count2) {
1829 chars_.replace(pos, count, cstr, count2);
1830 return *this;
1831 }
1832
1841 basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr, size_type count2) {
1842 chars_.replace(first, last, cstr, count2);
1843 return *this;
1844 }
1851 basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr) {
1852 chars_.replace(pos, count, cstr);
1853 return *this;
1854 }
1861 basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr) {
1862 chars_.replace(first, last, cstr);
1863 return *this;
1864 }
1865
1871 basic_string_builder & replace(size_type pos, size_type count, size_type count2, value_type ch) {
1873 chars_.replace(pos, count, count2, ch);
1874 return *this;
1875 }
1876
1883 basic_string_builder & replace(const_iterator first, const_iterator last, size_type count2, value_type ch) {
1884 chars_.replace(first, last, count2, ch);
1885 return *this;
1886 }
1895 template<class input_iterator_t>
1896 basic_string_builder & replace(const_iterator first, const_iterator last, input_iterator_t first2, input_iterator_t last2) {
1897 chars_.replace(first, last, first2, last2);
1898 return *this;
1899 }
1900
1907 basic_string_builder & replace(const_iterator first, const_iterator last, std::initializer_list<value_type> ilist) {
1908 chars_.replace(first, last, ilist);
1909 return *this;
1910 }
1911
1917 void reserve(size_type new_cap) {
1919 if (new_cap <= capacity()) return;
1920 chars_.reserve(new_cap);
1921 }
1922
1927 void resize(size_type count) {chars_.resize(count);}
1933 void resize(size_type count, value_type ch) {chars_.resize(count, ch);}
1934
1938 size_type rfind(const basic_string_builder & str) const {return chars_.rfind(str);}
1944 size_type rfind(const basic_string_builder & str, size_type pos) const {return chars_.rfind(str, pos);}
1952 size_type rfind(const_pointer s, size_type pos, size_type count) const {return chars_.rfind(s, pos, count);}
1958 size_type rfind(const_pointer s) const {return chars_.rfind(s);}
1965 size_type rfind(const_pointer s, size_type pos) const {return chars_.rfind(s, pos);}
1970 size_type rfind(value_type ch) const {return chars_.rfind(ch);}
1976 size_type rfind(value_type ch, size_type pos) const {return chars_.rfind(ch, pos);}
1977
1981 void shrink_to_fit() {chars_.shrink_to_fit();}
1982
1987 basic_string_builder substr() const {return chars_.substr();}
1993 basic_string_builder substr(size_type pos) const {
1995 return chars_.substr(pos);
1996 }
1997
2003 basic_string_builder substr(size_type pos, size_type count) const {
2005 return chars_.substr(pos, count);
2006 }
2007
2010 void swap(basic_string_builder & other) noexcept {chars_.swap(other.chars_);}
2011
2015 //xtd::string to_string() const noexcept override {return __xtd_convert_to_string<char>(chars_);}
2016 xtd::string to_string() const noexcept override {return xtd::string {chars_};}
2018
2020
2022
2024
2026
2032 const_reference operator [](xtd::size index) const {
2034 return chars_[index];
2035 }
2036
2040 reference operator [](xtd::size index) {
2042 return chars_[index];
2043 }
2044
2047 operator const base_type & () const noexcept {return chars_;}
2050 operator base_type & () noexcept {return chars_;}
2051
2056 chars_ = str.chars_;
2057 return *this;
2058 }
2059
2064 chars_ = std::move(str.chars_);
2065 return *this;
2066 }
2067
2071 basic_string_builder& operator =(const std::basic_string<value_type>& str) noexcept {
2072 chars_ = str;
2073 return *this;
2074 }
2075
2079 basic_string_builder& operator =(std::basic_string<value_type>&& str) noexcept {
2080 chars_ = std::move(str);
2081 return *this;
2082 }
2083
2088 chars_ = str;
2089 return *this;
2090 }
2091
2096 chars_ = std::move(str);
2097 return *this;
2098 }
2099
2104 basic_string_builder& operator =(const_pointer str) {
2106 chars_ = str;
2107 return *this;
2108 }
2109
2113 basic_string_builder& operator =(value_type character) {
2114 chars_ = character;
2115 return *this;
2116 }
2117
2121 basic_string_builder& operator =(const std::initializer_list<value_type>& il) {
2122 chars_ = il;
2123 return *this;
2124 }
2125
2130 chars_ += str.chars_;
2131 return *this;
2132 }
2133
2138 chars_ += std::move(str.chars_);
2139 str.chars_.clear();
2140 return *this;
2141 }
2142
2146 basic_string_builder & operator +=(const_pointer str) {
2148 chars_ += str;
2149 return *this;
2150 }
2151
2156 chars_ += ch;
2157 return *this;
2158 }
2159
2165 auto result = lhs;
2166 result += rhs;
2167 return result;
2168 }
2169
2175 auto result = std::move(lhs);
2176 result += std::move(rhs);
2177 return result;
2178 }
2179
2185 auto result = std::move(lhs);
2186 result += rhs;
2187 return result;
2188 }
2189
2195 auto result = lhs;
2196 result += std::move(rhs);
2197 return result;
2198 }
2199
2204 friend basic_string_builder operator +(const basic_string_builder & lhs, const_pointer rhs) {
2205 auto result = lhs;
2206 result += rhs;
2207 return result;
2208 }
2209
2214 friend basic_string_builder operator +(basic_string_builder&& lhs, const_pointer rhs) {
2215 auto result = std::move(lhs);
2216 result += rhs;
2217 return result;
2218 }
2219
2224 friend basic_string_builder operator +(const_pointer lhs, const basic_string_builder & rhs) {
2225 return lhs + rhs.chars_;
2226 }
2227
2232 friend basic_string_builder operator +(const_pointer lhs, basic_string_builder&& rhs) {
2233 return lhs + std::move(rhs).chars_;
2234 }
2235
2241 auto result = lhs;
2242 result += rhs;
2243 return result;
2244 }
2245
2251 auto result = std::move(lhs);
2252 result += rhs;
2253 return result;
2254 }
2255
2260 friend basic_string_builder operator +(value_type lhs, const basic_string_builder & rhs) {
2261 auto result = basic_string_builder(1, lhs);
2262 result += rhs;
2263 return result;
2264 }
2265
2271 auto result = basic_string_builder(1, lhs);
2272 result += std::move(rhs);
2273 return result;
2274 }
2275
2284 //friend std::basic_ostream<char>& operator <<(std::basic_ostream<char>& stream, const basic_string_builder& str) {return stream << str.to_string().chars_;}
2285 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();}
2292 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();}
2293
2302 friend std::basic_istream<char>& operator >>(std::basic_istream<char>& stream, basic_string_builder & str) {
2303 auto s = std::basic_string<char> {};
2304 stream >> s;
2305 str = xtd::basic_string<value_type>(s).chars();
2306 return stream;
2307 }
2308
2316 friend std::basic_istream<xtd::wchar>& operator >>(std::basic_istream<xtd::wchar>& stream, basic_string_builder & str) {
2317 auto s = std::basic_string<xtd::wchar> {};
2318 stream >> s;
2319 str = xtd::basic_string<value_type>(s).chars();
2320 return stream;
2321 }
2322
2323
2324 private:
2325 base_type chars_;
2326 size_type max_capacity_ = chars_.max_size();
2327 };
2328 }
2329}
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:61
virtual pointer data() noexcept
Returns pointer to the underlying array serving as element storage.
Definition basic_array.hpp:166
virtual size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(xtd::array::begin(),...
Definition basic_array.hpp:246
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:1245
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:1277
basic_string_builder & operator+=(const basic_string_builder &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string_builder.hpp:2129
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:1403
iterator erase(const_iterator position)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1183
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:1140
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:1800
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:1259
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:1896
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:1239
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:1543
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:1327
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:1987
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:1271
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:1483
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:1227
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:2302
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:2055
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:1827
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:1321
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string_builder.hpp:1417
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:1970
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:1315
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:1861
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:1391
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:1814
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:1222
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:1359
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:1473
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string_builder.hpp:2032
void shrink_to_fit()
Requests the removal of unused capacity.
Definition basic_string_builder.hpp:1981
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:2003
iterator erase(const_iterator first, const_iterator last)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1190
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:1347
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:1584
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:1409
basic_string_builder & insert(size_type index, size_type count, value_type ch)
Inserts characters into the string.
Definition basic_string_builder.hpp:1610
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:1944
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:1266
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:1303
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:1310
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:1371
basic_string_builder & erase()
Removes specified characters from the string.
Definition basic_string_builder.hpp:1155
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:1253
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:1354
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string_builder.
Definition basic_string_builder.hpp:1421
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:1289
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:1646
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:1113
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:1333
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:1453
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:1283
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:1573
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:1789
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:1377
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:1563
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:1209
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:2016
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:2285
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:1742
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:1602
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:1513
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:1871
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:1952
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string_builder.hpp:1096
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:1398
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:2010
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:1215
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:1993
basic_string_builder & erase(size_type index)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1163
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:1126
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string_builder.hpp:1413
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:1463
basic_string_builder & erase(size_type index, size_type count)
Removes specified characters from the string.
Definition basic_string_builder.hpp:1173
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:1147
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:1533
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:1443
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:1201
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:1297
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:1233
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:2164
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:1432
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:1976
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:1385
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:1195
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:1103
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:1553
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:1523
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:1503
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:1493
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:1341
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:1365
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:1135
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:1938
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
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.
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.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
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.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.