// License: Modified MIT (NON-AI) // See the LICENSE file in the root directory for license information. // Copyright 2025 Timothy Prepscius #pragma once #include "String.h" #include "StringView.h" #include "../rtti/TypeName+custom.hpp" namespace tjp::core { namespace str { #define TJP_STR_INLINE inline #define TJP_STR_USE_TEMPLATES #ifdef TJP_STR_USE_TEMPLATES constexpr int Str_DefaultN = 48; template struct Str; #define TJP_STR_TEMPLATE template #define TJP_STR_TEMPLATE2 template #define TJP_STR_TEMPLATE12 template #define CONST_TEMPLATE_N1 N1 #define TJP_STR Str #define TJP_STR2 Str #define TJP_STR_TYPENAME typename TJP_STR #define TJP_STR_DEFAULT Str #else struct Str; #define TJP_STR_TEMPLATE #define TJP_STR_TEMPLATE12 #define TJP_STR_TEMPLATE2 #define CONST_TEMPLATE_N1 48 #define TJP_STR Str #define TJP_STR2 Str #define TJP_STR_TYPENAME TJP_STR #define TJP_STR_DEFAULT Str #endif TJP_STR_TEMPLATE12 bool operator ==(const TJP_STR &lhs, const TJP_STR2 &rhs); TJP_STR_TEMPLATE bool operator ==(const TJP_STR &lhs, const String &r); TJP_STR_TEMPLATE bool operator ==(const TJP_STR &lhs, const StringView &r); TJP_STR_TEMPLATE bool operator ==(const TJP_STR &lhs, const char *r); TJP_STR_TEMPLATE bool operator ==(const String &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator ==(const StringView &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator ==(const char *l, const TJP_STR &rhs); TJP_STR_TEMPLATE12 bool operator !=(const TJP_STR &lhs, const TJP_STR2 &rhs); TJP_STR_TEMPLATE bool operator !=(const TJP_STR &lhs, const String &r); TJP_STR_TEMPLATE bool operator !=(const TJP_STR &lhs, const StringView &r); TJP_STR_TEMPLATE bool operator !=(const TJP_STR &lhs, const char *r); TJP_STR_TEMPLATE bool operator !=(const String &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator !=(const StringView &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator !=(const char *l, const TJP_STR &rhs); TJP_STR_TEMPLATE12 bool operator <(const TJP_STR &lhs, const TJP_STR2 &rhs); TJP_STR_TEMPLATE bool operator <(const TJP_STR &lhs, const String &r); TJP_STR_TEMPLATE bool operator <(const TJP_STR &lhs, const StringView &r); TJP_STR_TEMPLATE bool operator <(const TJP_STR &lhs, const char *r); TJP_STR_TEMPLATE bool operator <(const String &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator <(const StringView &l, const TJP_STR &rhs); TJP_STR_TEMPLATE bool operator <(const char *l, const TJP_STR &rhs); TJP_STR_TEMPLATE12 TJP_STR operator+(const TJP_STR &lhs, const TJP_STR2 &rhs); TJP_STR_TEMPLATE TJP_STR operator+(const String &lhs, const TJP_STR &rhs); TJP_STR_TEMPLATE TJP_STR operator+(const StringView &lhs, const TJP_STR &rhs); TJP_STR_TEMPLATE TJP_STR operator+(const char *lhs, const TJP_STR &rhs); TJP_STR_TEMPLATE TJP_STR operator+(const TJP_STR &lhs, const String &rhs); TJP_STR_TEMPLATE TJP_STR operator+(const TJP_STR &lhs, const StringView &rhs); TJP_STR_DEFAULT operator+(const char *lhs, const StringView &rhs); } // namespace #ifdef TJP_STR_USE_TEMPLATES template using StrN = str::TJP_STR; using Str = StrN; using Str = Str; #else using Str = str::TJP_STR; using Str = Str; #endif } // namespace TIMPREPSCIUS_CORE_RTTI_REPLACE_TYPENAME(tjp::core::Str);