Remove DataBuf::copyBytes and use std::copy instead

This commit is contained in:
Luis Díaz Más
2022-03-22 18:07:25 +01:00
parent c5c315b6e7
commit ae4df71233
19 changed files with 98 additions and 104 deletions
+7 -4
View File
@@ -28,13 +28,16 @@ int main(int argc, char* const argv[]) {
}
// Map it to memory
const Exiv2::byte* pData = file.mmap();
DataBuf buf(file.size());
std::vector<byte> buf(file.size());
// Read from the memory mapped region
buf.copyBytes(0, pData, buf.size());
std::copy_n(pData, buf.size(), buf.begin());
// Reopen file in write mode and write to it
file.write(buf.c_data(), buf.size());
file.write(buf.data(), buf.size());
// Read from the mapped region again
buf.copyBytes(0, pData, buf.size());
std::copy_n(pData, buf.size(), buf.begin());
file.close();
return EXIT_SUCCESS;