diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
commit | b916407a2a06f8452e82b74dc44c54acbcc572b0 (patch) | |
tree | 46358e0bb035fca0f42edb4b5b8aa5f1613814af /file_hierarchy.h | |
parent | 5.20 (diff) | |
download | FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.gz FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.bz2 FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.zip |
5.21
Diffstat (limited to 'file_hierarchy.h')
-rw-r--r-- | file_hierarchy.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/file_hierarchy.h b/file_hierarchy.h index 1675d223..ce3a96b0 100644 --- a/file_hierarchy.h +++ b/file_hierarchy.h @@ -173,8 +173,8 @@ public: const FileDescriptor& right); template <SelectedSide side> - FilePair& addSubFile(const Zstring& shortNameRight, //file exists on one side only - const FileDescriptor& right); + FilePair& addSubFile(const Zstring& shortName, //file exists on one side only + const FileDescriptor& descr); SymlinkPair& addSubLink(const Zstring& shortNameLeft, const LinkDescriptor& left, //link exists on both sides @@ -833,9 +833,12 @@ void FileSystemObject::flip() inline void HierarchyObject::flip() { - std::for_each(refSubFiles().begin(), refSubFiles().end(), std::mem_fun_ref(&FilePair ::flip)); - std::for_each(refSubDirs ().begin(), refSubDirs ().end(), std::mem_fun_ref(&DirPair ::flip)); - std::for_each(refSubLinks().begin(), refSubLinks().end(), std::mem_fun_ref(&SymlinkPair::flip)); + for (FilePair& fileObj : refSubFiles()) + fileObj.flip(); + for (SymlinkPair& linkObj : refSubLinks()) + linkObj.flip(); + for (DirPair& dirObj : refSubDirs()) + dirObj.flip(); } @@ -942,18 +945,24 @@ void DirPair::flip() inline void DirPair::removeObjectL() { - std::for_each(refSubFiles().begin(), refSubFiles().end(), std::mem_fun_ref(&FileSystemObject::removeObject<LEFT_SIDE>)); - std::for_each(refSubLinks().begin(), refSubLinks().end(), std::mem_fun_ref(&FileSystemObject::removeObject<LEFT_SIDE>)); - std::for_each(refSubDirs(). begin(), refSubDirs() .end(), std::mem_fun_ref(&FileSystemObject::removeObject<LEFT_SIDE>)); + for (FilePair& fileObj : refSubFiles()) + fileObj.removeObject<LEFT_SIDE>(); + for (SymlinkPair& linkObj : refSubLinks()) + linkObj.removeObject<LEFT_SIDE>(); + for (DirPair& dirObj : refSubDirs()) + dirObj.removeObject<LEFT_SIDE>(); } inline void DirPair::removeObjectR() { - std::for_each(refSubFiles().begin(), refSubFiles().end(), std::mem_fun_ref(&FileSystemObject::removeObject<RIGHT_SIDE>)); - std::for_each(refSubLinks().begin(), refSubLinks().end(), std::mem_fun_ref(&FileSystemObject::removeObject<RIGHT_SIDE>)); - std::for_each(refSubDirs(). begin(), refSubDirs(). end(), std::mem_fun_ref(&FileSystemObject::removeObject<RIGHT_SIDE>)); + for (FilePair& fileObj : refSubFiles()) + fileObj.removeObject<RIGHT_SIDE>(); + for (SymlinkPair& linkObj : refSubLinks()) + linkObj.removeObject<RIGHT_SIDE>(); + for (DirPair& dirObj : refSubDirs()) + dirObj.removeObject<RIGHT_SIDE>(); } |