8#ifndef HPP_ALIB_STRINGS_CSTRING
9#define HPP_ALIB_STRINGS_CSTRING 1
11#if !defined (HPP_ALIB_STRINGS_STRING)
19 #pragma warning( push )
20 #pragma warning( disable : 4127 )
23namespace alib {
namespace strings {
42template<
typename TChar>
43class TCString :
public TString<TChar>
71 :
TString<TChar>( pBuffer, contentLength )
77 "Error: Explicit construction of CString with unterminated string." )
105 template <
typename TZTCharArray>
125 template<
typename TZTCharArray>
127 operator TZTCharArray ()
const
144 template<
typename TZTCharArray>
146 operator TZTCharArray ()
const
164 template <
typename T,
166 typename std::enable_if<v, int>::type = 0 >
175 "Error: Implicit construction of CString with unterminated string." )
188 "Error: Implicit construction of CString with unterminated string." )
202 "Error: Explicit construction of CString with unterminated string." )
216 "Error: Explicit construction of CString with unterminated string." )
225 characters::T_ZTCharArray<
ATMP_RCV(T),TChar>::
Length( const_cast<T&>( src ) ) )
230 "Error: Construction of CString (from mutable object) with unterminated string." )
244 "Error: Construction of CString (from mutable object) with unterminated string." )
302 "Index out of bounds" )
351 if ( startIdx < 0 ) startIdx= 0;
358 && needles.Length() != 0,
"STRINGS",
359 "Non checking and illegal parameters" )
368 return idx >= 0 ? idx + startIdx : -1;
374 return idx < 0 || *( haystack + idx ) ==
'\0' ? -1 : startIdx + idx;
381#if (ALIB_CPP_STANDARD >= 20 && !defined(_MSC_VER)) && !defined(ALIB_DOX)
437 #if defined(ALIB_DOX)
455#if !defined(ALIB_DOX)
470template<>
struct TT_StringConstants<
wchar>
483template<>
struct TT_StringConstants<
xchar>
597 #pragma warning( pop )
integer IndexOfAny(const TCString &needles, integer startIdx=0) const
constexpr TCString(const TChar *pBuffer, integer contentLength)
TChar operator[](integer op) const
constexpr TCString(const TTerminatable &src)
constexpr bool IsNull() const
constexpr integer Length() const
constexpr TString() noexcept=default
constexpr const TChar * Buffer() const
#define ALIB_WARNINGS_RESTORE
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ATMP_SELECT_IF_1TP(TParam, ...)
@ Include
Chooses inclusion.
bool operator==(const String &lhs, const String &rhs)
bool operator<=>(const String &lhs, const String &rhs)
constexpr XCString XDefaultWhitespaces()
ALIB_API CString EMPTY_STRING
A global instance of a nulled zero-terminated string of standard character size.
constexpr CString DefaultWhitespaces()
constexpr NCString NDefaultWhitespaces()
ALIB_API WCString EMPTY_W_STRING
A global instance of a nulled zero-terminated string of wide character size.
constexpr ComplementCString ComplementDefaultWhitespaces()
constexpr ComplementCString ComplementNewLine()
constexpr CString NewLine()
constexpr WCString EmptyWString()
constexpr NCString NNewLine()
constexpr StrangeCString StrangeDefaultWhitespaces()
constexpr StrangeCString EmptyStrangeString()
constexpr NCString EmptyNString()
characters::wchar wchar
Type alias in namespace alib.
ALIB_API NCString EMPTY_N_STRING
A global instance of a nulled zero-terminated string of wide character size.
strings::TCString< complementChar > ComplementCString
Type alias in namespace alib.
constexpr XCString EmptyXString()
constexpr CString EmptyString()
ALIB_API XString EMPTY_X_STRING
A global instance of a nulled zero-terminated string of strange character size.
characters::xchar xchar
Type alias in namespace alib.
constexpr WCString WNewLine()
strings::TCString< character > CString
Type alias in namespace alib.
constexpr StrangeCString StrangeNewLine()
strings::TCString< nchar > NCString
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
ALIB_API StrangeCString EMPTY_STRANGE_STRING
A global instance of a nulled zero-terminated string of strange character size.
constexpr XCString XNewLine()
strings::TCString< strangeChar > StrangeCString
Type alias in namespace alib.
strings::TString< xchar > XString
Type alias in namespace alib.
ALIB_API ComplementCString EMPTY_COMPLEMENT_STRING
A global instance of a nulled zero-terminated string of complementary character size.
strings::TCString< xchar > XCString
Type alias in namespace alib.
constexpr ComplementCString EmptyComplementString()
lang::integer integer
Type alias in namespace alib.
strings::TCString< wchar > WCString
Type alias in namespace alib.
constexpr WCString WDefaultWhitespaces()
static integer IndexOfAnyExcludedZT(const TChar *haystack, const TChar *needles)
static constexpr ConstructionType Construction
static TString Construct(const TChar *array, integer length)
static TString Construct(const TChar *array, integer length)
static constexpr CString< TChar > DefaultWhitespaces())
static constexpr CString< TChar > NewLine()
static constexpr CString< TChar > EmptyString()