More string types for FString relational operators

This commit is contained in:
Markus Gans 2015-12-18 21:47:19 +01:00
parent 0ffe405dd6
commit 6074c78516
2 changed files with 288 additions and 0 deletions

View File

@ -1466,6 +1466,48 @@ bool FString::operator < (const FString& s) const
return (wcscmp(string, s.string) < 0);
}
//----------------------------------------------------------------------
bool FString::operator < (const std::wstring& s) const
{
const FString tmp(s);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator < (const wchar_t* s) const
{
const FString tmp(s);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator < (const std::string& s) const
{
const FString tmp(s);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator < (const char* s) const
{
const FString tmp(s);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator < (const wchar_t c) const
{
const FString tmp(c);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator < (const char c) const
{
const FString tmp(c);
return *this < tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const FString& s) const
{
@ -1480,6 +1522,48 @@ bool FString::operator <= (const FString& s) const
return (wcscmp(string, s.string) <= 0);
}
//----------------------------------------------------------------------
bool FString::operator <= (const std::wstring& s) const
{
const FString tmp(s);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const wchar_t* s) const
{
const FString tmp(s);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const std::string& s) const
{
const FString tmp(s);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const char* s) const
{
const FString tmp(s);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const wchar_t c) const
{
const FString tmp(c);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator <= (const char c) const
{
const FString tmp(c);
return *this <= tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const FString& s) const
{
@ -1492,6 +1576,48 @@ bool FString::operator == (const FString& s) const
return (wcscmp(string, s.string) == 0);
}
//----------------------------------------------------------------------
bool FString::operator == (const std::wstring& s) const
{
const FString tmp(s);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const wchar_t* s) const
{
const FString tmp(s);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const std::string& s) const
{
const FString tmp(s);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const char* s) const
{
const FString tmp(s);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const wchar_t c) const
{
const FString tmp(c);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator == (const char c) const
{
const FString tmp(c);
return *this == tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const FString& s) const
{
@ -1504,6 +1630,48 @@ bool FString::operator != (const FString& s) const
return (wcscmp(string, s.string) != 0);
}
//----------------------------------------------------------------------
bool FString::operator != (const std::wstring& s) const
{
const FString tmp(s);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const wchar_t* s) const
{
const FString tmp(s);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const std::string& s) const
{
const FString tmp(s);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const char* s) const
{
const FString tmp(s);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const wchar_t c) const
{
const FString tmp(c);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator != (const char c) const
{
const FString tmp(c);
return *this != tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const FString& s) const
{
@ -1518,6 +1686,48 @@ bool FString::operator >= (const FString& s) const
return (wcscmp(string, s.string) >= 0);
}
//----------------------------------------------------------------------
bool FString::operator >= (const std::wstring& s) const
{
const FString tmp(s);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const wchar_t* s) const
{
const FString tmp(s);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const std::string& s) const
{
const FString tmp(s);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const char* s) const
{
const FString tmp(s);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const wchar_t c) const
{
const FString tmp(c);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator >= (const char c) const
{
const FString tmp(c);
return *this >= tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const FString& s) const
{
@ -1532,6 +1742,48 @@ bool FString::operator > (const FString& s) const
return (wcscmp(string, s.string) > 0);
}
//----------------------------------------------------------------------
bool FString::operator > (const std::wstring& s) const
{
const FString tmp(s);
return *this > tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const wchar_t* s) const
{
const FString tmp(s);
return *this > tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const std::string& s) const
{
const FString tmp(s);
return *this > tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const char* s) const
{
const FString tmp(s);
return *this > tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const wchar_t c) const
{
const FString tmp(c);
return *this > tmp;
}
//----------------------------------------------------------------------
bool FString::operator > (const char c) const
{
const FString tmp(c);
return *this > tmp;
}
//----------------------------------------------------------------------
const FString& FString::insert (const FString& s, uInt pos)
{

View File

@ -213,11 +213,47 @@ class FString
const FString operator () (uInt, uInt);
bool operator < (const FString&) const;
bool operator < (const std::wstring&) const;
bool operator < (const wchar_t*) const;
bool operator < (const std::string&) const;
bool operator < (const char*) const;
bool operator < (const wchar_t) const;
bool operator < (const char) const;
bool operator <= (const FString&) const;
bool operator <= (const std::wstring&) const;
bool operator <= (const wchar_t*) const;
bool operator <= (const std::string&) const;
bool operator <= (const char*) const;
bool operator <= (const wchar_t) const;
bool operator <= (const char) const;
bool operator == (const FString&) const;
bool operator == (const std::wstring&) const;
bool operator == (const wchar_t*) const;
bool operator == (const std::string&) const;
bool operator == (const char*) const;
bool operator == (const wchar_t) const;
bool operator == (const char) const;
bool operator != (const FString&) const;
bool operator != (const std::wstring&) const;
bool operator != (const wchar_t*) const;
bool operator != (const std::string&) const;
bool operator != (const char*) const;
bool operator != (const wchar_t) const;
bool operator != (const char) const;
bool operator >= (const FString&) const;
bool operator >= (const std::wstring&) const;
bool operator >= (const wchar_t*) const;
bool operator >= (const std::string&) const;
bool operator >= (const char*) const;
bool operator >= (const wchar_t) const;
bool operator >= (const char) const;
bool operator > (const FString&) const;
bool operator > (const std::wstring&) const;
bool operator > (const wchar_t*) const;
bool operator > (const std::string&) const;
bool operator > (const char*) const;
bool operator > (const wchar_t) const;
bool operator > (const char) const;
operator const char* () const { return c_str(); }