diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:56:07 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:56:07 +0200 |
commit | de73d25e0b27f4bee2de116d19cab32800785d64 (patch) | |
tree | 21de1736d12a92223ad04c02a5b0826d77e5e71c /zen/file_error.h | |
parent | 7.1 (diff) | |
download | FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.tar.gz FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.tar.bz2 FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.zip |
7.2
Diffstat (limited to 'zen/file_error.h')
-rw-r--r-- | zen/file_error.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/zen/file_error.h b/zen/file_error.h index 4ba05107..d8c6224c 100644 --- a/zen/file_error.h +++ b/zen/file_error.h @@ -47,22 +47,14 @@ void throwFileError(const std::wstring& msg, const std::wstring& functionName, c //----------- 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) += utfCvrtTo<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& filepath) +std::wstring fmtPath(const std::wstring& displayPath) { - std::wstring output; - output += L'\"'; - output += utfCvrtTo<std::wstring>(filepath); - output += L'\"'; - return output; + return L'\"' + displayPath + L'\"'; } + +inline std::wstring fmtPath(const Zstring& displayPath) { return fmtPath(utfCvrtTo<std::wstring>(displayPath)); } +inline std::wstring fmtPath(const wchar_t* displayPath) { return fmtPath(std::wstring(displayPath)); } } #endif //FILEERROR_H_INCLUDED_839567308565656789 |