mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 17:37:47 +01:00
proper cmake
This commit is contained in:
19
src/change_detectors/srcs/ContentsChangeDetector.cpp
Normal file
19
src/change_detectors/srcs/ContentsChangeDetector.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Created by Stepan Usatiuk on 05.05.2023.
|
||||
//
|
||||
|
||||
#include "../includes/ContentsChangeDetector.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
bool ContentsChangeDetector::check(const ComparableFile &f1, const ComparableFile &f2) const {
|
||||
if (f1.type != f2.type) return true;
|
||||
|
||||
auto b1 = f1.contents();
|
||||
auto b2 = f2.contents();
|
||||
|
||||
return !std::equal(std::istreambuf_iterator<char>(b1.get()),
|
||||
std::istreambuf_iterator<char>(),
|
||||
std::istreambuf_iterator<char>(b2.get()),
|
||||
std::istreambuf_iterator<char>());
|
||||
}
|
||||
Reference in New Issue
Block a user