From c8e0e909b4a8d18319fc65434a10dc446434817c Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:19:49 +0200 Subject: 5.3 --- zen/zstring.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'zen/zstring.h') diff --git a/zen/zstring.h b/zen/zstring.h index cb6974e5..8f7486b0 100644 --- a/zen/zstring.h +++ b/zen/zstring.h @@ -47,7 +47,7 @@ private: ~LeakChecker(); static std::string rawMemToString(const void* ptr, size_t size); - void reportProblem(const std::string& message); //throw (std::logic_error) + void reportProblem(const std::string& message); //throw std::logic_error boost::mutex lockActStrings; zen::hash_map activeStrings; @@ -58,7 +58,7 @@ private: class AllocatorFreeStoreChecked { public: - static void* allocate(size_t size) //throw (std::bad_alloc) + static void* allocate(size_t size) //throw std::bad_alloc { #ifndef NDEBUG void* newMem = ::operator new(size); @@ -115,18 +115,19 @@ typedef char Zchar; const Zchar FILE_NAME_SEPARATOR = '/'; #else -#error define platform you are in: FFS_WIN or FFS_LINUX +#error define your platform: FFS_WIN or FFS_LINUX #endif //"The reason for all the fuss above" - Loki/SmartPtr -//a high-performant string for use as file name in multithreaded contexts +//a high-performance string for use as file name in multithreaded contexts typedef zen::Zbase Zstring; - - - - +inline +Zstring appendSeparator(Zstring path) //support rvalue references! +{ + return endsWith(path, FILE_NAME_SEPARATOR) ? path : (path += FILE_NAME_SEPARATOR); +} -- cgit