xentara-utils v2.0.4
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::string::BasicStringView< Char, CharTraits > Class Template Reference

A string view that can be implicitly converted to std::basic_string. More...

#include <xentara/utils/string/StringView.hpp>

+ Inheritance diagram for xentara::utils::string::BasicStringView< Char, CharTraits >:

Public Member Functions

constexpr BasicStringView (const std::basic_string_view< Char, CharTraits > &view) noexcept
 Conversion constructor from a regular string view.
 
constexpr auto operator= (const std::basic_string_view< Char, CharTraits > &view) noexcept -> BasicStringView &
 Assignment operator for a regular string view.
 
template<typename Allocator >
constexpr operator std::basic_string< Char, CharTraits, Allocator > () const
 Make this class convertible to an std::basic_string.
 
- Public Member Functions inherited from std::basic_string_view
T at (T... args)
 
T back (T... args)
 
T basic_string_view (T... args)
 
T begin (T... args)
 
T cbegin (T... args)
 
T cend (T... args)
 
T compare (T... args)
 
T copy (T... args)
 
T crbegin (T... args)
 
T crend (T... args)
 
T data (T... args)
 
T empty (T... args)
 
T end (T... args)
 
T ends_with (T... args)
 
T find (T... args)
 
T find_first_not_of (T... args)
 
T find_first_of (T... args)
 
T find_last_not_of (T... args)
 
T find_last_of (T... args)
 
T front (T... args)
 
T length (T... args)
 
T max_size (T... args)
 
T operator= (T... args)
 
T operator[] (T... args)
 
T rbegin (T... args)
 
T remove_prefix (T... args)
 
T remove_suffix (T... args)
 
T rend (T... args)
 
T rfind (T... args)
 
T size (T... args)
 
T starts_with (T... args)
 
T substr (T... args)
 
T swap (T... args)
 

Detailed Description

template<typename Char, typename CharTraits = std::char_traits<Char>>
class xentara::utils::string::BasicStringView< Char, CharTraits >

A string view that can be implicitly converted to std::basic_string.

This class solves the problem that std::basic_string_view cannot be implicitly converted to an std::basic_string.

Constructor & Destructor Documentation

◆ BasicStringView()

template<typename Char , typename CharTraits = std::char_traits<Char>>
constexpr xentara::utils::string::BasicStringView< Char, CharTraits >::BasicStringView ( const std::basic_string_view< Char, CharTraits > &  view)
constexprnoexcept

Conversion constructor from a regular string view.

Member Function Documentation

◆ operator std::basic_string< Char, CharTraits, Allocator >()

template<typename Char , typename CharTraits = std::char_traits<Char>>
template<typename Allocator >
constexpr xentara::utils::string::BasicStringView< Char, CharTraits >::operator std::basic_string< Char, CharTraits, Allocator > ( ) const
constexpr

Make this class convertible to an std::basic_string.

◆ operator=()

template<typename Char , typename CharTraits = std::char_traits<Char>>
constexpr auto xentara::utils::string::BasicStringView< Char, CharTraits >::operator= ( const std::basic_string_view< Char, CharTraits > &  view) -> BasicStringView &
constexprnoexcept

Assignment operator for a regular string view.