diff options
Diffstat (limited to 'comparison.h')
-rw-r--r-- | comparison.h | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/comparison.h b/comparison.h index 0833defe..dc8c4b8d 100644 --- a/comparison.h +++ b/comparison.h @@ -1,51 +1,74 @@ #ifndef COMPARISON_H_INCLUDED #define COMPARISON_H_INCLUDED -#include "structures.h" +#include "fileHierarchy.h" #include "library/processXml.h" class StatusHandler; -class DirectoryDescrBuffer; namespace FreeFileSync { class FilterProcess; + struct FolderPairCfg + { + FolderPairCfg(const Zstring& leftDir, + const Zstring& rightDir, + bool filterAct, + const wxString& include, + const wxString& exclude, + const SyncConfiguration& syncCfg) : + leftDirectory(leftDir), + rightDirectory(rightDir), + filterIsActive(filterAct), + includeFilter(include), + excludeFilter(exclude), + syncConfiguration(syncCfg) {} + + Zstring leftDirectory; + Zstring rightDirectory; + + bool filterIsActive; + wxString includeFilter; + wxString excludeFilter; + + SyncConfiguration syncConfiguration; + }; + std::vector<FolderPairCfg> extractCompareCfg(const MainConfiguration& mainCfg); + + //class handling comparison process class CompareProcess { public: CompareProcess(const bool traverseSymLinks, - const unsigned fileTimeTol, + const unsigned int fileTimeTol, const bool ignoreOneHourDiff, - xmlAccess::WarningMessages& warnings, - const FilterProcess* filter, //may be NULL + xmlAccess::OptionalDialogs& warnings, StatusHandler* handler); - ~CompareProcess(); - - void startCompareProcess(const std::vector<FolderPair>& directoryPairs, + void startCompareProcess(const std::vector<FolderPairCfg>& directoryPairs, const CompareVariant cmpVar, - const SyncConfiguration& config, FolderComparison& output); private: - void compareByTimeSize(const std::vector<FolderPair>& directoryPairsFormatted, FolderComparison& output); + void compareByTimeSize(const std::vector<FolderPairCfg>& directoryPairsFormatted, FolderComparison& output); - void compareByContent(const std::vector<FolderPair>& directoryPairsFormatted, FolderComparison& output); + void compareByContent(const std::vector<FolderPairCfg>& directoryPairsFormatted, FolderComparison& output); //create comparison result table and fill relation except for files existing on both sides - void performBaseComparison(const FolderPair& pair, FileComparison& output); + void performBaseComparison(const FolderPairCfg& pair, BaseDirMapping& output, std::vector<FileMapping*>& appendUndefined); //buffer accesses to the same directories; useful when multiple folder pairs are used - DirectoryDescrBuffer* descriptionBuffer; + class DirectoryBuffer; + boost::shared_ptr<DirectoryBuffer> directoryBuffer; //std::auto_ptr does not work with forward declarations! const unsigned int fileTimeTolerance; //max allowed file time deviation const bool ignoreOneHourDifference; - xmlAccess::WarningMessages& m_warnings; + xmlAccess::OptionalDialogs& m_warnings; - StatusHandler* statusUpdater; + StatusHandler* const statusUpdater; const Zstring txtComparingContentOfFiles; }; } |