00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _STRINGOPS_
00019 #define _STRINGOPS_
00020
00021 #include <sstream>
00022 #include <string>
00023
00024 inline std::string operator+(const std::string & s, const std::wstring & s1)
00025 {
00026 std::string temp = s;
00027 temp.append(s1.begin(), s1.end());
00028 return temp;
00029 }
00030
00031 inline std::string operator+(const std::string & s, const wchar_t * s1)
00032 {
00033 return s + std::wstring(s1);
00034 }
00035
00036 inline std::string operator+(const std::string & s, const int nValue)
00037 {
00038 std::string temp;
00039 std::stringstream stream;
00040
00041 stream << s << nValue;
00042
00043 stream >> temp;
00044
00045 return temp;
00046 }
00047
00048 inline std::string operator+(const std::string & s, const float fValue)
00049 {
00050 std::string temp;
00051 std::stringstream stream;
00052
00053 stream << s << fValue;
00054
00055 stream >> temp;
00056
00057 return temp;
00058 }
00059
00060 inline std::string operator+(const std::string & s, const bool bValue)
00061 {
00062 std::string temp;
00063 std::stringstream stream;
00064
00065 stream << s << bValue ? "true" : "false";
00066
00067 stream >> temp;
00068
00069 return temp;
00070 }
00071
00072 inline std::wstring operator+(const std::wstring & s, const std::string & s1)
00073 {
00074 std::wstring temp = s;
00075 temp.append(s1.begin(), s1.end());
00076 return temp;
00077 }
00078
00079 inline std::wstring operator+(const std::wstring & s, const char * s1)
00080 {
00081 return s + std::string(s1);
00082 }
00083
00084 inline std::wstring operator+(const std::wstring & s, const int nValue)
00085 {
00086 std::wstring temp;
00087 std::wstringstream stream;
00088
00089 stream << s << nValue;
00090
00091 stream >> temp;
00092
00093 return temp;
00094 }
00095
00096 inline std::wstring operator+(const std::wstring & s, const float fValue)
00097 {
00098 std::wstring temp;
00099 std::wstringstream stream;
00100
00101 stream << s << fValue;
00102
00103 stream >> temp;
00104
00105 return temp;
00106 }
00107
00108 inline std::wstring operator+(const std::wstring & s, const bool bValue)
00109 {
00110 std::wstring temp;
00111 std::wstringstream stream;
00112
00113 stream << s << bValue ? L"true" : L"false";
00114
00115 stream >> temp;
00116
00117 return temp;
00118 }
00119
00120 #endif