πŸ”¨ basic_text (In Progress)

Warning

πŸ”¨ This isn’t finished yet! Come check back by the next major or minor version update.

The basic_text class provides functionality similar to std::string but for performing it on encoded, normalized text.

template<typename _Encoding, typename _NormalizationForm = nfkc, typename _Range = __txt_detail::__default_char_range_t<code_unit_t<_Encoding>>>
class basic_text

A wrapper (container adapter) that takes the given _Encoding type and _NormalizationForm type and imposes it over the given chosen _Range storage for the purposes of allowing users to examine the text.

Template Parameters:
  • _Encoding – The encoding to store any input and presented text as.

  • _NormalizationForm – The normalization form to impose on the stored text’s sequences.

  • _Range – The container type that will be stored within this ztd::text::basic_text using the code units from the _Encoding type.

  • _ErrorHandler – The default error handler to use for any and all operations on text. Generally, most operations will provide room to override this.

Public Types

using range_type = _Range

The type that this view is wrapping.

using encoding_type = _Encoding

The encoding type that this view is using to interpret the underlying sequence of code units.

using normalization_type = _NormalizationForm

The normalization form type this view is imposing on top of the encoded sequence.

using code_point = code_point_t<_UEncoding>

The code point type when the underlying storage is decoded.

using code_unit = code_unit_t<_UEncoding>

The code unit type expected by the underlying storage.

using iterator = basic_text_view_iterator<_UEncoding, _UNormalizationForm, ::ztd::ranges::reconstruct_t<_CVRange>>

FIXME.

using const_iterator = basic_text_view_iterator<_UEncoding, _UNormalizationForm, ::ztd::ranges::reconstruct_t<const _CVRange>>

FIXME.

using sentinel = text_view_sentinel_t

FIXME.

using const_sentinel = text_view_sentinel_t

FIXME.

using value_type = code_point

The type for the basic iterators.

using reference = code_point

The type for the basic iterators.

using difference_type = ranges::iterator_difference_type_t<iterator>

The type for the basic iterators.

using size_type = ranges::iterator_size_type_t<iterator>

The type for the basic iterators.

using iterator_category = ranges::iterator_concept_t<iterator>

FIXME.

using iterator_concept = ranges::iterator_concept_t<iterator>

FIXME.

Public Functions

constexpr basic_text(const basic_text&) = default

Copy constructor. Defaulted.

constexpr basic_text(basic_text&&) = default

Move constructor. Defaulted.

constexpr basic_text &operator=(const basic_text&) = default

Copy assignment operator. Defaulted.

constexpr basic_text &operator=(basic_text&&) = default

Move assignment operator. Defaulted.

inline constexpr basic_text() noexcept(::std::is_nothrow_constructible_v<basic_text, ::std::in_place_t>)

Constructs a basic text, using the default constructor for all held components.

template<typename _Input>
inline constexpr basic_text(::ztd::ranges::from_range_t, _Input &&__input) noexcept(_S_constructor_from_range_noexcept<_Input>())

Constructs from a given range, performing a conversion from code points if necessary.

template<typename _Input, typename _FromEncoding>
inline constexpr basic_text(::ztd::ranges::from_range_t, _Input &&__input, _FromEncoding &&__from_encoding) noexcept(_S_constructor_from_range_noexcept<_Input, _FromEncoding>())

Constructs from a given range, performing a conversion from code points if necessary.

template<typename _Input, typename _FromEncoding, typename _ErrorHandler>
inline constexpr basic_text(::ztd::ranges::from_range_t, _Input &&__input, _FromEncoding &&__from_encoding, _ErrorHandler &&__error_handler) noexcept(_S_constructor_from_range_noexcept<_Input, _FromEncoding, _ErrorHandler>())

Constructs from a given range, performing a conversion from code points if necessary.

using ztd::text::text = u8text

A shortcut for ztd::u8text.

using ztd::text::ntext = basic_text<execution_t>

A container for storing text in the locale, runtime-based encoding.

using ztd::text::wtext = basic_text<wide_execution_t>

A container for storing text in the locale, runtime-based wide encoding.

using ztd::text::nltext = basic_text<literal_t>

A container for storing text in the string literal_t encoding.

using ztd::text::wltext = basic_text<wide_literal_t>

A container for storing text in the wide string literal_t encoding.

using ztd::text::u8text = basic_text<utf8_t>

A container for storing text in the UTF-8 encoding.

using ztd::text::u16text = basic_text<utf16_t>

A container for storing text in the UTF-16 encoding.

using ztd::text::u32text = basic_text<utf32_t>

A container for storing text in the UTF-32 encoding.