ALib C++ Library
by
Library Version:
2402 R1
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
compatibility
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)
17
#include "
alib/compatibility/std_characters.hpp
"
18
#endif
19
20
#ifndef HPP_ALIB_STRINGS_ASTRING
21
# include "
alib/strings/astring.hpp
"
22
#endif
23
24
25
#if defined(ALIB_DOX)
26
namespace
alib::strings::compatibility::std
{
27
#else
28
namespace
alib::strings
{
29
#endif
30
31
// #################################### std::string_view ######################################
32
#if (ALIB_CPP_STANDARD >= 20) || defined(ALIB_DOX)
33
34
template
<
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; }
35
template
<
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())) ); }
36
template
<
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; }
37
template
<
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())) ); }
38
template
<
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; }
39
template
<
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
41
template
<
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; }
42
template
<
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())) ); }
43
template
<
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; }
44
template
<
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())) ); }
45
template
<
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; }
46
template
<
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
48
template
<
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; }
49
template
<
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())) ); }
50
template
<
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; }
51
template
<
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())) ); }
52
template
<
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; }
53
template
<
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
astring.hpp
alib::strings::TAString< character >
alib::strings::TCString< character >
alib::strings::TString< character >
alib::strings::TString::CompareTo
int CompareTo(const TString< TChar > &rhs) const
Definition
string.hpp:624
ATMP_EQ
#define ATMP_EQ( T, TEqual)
Definition
tmp.hpp:32
ATMP_T_IF
#define ATMP_T_IF(T, Cond)
Definition
tmp.hpp:53
alib::lang::Case::Sensitive
@ Sensitive
alib::strings::compatibility::std
Definition
std_strings.hpp:26
alib::strings
Definition
logger.hpp:205
alib::strings::operator==
bool operator==(const String &lhs, const String &rhs)
Definition
string.hpp:2319
alib::strings::operator<=>
bool operator<=>(const String &lhs, const String &rhs)
Definition
string.hpp:2349
alib::WString
strings::TString< wchar > WString
Type alias in namespace alib.
Definition
strings/fwds.hpp:86
alib::String
strings::TString< character > String
Type alias in namespace alib.
Definition
strings/fwds.hpp:74
alib::XString
strings::TString< xchar > XString
Type alias in namespace alib.
Definition
strings/fwds.hpp:89
alib::integer
lang::integer integer
Type alias in namespace alib.
Definition
integers.hpp:286
std_characters.hpp