diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
commit | b338e29fd3eaf700f8c8360aa0310048ba941d54 (patch) | |
tree | 122f8ef3790d12cd10275ef7453a9e8053322d78 /shared/string_conv.h | |
parent | 3.18 (diff) | |
download | FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.gz FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.bz2 FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.zip |
3.19
Diffstat (limited to 'shared/string_conv.h')
-rw-r--r-- | shared/string_conv.h | 102 |
1 files changed, 5 insertions, 97 deletions
diff --git a/shared/string_conv.h b/shared/string_conv.h index cdfdbbfa..477dda8c 100644 --- a/shared/string_conv.h +++ b/shared/string_conv.h @@ -13,105 +13,13 @@ namespace zen { -//conversion from Zstring to wxString -wxString zToWx(const Zstring& str); -wxString zToWx(const Zchar* str); -wxString zToWx(Zchar ch); -//conversion from wxString to Zstring -Zstring wxToZ(const wxString& str); -Zstring wxToZ(const wxChar* str); -Zstring wxToZ(wxChar ch); +inline wxString operator+(const wxString& lhs, const char* rhs) { return wxString(lhs) += utf8CvrtTo<wxString>(rhs); } +inline wxString operator+(const wxString& lhs, const Zstring& rhs) { return wxString(lhs) += utf8CvrtTo<wxString>(rhs); } - - - - - - - - - - - - - - - - - - - - - - - - -//---------------Inline Implementation--------------------------------------------------- -inline -wxString zToWx(const Zstring& str) -{ -#ifdef FFS_WIN - return cvrtString<wxString>(str); -#elif defined FFS_LINUX - return utf8ToWide<wxString>(str); -#endif -} - - -inline -wxString zToWx(const Zchar* str) -{ -#ifdef FFS_WIN - return cvrtString<wxString>(str); -#elif defined FFS_LINUX - return utf8ToWide<wxString>(str); -#endif -} - - -inline -wxString zToWx(Zchar ch) -{ -#ifdef FFS_WIN - return cvrtString<wxString>(ch); -#elif defined FFS_LINUX - return utf8ToWide<wxString>(ch); -#endif -} - -//----------------------------------------------------------------- -inline -Zstring wxToZ(const wxString& str) -{ -#ifdef FFS_WIN - return cvrtString<Zstring>(str); -#elif defined FFS_LINUX - return wideToUtf8<Zstring>(str); -#endif -} - - -inline -Zstring wxToZ(const wxChar* str) -{ -#ifdef FFS_WIN - return cvrtString<Zstring>(str); -#elif defined FFS_LINUX - return wideToUtf8<Zstring>(str); -#endif -} - - -inline -Zstring wxToZ(wxChar ch) -{ -#ifdef FFS_WIN - return cvrtString<Zstring>(ch); -#elif defined FFS_LINUX - return wideToUtf8<Zstring>(ch); -#endif -} +//conversion between Zstring and wxString +inline wxString toWx(const Zstring& str) { return utf8CvrtTo<wxString>(str); } +inline Zstring toZ(const wxString& str) { return utf8CvrtTo<Zstring>(str); } } #endif // STRINGCONV_H_INCLUDED |