summaryrefslogtreecommitdiff
path: root/zen/zstring.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /zen/zstring.h
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'zen/zstring.h')
-rw-r--r--zen/zstring.h17
1 files changed, 9 insertions, 8 deletions
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<const void*, size_t> 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<Zchar, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChecked> Zstring;
-
-
-
-
+inline
+Zstring appendSeparator(Zstring path) //support rvalue references!
+{
+ return endsWith(path, FILE_NAME_SEPARATOR) ? path : (path += FILE_NAME_SEPARATOR);
+}
bgstack15