ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
std_strings.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of the \aliblong.<br>
4 * With the inclusion of this header compatibility features between \alib and the C++ standard
5 * library are provided.
6 *
7 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
8 * Published under \ref mainpage_license "Boost Software License".
9 **************************************************************************************************/
10#ifndef HPP_ALIB_COMPATIBILITY_STD_STRINGS
11#define HPP_ALIB_COMPATIBILITY_STD_STRINGS 1
12
13
14#if ALIB_STRINGS
15
16#if !defined (HPP_ALIB_COMPATIBILITY_STD_CHARACTERS)
18#endif
19
20#ifndef HPP_ALIB_STRINGS_ASTRING
22#endif
23
24
25#if defined(ALIB_DOX)
27#else
28namespace alib::strings {
29#endif
30
31// #################################### std::string_view ######################################
32#if (ALIB_CPP_STANDARD >= 20) || defined(ALIB_DOX)
33
34template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator== (const String& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ) == 0; }
35template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator<=> (const String& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ); }
36template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator== (const WString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ) == 0; }
37template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator<=> (const WString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ); }
38template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator== (const XString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ) == 0; }
39template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator<=> (const XString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ); }
40
41template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator== (const CString& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ) == 0; }
42template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator<=> (const CString& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ); }
43template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator== (const WCString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ) == 0; }
44template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator<=> (const WCString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ); }
45template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator== (const XCString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ) == 0; }
46template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator<=> (const XCString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ); }
47
48template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator== (const AString& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ) == 0; }
49template<typename TStringView> ATMP_T_IF(bool, ATMP_EQ( TStringView, std:: string_view) ) operator<=> (const AString& lhs, const TStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( String(rhs.data(), integer(rhs.length())) ); }
50template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator== (const WAString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ) == 0; }
51template<typename TWStringView> ATMP_T_IF(bool, ATMP_EQ(TWStringView, std::wstring_view) ) operator<=> (const WAString& lhs, const TWStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( WString(rhs.data(), integer(rhs.length())) ); }
52template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator== (const XAString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ) == 0; }
53template<typename TXStringView> ATMP_T_IF(bool, ATMP_EQ(TXStringView, std::basic_string_view<xchar>)) operator<=> (const XAString& lhs, const TXStringView& rhs) { return lhs.CompareTo<true,lang::Case::Sensitive>( XString(rhs.data(), integer(rhs.length())) ); }
54
55
56#endif
57
58
59} // namespace [alib::strings]
60
61
62#endif // ALIB_CHARACTERS
63#endif // HPP_ALIB_COMPATIBILITY_STD_STRINGS
int CompareTo(const TString< TChar > &rhs) const
Definition string.hpp:624
#define ATMP_EQ( T, TEqual)
Definition tmp.hpp:32
#define ATMP_T_IF(T, Cond)
Definition tmp.hpp:53
bool operator==(const String &lhs, const String &rhs)
Definition string.hpp:2319
bool operator<=>(const String &lhs, const String &rhs)
Definition string.hpp:2349
strings::TString< wchar > WString
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
strings::TString< xchar > XString
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:286