summaryrefslogtreecommitdiff
path: root/structures.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:58:10 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:58:10 +0200
commitfefe20351d0720683990b666584b6879c90bd37d (patch)
tree8ab90520ae2123ac84293b0f9cec006317e5fc01 /structures.h
parent1.18 (diff)
downloadFreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.tar.gz
FreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.tar.bz2
FreeFileSync-fefe20351d0720683990b666584b6879c90bd37d.zip
1.19
Diffstat (limited to 'structures.h')
-rw-r--r--structures.h56
1 files changed, 35 insertions, 21 deletions
diff --git a/structures.h b/structures.h
index 9fe6c823..00efb624 100644
--- a/structures.h
+++ b/structures.h
@@ -17,34 +17,36 @@ namespace FreeFileSync
};
+ enum SyncDirection
+ {
+ SYNC_DIR_LEFT,
+ SYNC_DIR_RIGHT,
+ SYNC_DIR_NONE,
+ SYNC_UNRESOLVED_CONFLICT
+ };
+
+
struct SyncConfiguration
{
SyncConfiguration() :
exLeftSideOnly(SYNC_DIR_RIGHT),
- exRightSideOnly(SYNC_DIR_RIGHT),
+ exRightSideOnly(SYNC_DIR_LEFT),
leftNewer(SYNC_DIR_RIGHT),
- rightNewer(SYNC_DIR_RIGHT),
- different(SYNC_DIR_RIGHT) {}
-
- enum Direction
- {
- SYNC_DIR_LEFT,
- SYNC_DIR_RIGHT,
- SYNC_DIR_NONE
- };
+ rightNewer(SYNC_DIR_LEFT),
+ different(SYNC_DIR_NONE) {}
- Direction exLeftSideOnly;
- Direction exRightSideOnly;
- Direction leftNewer;
- Direction rightNewer;
- Direction different;
+ SyncDirection exLeftSideOnly;
+ SyncDirection exRightSideOnly;
+ SyncDirection leftNewer;
+ SyncDirection rightNewer;
+ SyncDirection different;
bool operator==(const SyncConfiguration& other) const
{
- return exLeftSideOnly == other.exLeftSideOnly &&
+ return exLeftSideOnly == other.exLeftSideOnly &&
exRightSideOnly == other.exRightSideOnly &&
- leftNewer == other.leftNewer &&
- rightNewer == other.rightNewer &&
+ leftNewer == other.leftNewer &&
+ rightNewer == other.rightNewer &&
different == other.different;
}
};
@@ -143,18 +145,24 @@ namespace FreeFileSync
FILE_DIFFERENT,
FILE_EQUAL,
- FILE_UNDEFINED
+ FILE_CONFLICT,
};
struct FileCompareLine
{
- FileCompareLine() : selectedForSynchronization(true) {}
+ FileCompareLine(const CompareFilesResult defaultCmpResult,
+ const SyncDirection defaultDirection,
+ const bool selected) :
+ cmpResult(defaultCmpResult),
+ direction(defaultDirection),
+ selectedForSynchronization(selected) {}
FileDescrLine fileDescrLeft;
FileDescrLine fileDescrRight;
- CompareFilesResult cmpResult;
+ CompareFilesResult cmpResult;
+ SyncDirection direction;
bool selectedForSynchronization;
};
typedef std::vector<FileCompareLine> FileComparison;
@@ -164,6 +172,12 @@ namespace FreeFileSync
{
FolderPair syncPair; //directories to be synced (ending with separator)
FileComparison fileCmp;
+
+ void swap(FolderCompareLine& other)
+ {
+ std::swap(syncPair, other.syncPair);
+ fileCmp.swap(other.fileCmp);
+ }
};
typedef std::vector<FolderCompareLine> FolderComparison;
bgstack15