Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
Thoth::String::UnicodeViewer< CharT > Struct Template Reference

Non owning viewer that represents Unicode encodings. More...

#include <UnicodeViewer.hpp>

Classes

struct  Iterator
 

Public Types

using StringViewType = std::basic_string_view< CharT >
 

Public Member Functions

constexpr UnicodeViewer (StringViewType str)
 
constexpr Iterator begin () noexcept
 
constexpr Iterator cbegin () const noexcept
 
constexpr std::default_sentinel_t end () noexcept
 
constexpr std::default_sentinel_t cend () const noexcept
 

Static Public Member Functions

static constexpr bool IsValid (StringViewType str)
 Check if a string does not has invalid chars.
 
template<UnicodeCharConcept NewCharT>
static constexpr std::basic_string< NewCharT > ConvertTo (StringViewType str)
 Converts from one Unicode Encoding to another.
 

Detailed Description

template<UnicodeCharConcept CharT>
struct Thoth::String::UnicodeViewer< CharT >

Non owning viewer that represents Unicode encodings.

It goes only forward. Invalid chars are replaced by UnknownChar.

Member Typedef Documentation

◆ StringViewType

template<UnicodeCharConcept CharT>
using Thoth::String::UnicodeViewer< CharT >::StringViewType = std::basic_string_view<CharT>

Constructor & Destructor Documentation

◆ UnicodeViewer()

template<UnicodeCharConcept CharT>
constexpr Thoth::String::UnicodeViewer< CharT >::UnicodeViewer ( StringViewType  str)
inlineexplicitconstexpr

Member Function Documentation

◆ begin()

template<UnicodeCharConcept CharT>
constexpr Iterator Thoth::String::UnicodeViewer< CharT >::begin ( )
inlineconstexprnoexcept

◆ cbegin()

template<UnicodeCharConcept CharT>
constexpr Iterator Thoth::String::UnicodeViewer< CharT >::cbegin ( ) const
inlineconstexprnoexcept

◆ cend()

template<UnicodeCharConcept CharT>
constexpr std::default_sentinel_t Thoth::String::UnicodeViewer< CharT >::cend ( ) const
inlineconstexprnoexcept

◆ ConvertTo()

template<UnicodeCharConcept CharT>
template<UnicodeCharConcept NewCharT>
static constexpr std::basic_string< NewCharT > Thoth::String::UnicodeViewer< CharT >::ConvertTo ( StringViewType  str)
staticconstexpr

Converts from one Unicode Encoding to another.

◆ end()

template<UnicodeCharConcept CharT>
constexpr std::default_sentinel_t Thoth::String::UnicodeViewer< CharT >::end ( )
inlineconstexprnoexcept

◆ IsValid()

template<UnicodeCharConcept CharT>
static constexpr bool Thoth::String::UnicodeViewer< CharT >::IsValid ( StringViewType  str)
staticconstexpr

Check if a string does not has invalid chars.


The documentation for this struct was generated from the following file: