summaryrefslogtreecommitdiff
path: root/comparison.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:50 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:50 +0200
commit4ecfd41e36533d858c98d051ef70cab80e69e972 (patch)
treeca07d8745967d2c6a7123a5d32269cfbfaa7bd6c /comparison.h
parent2.2 (diff)
downloadFreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.tar.gz
FreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.tar.bz2
FreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.zip
2.3
Diffstat (limited to 'comparison.h')
-rw-r--r--comparison.h53
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;
};
}
bgstack15