Class FString: More data types for the + operator

This commit is contained in:
Markus Gans 2015-07-18 21:26:27 +02:00
parent a20a1d8b38
commit 35a50fdbd7
2 changed files with 18 additions and 0 deletions

View File

@ -720,6 +720,14 @@ const FString operator + (const FString& s1, const FString& s2)
return (tmp);
}
//----------------------------------------------------------------------
const FString operator + (const FString& s, const wchar_t c)
{
FString tmp(s);
tmp._insert ( uInt(wcslen(s.wc_str())), 1, &c);
return (tmp);
}
//----------------------------------------------------------------------
const FString operator + (const std::wstring& s1, const FString& s2)
{
@ -776,6 +784,14 @@ const FString operator + (const char c, const FString& s)
return (tmp);
}
//----------------------------------------------------------------------
const FString operator + (const wchar_t c, const std::wstring& s)
{
FString tmp(c);
tmp._insert (1, uInt(s.length()), s.c_str());
return (tmp);
}
//----------------------------------------------------------------------
wchar_t& FString::operator [] (uInt pos)
{

View File

@ -192,12 +192,14 @@ class FString
const FString operator + (const char);
friend const FString operator + (const FString&, const FString&);
friend const FString operator + (const FString&, const wchar_t);
friend const FString operator + (const std::wstring&, const FString&);
friend const FString operator + (const wchar_t*, const FString&);
friend const FString operator + (const std::string&, const FString&);
friend const FString operator + (const char*, const FString&);
friend const FString operator + (const wchar_t, const FString&);
friend const FString operator + (const char, const FString&);
friend const FString operator + (const wchar_t, const std::wstring&);
wchar_t& operator [] (uInt);
const FString operator () (uInt, uInt);