diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:30 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:30 +0200 |
commit | c0fce877c478ddbf71a1b651c789e5ea00a00144 (patch) | |
tree | de01b0ae8fd296bd24fbca54a80f2f0ba071d461 /fileHierarchy.h | |
parent | 3.3 (diff) | |
download | FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.gz FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.bz2 FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.zip |
3.4
Diffstat (limited to 'fileHierarchy.h')
-rw-r--r-- | fileHierarchy.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/fileHierarchy.h b/fileHierarchy.h index ca029354..9bd0b7f2 100644 --- a/fileHierarchy.h +++ b/fileHierarchy.h @@ -1,3 +1,9 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// #ifndef FILEHIERARCHY_H_INCLUDED #define FILEHIERARCHY_H_INCLUDED @@ -316,6 +322,7 @@ class FileMapping : public FileSystemObject public: template <SelectedSide side> const wxLongLong& getLastWriteTime() const; template <SelectedSide side> const wxULongLong& getFileSize() const; + template <SelectedSide side> const Zstring getExtension() const; //template <SelectedSide side> const Utility::FileID& getFileID() const; virtual CompareFilesResult getCategory() const; @@ -443,11 +450,7 @@ bool DirContainer::CmpFilename::operator()(const Zstring& a, const Zstring& b) c // if (aLength != bLength) // return aLength < bLength; -#ifdef FFS_WIN //Windows does NOT distinguish between upper/lower-case - return a.CmpNoCase(b) < 0; -#elif defined FFS_LINUX //Linux DOES distinguish between upper/lower-case - return a.Cmp(b) < 0; -#endif + return a.cmpFileName(b) < 0; } inline @@ -960,6 +963,20 @@ const wxULongLong& FileMapping::getFileSize<RIGHT_SIDE>() const } +template <SelectedSide side> +inline +const Zstring FileMapping::getExtension() const +{ + //attention: Zstring::AfterLast() returns whole string if char not found! -> don't use + const Zstring& shortName = getShortName<side>(); + + const size_t pos = shortName.Find(DefaultChar('.'), true); + return pos == Zstring::npos ? + Zstring() : + Zstring(shortName.c_str() + pos + 1); +} + + //template <> //inline //const Utility::FileID& FileMapping::getFileID<LEFT_SIDE>() const |