LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::CtString< N, Char > Struct Template Reference

#include "ctstring.h"

Public Types

using Char_t = Char
 

Public Member Functions

constexpr CtString () noexcept=default
 
constexpr CtString (RawStr< N+1, Char > s) noexcept
 
constexpr auto operator<=> (const CtString &) const =default
 
template<size_t N2>
constexpr auto operator+ (const CtString< N2, Char > &s2) const noexcept
 
template<size_t N2>
constexpr auto operator+ (RawStr< N2, Char > s2) const noexcept
 
constexpr auto operator+ (Char ch) const noexcept
 
constexpr bool IsEmpty () const noexcept
 
constexpr bool EndsWith (Char ch) const noexcept
 
template<size_t Count>
requires (Count <= Size)
constexpr auto Chop () const noexcept
 
constexpr Char & operator[] (size_t pos) noexcept
 
constexpr Char operator[] (size_t pos) const noexcept
 
constexpr operator QStringView () const noexcept
 
constexpr auto Data () const noexcept
 
template<typename NewChar>
constexpr CtString< N, NewChar > CastChars () const noexcept
 

Static Public Member Functions

static constexpr auto FromUnsized (const Char *s) noexcept
 

Public Attributes

Char Data_ [Size] {}
 

Static Public Attributes

static constexpr size_t Size = N
 

Detailed Description

template<size_t N, typename Char = char>
struct LC::Util::CtString< N, Char >

Non-0-terminated compile-time string.

Template Parameters
NThe length of the string in Char.
CharThe underlying character type.

Definition at line 28 of file ctstring.h.

Member Typedef Documentation

◆ Char_t

template<size_t N, typename Char = char>
using LC::Util::CtString< N, Char >::Char_t = Char

Definition at line 30 of file ctstring.h.

Constructor & Destructor Documentation

◆ CtString() [1/2]

template<size_t N, typename Char = char>
LC::Util::CtString< N, Char >::CtString ( )
constexprdefaultnoexcept

Referenced by CtString(), CastChars(), FromUnsized(), operator+(), operator+(), operator+(), and operator<=>().

+ Here is the caller graph for this function:

◆ CtString() [2/2]

template<size_t N, typename Char = char>
LC::Util::CtString< N, Char >::CtString ( RawStr< N+1, Char > s)
inlineconstexprnoexcept

Definition at line 40 of file ctstring.h.

References CtString(), Data_, and Size.

+ Here is the call graph for this function:

Member Function Documentation

◆ CastChars()

template<size_t N, typename Char = char>
template<typename NewChar>
CtString< N, NewChar > LC::Util::CtString< N, Char >::CastChars ( ) const
inlineconstexprnoexcept

Definition at line 115 of file ctstring.h.

References CtString(), and Data_.

+ Here is the call graph for this function:

◆ Chop()

template<size_t N, typename Char = char>
template<size_t Count>
requires (Count <= Size)
auto LC::Util::CtString< N, Char >::Chop ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 88 of file ctstring.h.

References Chop(), Data_, and FromUnsized().

Referenced by Chop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Data()

template<size_t N, typename Char = char>
auto LC::Util::CtString< N, Char >::Data ( ) const
inlineconstexprnoexcept

Definition at line 109 of file ctstring.h.

References Data_.

◆ EndsWith()

template<size_t N, typename Char = char>
bool LC::Util::CtString< N, Char >::EndsWith ( Char ch) const
inlineconstexprnoexcept

Definition at line 80 of file ctstring.h.

References Data_, and Size.

◆ FromUnsized()

template<size_t N, typename Char = char>
static constexpr auto LC::Util::CtString< N, Char >::FromUnsized ( const Char * s)
inlinestaticconstexprnoexcept

Definition at line 47 of file ctstring.h.

References CtString(), and Size.

Referenced by Chop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsEmpty()

template<size_t N, typename Char = char>
bool LC::Util::CtString< N, Char >::IsEmpty ( ) const
inlineconstexprnoexcept

Definition at line 75 of file ctstring.h.

References Size.

◆ operator QStringView()

template<size_t N, typename Char = char>
LC::Util::CtString< N, Char >::operator QStringView ( ) const
inlineconstexprnoexcept

Definition at line 103 of file ctstring.h.

References Data_, and Size.

◆ operator+() [1/3]

template<size_t N, typename Char = char>
auto LC::Util::CtString< N, Char >::operator+ ( Char ch) const
inlineconstexprnoexcept

Definition at line 70 of file ctstring.h.

References CtString().

+ Here is the call graph for this function:

◆ operator+() [2/3]

template<size_t N, typename Char = char>
template<size_t N2>
auto LC::Util::CtString< N, Char >::operator+ ( const CtString< N2, Char > & s2) const
inlineconstexprnoexcept

Definition at line 55 of file ctstring.h.

References CtString(), Data_, and Size.

+ Here is the call graph for this function:

◆ operator+() [3/3]

template<size_t N, typename Char = char>
template<size_t N2>
auto LC::Util::CtString< N, Char >::operator+ ( RawStr< N2, Char > s2) const
inlineconstexprnoexcept

Definition at line 65 of file ctstring.h.

References CtString().

+ Here is the call graph for this function:

◆ operator<=>()

template<size_t N, typename Char = char>
auto LC::Util::CtString< N, Char >::operator<=> ( const CtString< N, Char > & ) const
constexprdefault

References CtString().

+ Here is the call graph for this function:

◆ operator[]() [1/2]

template<size_t N, typename Char = char>
Char LC::Util::CtString< N, Char >::operator[] ( size_t pos) const
inlineconstexprnoexcept

Definition at line 98 of file ctstring.h.

References Data_.

◆ operator[]() [2/2]

template<size_t N, typename Char = char>
Char & LC::Util::CtString< N, Char >::operator[] ( size_t pos)
inlineconstexprnoexcept

Definition at line 93 of file ctstring.h.

References Data_.

Member Data Documentation

◆ Data_

template<size_t N, typename Char = char>
Char LC::Util::CtString< N, Char >::Data_[Size] {}

◆ Size

template<size_t N, typename Char = char>
size_t LC::Util::CtString< N, Char >::Size = N
staticconstexpr

The size of the string.

Definition at line 34 of file ctstring.h.

Referenced by CtString(), EndsWith(), FromUnsized(), IsEmpty(), operator QStringView(), and operator+().


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