diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:39 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:39 +0200 |
commit | d2854834e18443876c8f75e0a7f3b88d1d549fc4 (patch) | |
tree | e967b628081e50abc7c34cd264e6586271c7e728 /zen/file_error.h | |
parent | 4.1 (diff) | |
download | FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.gz FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.bz2 FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.zip |
4.2
Diffstat (limited to 'zen/file_error.h')
-rw-r--r-- | zen/file_error.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/zen/file_error.h b/zen/file_error.h index 8c49937c..2992fbbe 100644 --- a/zen/file_error.h +++ b/zen/file_error.h @@ -17,10 +17,10 @@ namespace zen class FileError //Exception base class used to notify file/directory copy/delete errors { public: - FileError(const std::wstring& message) : errorMessage(message) {} + explicit FileError(const std::wstring& message) : errorMessage(message) {} virtual ~FileError() {} - const std::wstring& msg() const { return errorMessage; } + const std::wstring& toString() const { return errorMessage; } private: std::wstring errorMessage; @@ -38,11 +38,9 @@ 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) += zen::utf8CvrtTo<std::wstring>(rhs); } //we musn't put our overloads in namespace std, but namespace zen (+ using directive) is sufficient -inline std::wstring operator+(const std::wstring& lhs, const char* rhs) { return std::wstring(lhs) += utf8CvrtTo<std::wstring>(rhs); } -inline std::wstring operator+(const std::wstring& lhs, const std::string& rhs) { return std::wstring(lhs) += utf8CvrtTo<std::wstring>(rhs); } } #endif // FILEERROR_H_INCLUDED |