diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
commit | c8e0e909b4a8d18319fc65434a10dc446434817c (patch) | |
tree | eee91e7d2ce229dd043811eae8f1e2bd78061916 /zen/file_error.h | |
parent | 5.2 (diff) | |
download | FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2 FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip |
5.3
Diffstat (limited to 'zen/file_error.h')
-rw-r--r-- | zen/file_error.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/zen/file_error.h b/zen/file_error.h index 853267d4..4565d0b7 100644 --- a/zen/file_error.h +++ b/zen/file_error.h @@ -38,9 +38,22 @@ DEFINE_NEW_FILE_ERROR(ErrorFileLocked); //----------- facilitate usage of std::wstring for error messages -------------------- //allow implicit UTF8 conversion: since std::wstring models a GUI string, convenience is more important than performance -inline std::wstring operator+(const std::wstring& lhs, const Zstring& rhs) { return std::wstring(lhs) += zen::utf8CvrtTo<std::wstring>(rhs); } +inline +std::wstring operator+(const std::wstring& lhs, const Zstring& rhs) { return std::wstring(lhs) += utf8CvrtTo<std::wstring>(rhs); } //we musn't put our overloads in namespace std, but namespace zen (+ using directive) is sufficient + + +inline +std::wstring fmtFileName(const Zstring& filename) +{ + std::wstring output; + output.reserve(filename.size() + 2); + output += L'\"'; + output += utf8CvrtTo<std::wstring>(filename); + output += L'\"'; + return output; +} } #endif // FILEERROR_H_INCLUDED |