19 template<
size_t N,
typename Char =
char>
27 template<
size_t N,
typename Char =
char>
34 constexpr static size_t Size = N;
50 std::copy (s, s +
Size, result.Data_);
60 std::copy (s2.Data_, s2.Data_ + s2.Size, result.
Data_ +
Size);
67 return *
this +
CtString<N2 - 1, Char> { s2 };
80 constexpr bool EndsWith (Char ch)
const noexcept
86 template<
size_t Count>
87 requires (Count <=
Size)
88 [[nodiscard]]
constexpr auto Chop ()
const noexcept
103 constexpr operator QStringView () const noexcept
104 requires std::is_same_v<Char,
char16_t>
109 constexpr auto Data () const noexcept
114 template<
typename NewChar>
123 template<CtString Str>
126 constexpr static auto terminated = Str +
'\0';
128 return QByteArray { QByteArrayData {
nullptr,
const_cast<char*
> (terminated.Data_), terminated.Size - 1 } };
131 template<CtString Str>
134 if constexpr (std::is_same_v<
typename decltype (Str)::Char_t,
char16_t>)
136 constexpr static auto terminated = Str +
'\0';
138 return QString { QStringPrivate {
nullptr,
const_cast<char16_t*
> (terminated.Data_), terminated.Size - 1 } };
141 return ToString<Str.template CastChars<char16_t> ()> ();
144 template<
size_t N1,
size_t N2,
typename Char>
147 return CtString<N1 - 1, Char> { s1 } + s2;
150 template<
typename Char>
154 while (str [result++])
159 template<
size_t N,
typename Char>
165 template<Util::CtString S>
166 constexpr auto operator""_ct () noexcept
constexpr size_t StringBufSize(const Char *str) noexcept
CtString(RawStr< N, Char >) -> CtString< N - 1, Char >
constexpr auto operator+(RawStr< N1, Char > s1, CtString< N2, Char > s2) noexcept
static constexpr auto FromUnsized(const Char *s) noexcept
constexpr auto operator+(const CtString< N2, Char > &s2) const noexcept
constexpr auto Chop() const noexcept
constexpr auto Data() const noexcept
constexpr bool EndsWith(Char ch) const noexcept
constexpr Char & operator[](size_t pos) noexcept
constexpr CtString() noexcept=default
constexpr bool IsEmpty() const noexcept
static constexpr size_t Size
constexpr CtString< N, NewChar > CastChars() const noexcept
constexpr auto operator<=>(const CtString &) const =default