diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:34 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:34 +0200 |
commit | 9084fa27f0f43cfa31dbc3a7ef87e2600c2dc3ca (patch) | |
tree | 61e2edc315a164d6fa3940b7de4b14dda0a9838c /algorithm.h | |
parent | 1.15 (diff) | |
download | FreeFileSync-9084fa27f0f43cfa31dbc3a7ef87e2600c2dc3ca.tar.gz FreeFileSync-9084fa27f0f43cfa31dbc3a7ef87e2600c2dc3ca.tar.bz2 FreeFileSync-9084fa27f0f43cfa31dbc3a7ef87e2600c2dc3ca.zip |
1.16
Diffstat (limited to 'algorithm.h')
-rw-r--r-- | algorithm.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/algorithm.h b/algorithm.h index 31c7e9ca..ab4129db 100644 --- a/algorithm.h +++ b/algorithm.h @@ -3,6 +3,7 @@ #include "FreeFileSync.h" #include "library/statusHandler.h" +#include "library/resources.h" namespace FreeFileSync @@ -11,15 +12,28 @@ namespace FreeFileSync wxString formatFilesizeToShortString(const double filesize); Zstring getFormattedDirectoryName(const Zstring& dirname); + bool endsWithPathSeparator(const Zstring& name); + void swapGrids(FileCompareResult& grid); - void adjustModificationTimes(const Zstring& parentDirectory, const int timeInSeconds, ErrorHandler* errorHandler) throw(AbortThisProcess); + void addSubElements(const FileCompareResult& grid, const FileCompareLine& relevantRow, std::set<int>& subElements); + + //manual deletion of files on main grid + wxString deleteFromGridAndHDPreview(const FileCompareResult& grid, + const std::set<int>& rowsToDeleteOnLeft, + const std::set<int>& rowsToDeleteOnRight, + const bool deleteOnBothSides); - void deleteOnGridAndHD(FileCompareResult& grid, const std::set<int>& rowsToDelete, ErrorHandler* errorHandler, const bool useRecycleBin) throw(AbortThisProcess); - void addSubElements(std::set<int>& subElements, const FileCompareResult& grid, const FileCompareLine& relevantRow); + void deleteFromGridAndHD(FileCompareResult& grid, + const std::set<int>& rowsToDeleteOnLeft, + const std::set<int>& rowsToDeleteOnRight, + const bool deleteOnBothSides, + const bool useRecycleBin, + ErrorHandler* errorHandler); - void filterCurrentGridData(FileCompareResult& currentGridData, const wxString& includeFilter, const wxString& excludeFilter); - void removeFilterOnCurrentGridData(FileCompareResult& currentGridData); + void filterGridData(FileCompareResult& currentGridData, const wxString& includeFilter, const wxString& excludeFilter); + void includeAllRowsOnGrid(FileCompareResult& currentGridData); + void excludeAllRowsOnGrid(FileCompareResult& currentGridData); wxString utcTimeToLocalString(const time_t utcTime); @@ -28,14 +42,14 @@ namespace FreeFileSync ForwardIterator custom_binary_search (ForwardIterator first, ForwardIterator last, const T& value) { first = lower_bound(first, last, value); - if (first!=last && !(value<*first)) + if (first != last && !(value < *first)) return first; else return last; } #ifdef FFS_WIN - bool isFatDrive(const Zstring& directoryName); + Zstring getLastErrorFormatted(const unsigned long lastError = 0); //try to get additional windows error information //detect if FAT/FAT32 drive needs a +-1h time shift after daylight saving time (DST) switch due to known windows bug: //http://www.codeproject.com/KB/datetime/dstbugs.aspx @@ -47,4 +61,13 @@ namespace FreeFileSync } +inline +bool FreeFileSync::endsWithPathSeparator(const Zstring& name) +{ + const size_t len = name.length(); + return len && (name[len - 1] == GlobalResources::FILE_NAME_SEPARATOR); +} + + + #endif // ALGORITHM_H_INCLUDED |