mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 17:37:47 +01:00
20 lines
564 B
C++
20 lines
564 B
C++
//
|
|
// 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>());
|
|
}
|