1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System. |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#include "directory_entry.h" |
6 |
|
|
|
7 |
|
|
namespace catalog { |
8 |
|
|
|
9 |
|
22 |
DirectoryEntryBase::Differences DirectoryEntryBase::CompareTo( |
10 |
|
|
const DirectoryEntryBase &other) const |
11 |
|
|
{ |
12 |
|
22 |
Differences result = Difference::kIdentical; |
13 |
|
|
|
14 |
✓✗✗✗
|
22 |
if (name() != other.name()) { |
15 |
|
|
result |= Difference::kName; |
16 |
|
|
} |
17 |
✗✓ |
22 |
if (linkcount() != other.linkcount()) { |
18 |
|
|
result |= Difference::kLinkcount; |
19 |
|
|
} |
20 |
✓✓ |
22 |
if (size() != other.size()) { |
21 |
|
2 |
result |= Difference::kSize; |
22 |
|
|
} |
23 |
✗✓ |
22 |
if (mode() != other.mode()) { |
24 |
|
|
result |= Difference::kMode; |
25 |
|
|
} |
26 |
✗✓ |
22 |
if (mtime() != other.mtime()) { |
27 |
|
|
result |= Difference::kMtime; |
28 |
|
|
} |
29 |
✓✗✗✗
|
22 |
if (symlink() != other.symlink()) { |
30 |
|
|
result |= Difference::kSymlink; |
31 |
|
|
} |
32 |
✗✓ |
22 |
if (checksum() != other.checksum()) { |
33 |
|
|
result |= Difference::kChecksum; |
34 |
|
|
} |
35 |
✗✓ |
22 |
if (HasXattrs() != other.HasXattrs()) { |
36 |
|
|
result |= Difference::kHasXattrsFlag; |
37 |
|
|
} |
38 |
|
|
|
39 |
|
22 |
return result; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
22 |
DirectoryEntryBase::Differences DirectoryEntry::CompareTo( |
43 |
|
|
const DirectoryEntry &other) const |
44 |
|
|
{ |
45 |
|
22 |
Differences result = DirectoryEntryBase::CompareTo(other); |
46 |
|
|
|
47 |
✗✓ |
22 |
if (hardlink_group() != other.hardlink_group()) { |
48 |
|
|
result |= Difference::kHardlinkGroup; |
49 |
|
|
} |
50 |
✓✗✗✓ ✗✓ |
22 |
if ( (IsNestedCatalogRoot() != other.IsNestedCatalogRoot()) || |
51 |
|
|
(IsNestedCatalogMountpoint() != other.IsNestedCatalogMountpoint()) ) { |
52 |
|
|
result |= Difference::kNestedCatalogTransitionFlags; |
53 |
|
|
} |
54 |
✗✓ |
22 |
if (IsChunkedFile() != other.IsChunkedFile()) { |
55 |
|
|
result |= Difference::kChunkedFileFlag; |
56 |
|
|
} |
57 |
✗✓ |
22 |
if (IsExternalFile() != other.IsExternalFile()) { |
58 |
|
|
result |= Difference::kExternalFileFlag; |
59 |
|
|
} |
60 |
✗✓ |
22 |
if (IsBindMountpoint() != other.IsBindMountpoint()) { |
61 |
|
|
result |= Difference::kBindMountpointFlag; |
62 |
|
|
} |
63 |
✗✓ |
22 |
if (IsHidden() != other.IsHidden()) { |
64 |
|
|
result |= Difference::kHiddenFlag; |
65 |
|
|
} |
66 |
|
|
|
67 |
|
22 |
return result; |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
} // namespace catalog |