diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:55:48 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:55:48 +0200 |
commit | daea231de0ae28fc8343f29f09d0457cc0591461 (patch) | |
tree | a1d572442d2c903e40741a859ad47c8b0d740969 /algorithm.h | |
parent | 1.13 (diff) | |
download | FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.gz FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.bz2 FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.zip |
1.14
Diffstat (limited to 'algorithm.h')
-rw-r--r-- | algorithm.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/algorithm.h b/algorithm.h index 93d28a9e..7d20e22b 100644 --- a/algorithm.h +++ b/algorithm.h @@ -2,26 +2,39 @@ #define ALGORITHM_H_INCLUDED #include "FreeFileSync.h" +#include "library/statusHandler.h" namespace FreeFileSync { wxString formatFilesizeToShortString(const wxULongLong& filesize); wxString formatFilesizeToShortString(const double filesize); - wxString getFormattedDirectoryName(const wxString& dirname); + Zstring getFormattedDirectoryName(const Zstring& dirname); void swapGrids(FileCompareResult& grid); - void adjustModificationTimes(const wxString& parentDirectory, const int timeInSeconds, ErrorHandler* errorHandler) throw(AbortThisProcess); + void adjustModificationTimes(const Zstring& parentDirectory, const int timeInSeconds, ErrorHandler* errorHandler) throw(AbortThisProcess); void deleteOnGridAndHD(FileCompareResult& grid, const set<int>& rowsToDelete, ErrorHandler* errorHandler, const bool useRecycleBin) throw(AbortThisProcess); void addSubElements(set<int>& subElements, const FileCompareResult& grid, const FileCompareLine& relevantRow); void filterCurrentGridData(FileCompareResult& currentGridData, const wxString& includeFilter, const wxString& excludeFilter); void removeFilterOnCurrentGridData(FileCompareResult& currentGridData); - vector<wxString> compoundStringToFilter(const wxString& filterString); //convert compound string, separated by ';' or '\n' into formatted vector of wxStrings - bool sameFileTime(const wxULongLong& a, const wxULongLong& b); + bool sameFileTime(const time_t a, const time_t b); + + wxString utcTimeToLocalString(const time_t utcTime); + + //enhanced binary search template: returns an iterator + template <class ForwardIterator, class T> + ForwardIterator custom_binary_search (ForwardIterator first, ForwardIterator last, const T& value) + { + first = lower_bound(first, last, value); + if (first!=last && !(value<*first)) + return first; + else + return last; + } #ifdef FFS_WIN //detect if FAT/FAT32 drive needs a +-1h time shift after daylight saving time (DST) switch due to known windows bug: |