summaryrefslogtreecommitdiff
path: root/zen/zstring.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:59 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:59 +0200
commita1c91f4695e208d5a8f80dc37b1818169b7829ff (patch)
tree52f5134376d17c99b6c9e53133a2eb5cf171377c /zen/zstring.h
parent5.16 (diff)
downloadFreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz
FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2
FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip
5.17
Diffstat (limited to 'zen/zstring.h')
-rw-r--r--zen/zstring.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/zen/zstring.h b/zen/zstring.h
index 435f03a2..80c267e3 100644
--- a/zen/zstring.h
+++ b/zen/zstring.h
@@ -8,9 +8,9 @@
#define ZSTRING_H_INCLUDED
#include "string_base.h"
-#ifdef FFS_LINUX
+#ifdef ZEN_LINUX
#include <cstring> //strcmp
-#elif defined FFS_MAC
+#elif defined ZEN_MAC
//#include <strings.h> //strcasecmp
#endif
@@ -49,12 +49,12 @@ public:
//############################## helper functions #############################################
-#ifdef FFS_WIN //Windows encodes Unicode as UTF-16 wchar_t
+#ifdef ZEN_WIN //Windows encodes Unicode as UTF-16 wchar_t
typedef wchar_t Zchar;
#define Zstr(x) L ## x
const Zchar FILE_NAME_SEPARATOR = L'\\';
-#elif defined FFS_LINUX || defined FFS_MAC //Linux uses UTF-8
+#elif defined ZEN_LINUX || defined ZEN_MAC //Linux uses UTF-8
typedef char Zchar;
#define Zstr(x) x
const Zchar FILE_NAME_SEPARATOR = '/';
@@ -82,7 +82,7 @@ struct EqualFilename //case-insensitive on Windows, case-sensitive on Linux
bool operator()(const zen::Zbase<Zchar, SP, AP>& lhs, const zen::Zbase<Zchar, SP, AP>& rhs) const { return cmpFileName(lhs, rhs) == 0; }
};
-#if defined FFS_WIN || defined FFS_MAC
+#if defined ZEN_WIN || defined ZEN_MAC
template <template <class, class> class SP, class AP>
void makeUpper(zen::Zbase<Zchar, SP, AP>& str);
#endif
@@ -101,7 +101,7 @@ Zstring appendSeparator(Zstring path) //support rvalue references!
//################################# inline implementation ########################################
namespace z_impl
{
-#if defined FFS_WIN || defined FFS_MAC
+#if defined ZEN_WIN || defined ZEN_MAC
int compareFilenamesNoCase(const Zchar* lhs, const Zchar* rhs, size_t sizeLhs, size_t sizeRhs);
void makeFilenameUpperCase(Zchar* str, size_t size);
#endif
@@ -111,17 +111,17 @@ void makeFilenameUpperCase(Zchar* str, size_t size);
template <template <class, class> class SP, class AP> inline
int cmpFileName(const zen::Zbase<Zchar, SP, AP>& lhs, const zen::Zbase<Zchar, SP, AP>& rhs)
{
-#if defined FFS_WIN || defined FFS_MAC
+#if defined ZEN_WIN || defined ZEN_MAC
return z_impl::compareFilenamesNoCase(lhs.data(), rhs.data(), lhs.length(), rhs.length());
-#elif defined FFS_LINUX
+#elif defined ZEN_LINUX
return std::strcmp(lhs.c_str(), rhs.c_str()); //POSIX filenames don't have embedded 0
- //#elif defined FFS_MAC
+ //#elif defined ZEN_MAC
// return ::strcasecmp(lhs.c_str(), rhs.c_str()); //locale-dependent!
#endif
}
-#if defined FFS_WIN || defined FFS_MAC
+#if defined ZEN_WIN || defined ZEN_MAC
template <template <class, class> class SP, class AP> inline
void makeUpper(zen::Zbase<Zchar, SP, AP>& str)
{
bgstack15